Custom the dark mode storageKey. #3190
sgalcheung
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of
starlight
are you using?0.34.0
What is your idea?
When I used
<StarlightPage>
, I also wanted to sync the dark mode in the main website and Starlight Page.Why is this feature necessary?
Add a custom point to manage the key, so that we won't have redundant local keys.
Here is an example:
https://github.com/sgalcheung/ScrewFast/blob/main/src/components/ui/starlight/ThemeSelect.astro
https://github.com/sgalcheung/ScrewFast/blob/main/src/components/ui/starlight/MobileMenuFooter.astro
To sync the theme storage key, we have to replace two components.
Do you have examples of this feature in other projects?
Participation
Here is an implementation example:
Add a zod field
themStorageKey
touser-config.ts
Beta Was this translation helpful? Give feedback.
All reactions