Skip to content

feat: theme-aware logo, dark/light toggle, richer project entries - #3

Closed
ronaldtse wants to merge 4 commits into
mainfrom
feat/theme-aware-logo
Closed

feat: theme-aware logo, dark/light toggle, richer project entries#3
ronaldtse wants to merge 4 commits into
mainfrom
feat/theme-aware-logo

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

Adds a manual dark/light theme toggle, theme-aware logo variants, and richer project content.

Theme system

  • New ThemeToggle.astro — sun/moon button in the nav
  • Click sets data-theme on <html> and persists to localStorage['claricle-theme']
  • BaseLayout inline pre-paint script applies stored theme before first paint (no FOUC)
  • brand.css adds dark-mode overrides for all 5 spectrum tokens, so badges and accents shift coherently with the logo
  • The :not([data-theme='light']) guard on @media (prefers-color-scheme: dark) ensures a manual "light" choice always wins, even on dark-pref systems

Logo variants

  • Two new icon SVGs/PNGs in public/: _icon-light (saturated, pops on white) and _icon-dark (luminous, glows on dark)
  • New Logo.astro component — the single source of truth for picking the variant. Used in Nav, Footer, RainbowHero.
  • LogoShowcase on the About page now purposefully shows the light variant in the light card and the dark variant in the dark card

Project content

  • Enriched 5 entries from the actual repo READMEs: postscript, postscript-guide, postsvg, pdfrb, emf
  • Removed 3 fork entries Claricle doesn't maintain: pdf-core-examples, libemf2svg (kept emf2svg-ruby), pngcheck
  • Project count: 17 to 14

Includes

This branch also contains the CI Node 22 fix from PR #2 (I branched off fix/ci-node-22). Once this merges, PR #2 can be closed as superseded.

Test plan

  • CI on this PR runs green
  • Default render matches system preference (light or dark)
  • Click the sun/moon toggle in the nav — logo, page background, spectrum accents, and badge colors all swap together
  • Refresh the page — chosen theme persists (no FOUC)
  • Manual choice wins over system preference on both directions
  • /projects/ no longer lists pdf-core-examples, libemf2svg, or pngcheck
  • /about/ logo showcase displays the correct variant in each card

Astro 7.2 requires Node >= 22.12. The previous workflows used Node 20,
which caused both CI and Deploy to fail on first run.

Bumps:
- .github/workflows/ci.yml: node-version 20 -> 22
- .github/workflows/deploy.yml: node-version 20 -> 22
- package.json engines.node: >=20.0.0 -> >=22.12.0
Adds two icon variants of the Claricle logo:
- logo-claricle_icon-light: saturated colors that pop on white
- logo-claricle_icon-dark: luminous colors that glow on dark

Logo.astro is the single component that picks the variant. Default is
"auto" — swaps via CSS based on prefers-color-scheme OR [data-theme].
The :not([data-theme='light']) guard ensures a manual "light" choice
wins even when the system preference is dark.

ThemeToggle.astro adds a sun/moon button to the nav. Click sets
data-theme on <html> and persists to localStorage['claricle-theme'].

BaseLayout ships an inline pre-paint script that applies any stored
theme before first paint — prevents FOUC.

brand.css gains dark-mode overrides for all 5 spectrum tokens, so
category badges, dots, and stripes shift coherently with the logo.
The same :not([data-theme='light']) guard is applied to the media
query so the manual toggle always wins.

LogoShowcase now purposefully renders the light variant in the light
card and the dark variant in the dark card, instead of the same SVG
twice.
Content updates from the actual repo READMEs:
- postscript: pure-Ruby PS/EPS parser, typed model, serializer (lower
  layer of postsvg)
- postscript-guide: Jekyll reference site for 300+ PostScript operators,
  hosted at claricle.github.io/postscript-guide/
- postsvg: bidirectional PS/EPS to SVG transformer, no Ghostscript
- pdfrb: Arlington-model-driven PDF reader/model/serializer
- emf: clean-room pure-Ruby parser for WMF, EMF, and EMF+

Removed from the projects page (Claricle is a fork, not the maintainer):
- pdf-core-examples
- libemf2svg (the Ruby binding emf2svg-ruby remains listed)
- pngcheck

Project count: 17 to 14. Spec threshold lowered from 15 to 10.
The attribution already lives in the footer; repeating it in the hero
crowds the logo and dilutes the headline.
@ronaldtse

Copy link
Copy Markdown
Contributor Author

Superseded by #4 — all commits rebased onto #4.

@ronaldtse ronaldtse closed this Aug 7, 2026
@ronaldtse
ronaldtse deleted the feat/theme-aware-logo branch August 7, 2026 01:43
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.

1 participant