Skip to content

feat: add pre-hydration theme bootstrapping#33

Closed
xx7412421-cloud wants to merge 5 commits into
StableRoute-Org:mainfrom
xx7412421-cloud:main
Closed

feat: add pre-hydration theme bootstrapping#33
xx7412421-cloud wants to merge 5 commits into
StableRoute-Org:mainfrom
xx7412421-cloud:main

Conversation

@xx7412421-cloud

Copy link
Copy Markdown

Closes #27

Summary

  • add a tiny inline theme bootstrapping script before hydration
  • share the existing stableroute.theme storage key with the script builder
  • cover dark, light, system, invalid value, and unavailable localStorage branches
  • document the no-FOUC theme approach in the README

Validation

  • npm test -- themeScript.test.ts --runInBand
  • npm test -- --runInBand
  • npm run lint
  • npm run build

Documents the pre-hydration theme script approach for StableRoute-Org#27.
Injects the theme initialization script before paint for StableRoute-Org#27.
Exports the theme storage key so the pre-hydration script can use the same preference key for StableRoute-Org#27.
Adds a tiny dependency-free theme initialization script builder for StableRoute-Org#27.
Covers stored light/dark/system preferences and storage fallback behavior for StableRoute-Org#27.
@mikewheeleer

Copy link
Copy Markdown
Contributor

hey @xx7412421-cloud, thanks for the effort here 🙏 issue #27 isn't assigned to you though — to keep the campaign fair and avoid duplicate work, please claim/get assigned to it first, then open your PR. closing for now; would love to see it back once it's assigned to you 🙌

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.

Eliminate theme flash-of-unstyled-content with an inline pre-hydration script

2 participants