Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dark mode when javascript disabled #5

Merged
merged 3 commits into from
Nov 26, 2023
Merged

Conversation

SethFalco
Copy link
Member

@SethFalco SethFalco commented Nov 26, 2023

Docusaurus depends on JavaScript to handle theming, so users with JavaScript disabled would normally be stuck on light mode.

In our case, the website just looked broken because I used prefers-color-scheme for my styles instead of [data-theme=dark] so some dark mode styled would be applied while others wouldn't.

This adds a plugin which retroactively replaces selectors from [data-theme=dark] to prefers-color-scheme with PostCSS, which will improve the experience for users with JavaScript disabled.

Chores

  • Removes a redundant fragment.
  • Optimizes SVGs with new optimizations in SVGO v3.0.4.

@SethFalco SethFalco merged commit 92c7c86 into svg:main Nov 26, 2023
1 check passed
@SethFalco SethFalco deleted the chores branch November 26, 2023 00:14
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