Skip to content

Feature - Add neobrutalism dark variants and improve dark mode generation script#701

Open
Copilot wants to merge 19 commits intomainfrom
copilot/re-add-dark-mode-script-again
Open

Feature - Add neobrutalism dark variants and improve dark mode generation script#701
Copilot wants to merge 19 commits intomainfrom
copilot/re-add-dark-mode-script-again

Conversation

Copy link
Copy Markdown

Copilot AI commented May 6, 2026

This pull request adds and updates dark mode support across neobrutalism examples, and hardens the dark variant generation tooling used to produce *-dark.html files.

Dark mode examples and styling updates:

  • Added/updated neobrutalism dark variants across multiple component groups (including accordions, checkboxes, selects, progress bars, buttons, and related collection entries) to keep dark previews consistent and functional.
  • Improved styling consistency between light and dark examples, including neobrutalism contrast/shadow behavior and utility cleanup in generated/example markup.

Tooling and configuration:

  • Added dark:generate in package.json to run scripts/generate-dark-variants.js with Node.js.
  • Updated ESLint config for Node.js globals in scripts/**.
  • Improved scripts/generate-dark-variants.js behavior:
    • Correctly handles chained variant prefixes when generating dark: classes.
    • Keeps gray-900 -> white special handling while using valid shade inversion for 900.
    • Enforces safer path validation for generation bounds.
    • Removes redundant black/ and white/ color map entries while preserving slash-opacity support (e.g. black/90, white/50) through existing matching logic.
    • Tracks per-file generation failures and exits non-zero on partial failure for reliable CI signaling.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 7, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
hyperui 180021c Commit Preview URL

Branch Preview URL
May 08 2026, 06:09 PM

Copilot stopped work on behalf of markmead due to an error May 7, 2026 14:19
Copilot AI and others added 4 commits May 7, 2026 14:22
This reverts commit 6253470.

Co-authored-by: markmead <50486078+markmead@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reintroduces the dark-variant generation utility as a plain Node.js script and wires it into the repo tooling, aiming to restore the previous “generate dark HTML variants” workflow without requiring tsx.

Changes:

  • Added scripts/generate-dark-variants.js to generate *-dark.html files from existing example HTML.
  • Added dark:generate npm script to run the generator with node.
  • Updated ESLint config to define Node globals for files under scripts/**.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
scripts/generate-dark-variants.js New Node.js generator that transforms HTML class="" attributes to include dark: equivalents.
package.json Adds dark:generate script for running the generator.
eslint.config.ts Marks scripts/** as Node-global context for linting.

Comment thread scripts/generate-dark-variants.js Outdated
Comment thread scripts/generate-dark-variants.js Outdated
Comment thread scripts/generate-dark-variants.js
Copilot AI and others added 2 commits May 8, 2026 09:17
@markmead markmead marked this pull request as ready for review May 8, 2026 09:24
markmead added 2 commits May 8, 2026 12:46
Add dark-mode HTML variants for many Neobrutalism component examples (accordions, alerts, badges, buttons, cards, checkboxes, inputs, progress-bars, selects, tabs, textareas) and update existing example pages. Update public/component.css (theme/base utilities) and refresh the Neobrutalism collection MDX files under src/content/collection/neobrutalism to reflect the example and style changes.
@markmead markmead changed the title [WIP] Re-add dark mode script for generating component variants Feature - Add dark mode script for generating component variants May 8, 2026
@markmead markmead requested a review from Copilot May 8, 2026 12:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 82 out of 83 changed files in this pull request and generated 13 comments.

Comment on lines +21 to +26
const COLOR_MAP = {
white: 'gray-900',
'white/': 'gray-900/',
black: 'white',
'black/': 'white/',
}
Comment thread public/examples/neobrutalism/selects/1.html
Comment thread public/examples/neobrutalism/selects/2.html
Comment thread public/examples/neobrutalism/selects/1-dark.html
Comment thread public/examples/neobrutalism/selects/2-dark.html
Comment thread public/examples/neobrutalism/checkboxes/3-dark.html
Comment thread public/examples/neobrutalism/accordions/2-dark.html
Comment thread public/examples/neobrutalism/accordions/3-dark.html Outdated
Comment thread public/examples/neobrutalism/accordions/2-dark.html
Comment thread public/examples/neobrutalism/accordions/2-dark.html
markmead added 2 commits May 8, 2026 13:56
Delete duplicate `*-dark.html` example files and consolidate examples by adding the explicit `shadow-black` utility to many neobrutalism example pages. Updated components include accordions, alerts, badges, cards, progress-bars and others so shadows are rendered consistently. This cleans up dark-mode duplicates and unifies shadow styling across the example pages.
Add dark-mode demo pages for Neobrutalism components. New HTML examples were added under public/examples/neobrutalism for accordions, alerts, badges, buttons, cards, checkboxes, inputs, progress-bars, selects, tabs, and textareas. Each file references /component.css and /component.js and demonstrates dark-theme styling and component interactions.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 86 out of 87 changed files in this pull request and generated 9 comments.

Comment thread src/content/collection/neobrutalism/inputs.mdx
Comment thread public/examples/neobrutalism/selects/1.html
Comment thread public/examples/neobrutalism/selects/1-dark.html
Comment thread public/examples/neobrutalism/selects/2.html
Comment thread public/examples/neobrutalism/selects/2-dark.html
Comment thread public/examples/neobrutalism/checkboxes/1.html
Comment thread public/examples/neobrutalism/checkboxes/1-dark.html
Comment thread public/examples/neobrutalism/buttons/4-dark.html Outdated
Comment on lines +231 to +242
try {
const lightContent = fs.readFileSync(lightPath, 'utf-8')
const darkContent = transformHtmlContent(lightContent)

fs.writeFileSync(darkPath, darkContent, 'utf-8')

console.log(`✨ Created: ${processFile.replace('.html', '-dark.html')}`)

generatedCount++
} catch (error) {
console.error(`❌ Error processing ${processFile}: ${error}`)
}
Tweak and reorganize example components for the neobrutalism theme. Removed explicit border classes from button examples (buttons/4.html, buttons/4-dark.html). Deleted dark checkbox variants (checkboxes/1-dark.html, 2-dark.html, 3-dark.html) and simplified the checkbox input classes in checkboxes/1.html (removed redundant checked:text-white). Added new search input examples (public/examples/neobrutalism/inputs/3.html and inputs/3-dark.html) for light and dark variants.
@markmead
Copy link
Copy Markdown
Owner

markmead commented May 8, 2026

@copilot Address the PR comments.

Agent-Logs-Url: https://github.com/markmead/hyperui/sessions/f953f297-adc6-4308-9e1f-97e0653533f0

Co-authored-by: markmead <50486078+markmead@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 84 out of 85 changed files in this pull request and generated 6 comments.

Comment thread src/content/collection/neobrutalism/checkboxes.mdx
Comment thread public/examples/neobrutalism/selects/1.html
Comment thread public/examples/neobrutalism/selects/2.html
Comment thread public/examples/neobrutalism/selects/1-dark.html
Comment thread public/examples/neobrutalism/selects/2-dark.html
Comment thread src/content/collection/neobrutalism/accordions.mdx
markmead added 2 commits May 8, 2026 19:08
Add three dark-themed example pages for neobrutalism checkboxes: public/examples/neobrutalism/checkboxes/1-dark.html, 2-dark.html, and 3-dark.html. Each page includes component.css and component.js, uses the .dark root class and utility classes for styling, and demonstrates variations: a simple stacked checkbox list (1), checkboxes with descriptive copy (2), and a grouped card-style list with dividers and hover/focus highlights (3). Accessibility reinforced with fieldset/legend and labeled inputs.
@markmead
Copy link
Copy Markdown
Owner

markmead commented May 8, 2026

@copilot Address the PR feedback – it appears it's been partially implemented. I added the black/ and white/ classes because of Tailwind CSS shorthand black/90. However, I suspect that is not needed.

Copy link
Copy Markdown
Author

Copilot AI commented May 8, 2026

@copilot Address the PR feedback – it appears it's been partially implemented. I added the black/ and white/ classes because of Tailwind CSS shorthand black/90. However, I suspect that is not...

Addressed in 39f8035: removed the white/ and black/ COLOR_MAP entries, and kept slash-opacity support via existing matching so classes like black/90 and white/50 still transform correctly. The generator also now reports partial failures with a non-zero exit. Screenshot: N/A (script-only change, no UI impact).

Copilot AI changed the title Feature - Add dark mode script for generating component variants Feature - Add neobrutalism dark variants and improve dark mode generation script May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-add dark mode script for auto-generating dark component variants

3 participants