Skip to content

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

@markmead

Description

@markmead

Summary

Re-add the generate-dark-variants.js script to auto-create dark mode versions of components.

  • The script should be runnable via the command line to generate -dark variants of HTML files within the designated component folders.
  • Provide support for a "magic" button in the frontend UI that allows users to auto-convert a component to dark mode (if a dark mode variant does not already exist).

Script Reference

Script location: @markmead/hyperui/files/scripts/generate-dark-variants.js

Requirements

  • Script must work from command line (e.g., yarn dark:generate <component-folder>)
  • Frontend button should call the script/server endpoint to generate a dark variant on demand
  • Avoid duplicate generation if the dark version exists
  • Ensure file/folder safety checks remain in place
  • Enable seamless integration for new and existing components

Rationale
Many HyperUI users want a quick way to access dark mode versions of components. Automating this process from both the CLI and the site UI will improve the DX and maintain consistency.


See existing script for logic details and as a starting point.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions