Skip to content

Add dark mode toggle. - #10

Open
willtemperley wants to merge 1 commit into
nearmelab:mainfrom
willtemperley:main
Open

willtemperley wants to merge 1 commit into
nearmelab:mainfrom
willtemperley:main

Conversation

@willtemperley

Copy link
Copy Markdown

Description

Add dark mode toggle

The dark: styles already existed but were never activated. This adds the missing toggle + persistence.

Changes

  • New ThemeToggle.astro: flips .dark on <html>, saves to localStorage.
  • NavBar.astro: render the toggle in the action cluster.
  • Layout <head>: is:inline script sets the theme before paint (localStorage, falling back to prefers-color-scheme) — no flash.
  • global.css: small base block for color-scheme + transition.

Respects system preference, persists manual choice, no flash on load.

Closes #4.

Type of Change

  • Bug fix
  • [x ] New feature
  • Breaking change
  • Documentation update

Testing

  • [x ] Tested locally
  • Tested on mobile/tablet

Screenshots

image

Related Issues

Fixes #4

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.

Implement dark mode with theme persistence

1 participant