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.
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]
toprefers-color-scheme
with PostCSS, which will improve the experience for users with JavaScript disabled.Chores