- Simple home page that reads theme.ts and allows for setting css body (=root) vars
- Home page uses css root variables to set colors
- Changing the css root variables changes the theme
- The system dark theme is used as a preference
- The theme setting is saved to
localStorage.theme
- The
/src/static/set-vars.ts
script compiles to/static/set-vars.js
bynpm run build-static
- The
/static/set-vars.js
script is set to load as the first thing in the body in/gatsby-ssr.js
- The
set-vars.js
sets the theme before parsing the html body prevent flashing the wrong theme
-
Notifications
You must be signed in to change notification settings - Fork 0
wheelroom/wheelroom-labs
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Labs: test thema switcher with local storage and without flash
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published