Skip to content

Conversation

@ealmloff
Copy link
Member

Implements a light/dark mode toggle for the preview site. The CSS diff here is large because we need to switch how we style light and dark mode. You can't change media queries with JavaScript, but we want to default to using media queries to implement light and dark mode without requiring javascript. This PR switches to this syntax: var(--light, light-mode-only-styles) var(--dark, dark-mode-only-styles)

The styles.css stylesheet sets up these css variables based on media queries. While the syntax is a bit odd, this works without javascript and can easily be overwritten by the toggle

@github-actions
Copy link

@ealmloff ealmloff merged commit 315b62e into DioxusLabs:main Jun 13, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant