Skip to content

Feature - Add dark variant generator script and collection-level dark mode opt-out - #751

Draft
markmead wants to merge 7 commits into
mainfrom
feature/generate-dark-variants-script
Draft

Feature - Add dark variant generator script and collection-level dark mode opt-out#751
markmead wants to merge 7 commits into
mainfrom
feature/generate-dark-variants-script

Conversation

@markmead

Copy link
Copy Markdown
Owner

Summary

  • Adds scripts/generate-dark-variants.js (pnpm run generate:dark-variants), which bulk-generates draft -dark.html files for every component missing one, using the same shared dark-mode engine as the browser-based /tools/dark-mode-generator tool
  • Adds a collection-level dark flag to the content schema (defaults to true) so a whole collection can opt out of the "X/Y Dark Mode" badge and request link when it has no real themeable surface
  • Opts grids and media out (dark: false) — grids is placeholder boxes standing in for real content, media is photo-dominated with no wrapper surface

Test plan

  • pnpm astro check
  • pnpm lint
  • Manual dev-server check that grids/media hide the dark mode badge and no other collection's badge changes

Generated by Claude Code

markmead and others added 4 commits August 19, 2026 18:39
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>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 30, 2026

Copy link
Copy Markdown

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 12b93f8 Commit Preview URL

Branch Preview URL
Aug 31 2026, 03:02 PM

claude and others added 3 commits August 30, 2026 10:39
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.
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.

2 participants