Add dark-mode toggle and site polish - #27
Merged
Merged
Conversation
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
A small brush-up of the site: a Light / Dark / System theme toggle (remembered per browser), live catalog counts in the hero, a few accessibility touches, and a CI version bump.
Changes
src/components/ThemeToggle.astro): header control cycling System -> Light -> Dark. Preference persists inlocalStorageand is applied before paint by an inline<head>script (no flash). Defaults to System, so nothing changes for existing visitors.darkModeswitched frommediato['selector', '[data-theme="dark"]']; dark palette/accent tokens moved onto:root[data-theme="dark"]inglobal.css.color-schemeset per theme.index.astro): live "N tools across M categories" line.id="main"; the toggle carries anaria-labelthat reflects the current choice. Hid the Criteria link on very small screens to keep the header tidy.actions/checkoutandactions/setup-nodeto v5 (clears the Node 20 deprecation warnings).Verification
npx astro check-> 0 errors/warnings/hints.npm run buildpasses; built CSS confirmsdark:utilities key on[data-theme=dark]and the theme is set before paint.