Skip to content

Add light/system/dark theme toggle - #4

Merged
Varnasr merged 3 commits into
mainfrom
claude/add-theme-toggle
Apr 7, 2026
Merged

Add light/system/dark theme toggle#4
Varnasr merged 3 commits into
mainfrom
claude/add-theme-toggle

Conversation

@Varnasr

@Varnasr Varnasr commented Apr 7, 2026

Copy link
Copy Markdown
Owner

Adds the canonical 3-button ImpactMojo theme selector (system / light / dark, defaulting to system) to FieldCases.

What

  • Inline <head> no-flash bootstrap that resolves the saved theme before paint and sets data-theme on <html>.
  • Theme selector markup (3 SVG buttons matching impactmojo.in) injected into the site-header nav on both index.html and study.html.
  • Inline <body> script that wires up clicks, persists picks to localStorage[imx_theme], clears the key when system is chosen, and follows OS appearance changes when no explicit pick is set.
  • [data-theme="dark"] block in css/style.css that re-declares only the colour variables (the existing CSS already references var(--bg), var(--text), etc. throughout, so the page flips automatically), plus .theme-selector / .theme-btn styles.

Notes

  • Uses the same imx_theme localStorage key as the rest of the ImpactMojo platform, so dark/light state is shared with the sister DevDiscourses site (same varnasr.github.io origin).
  • Some elements may still use raw hex colours instead of variables — contrast touch-ups can land in a follow-up PR if needed.

https://claude.ai/code/session_01PV6opcHjmKddEUhLUL5JUK

@Varnasr
Varnasr merged commit 09ddf13 into main Apr 7, 2026
@Varnasr
Varnasr deleted the claude/add-theme-toggle branch April 7, 2026 06:50
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