Feature - Add dark variant generator script and collection-level dark mode opt-out - #751
Draft
markmead wants to merge 7 commits into
Draft
Feature - Add dark variant generator script and collection-level dark mode opt-out#751markmead wants to merge 7 commits into
markmead wants to merge 7 commits into
Conversation
Revives the old generate-dark-variants script (removed in #720 when the browser-based generator tool shipped) as a thin CLI on top of the shared src/lib/dark-mode transform engine, so the two no longer duplicate logic. Scans public/examples across all categories and writes draft -dark.html files for any light file missing one; dark: true still needs adding by hand per component after reviewing the output. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Some collections (grids, media) are pure layout/structure components that don't need a dark variant. Adds a `dark: false` frontmatter flag so generate-dark-variants.js skips them when scanning for missing variants, and ComponentPost.astro hides the dark mode count badge entirely rather than showing a permanent 0/N. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperui | 12b93f8 | Commit Preview URL Branch Preview URL |
Aug 31 2026, 03:02 PM |
5 tasks
Lets a run be scoped to one collection instead of always scanning every category, so fixing a single collection's missing dark variant no longer generates unrelated draft files across the rest of the repo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/generate-dark-variants.js(pnpm run generate:dark-variants), which bulk-generates draft-dark.htmlfiles for every component missing one, using the same shared dark-mode engine as the browser-based/tools/dark-mode-generatortooldarkflag to the content schema (defaults totrue) so a whole collection can opt out of the "X/Y Dark Mode" badge and request link when it has no real themeable surfacegridsandmediaout (dark: false) —gridsis placeholder boxes standing in for real content,mediais photo-dominated with no wrapper surfaceTest plan
pnpm astro checkpnpm lintgrids/mediahide the dark mode badge and no other collection's badge changesGenerated by Claude Code