Skip to content

fix: current color mode#1773

Merged
marcel-bitfly merged 4 commits intostagingfrom
hotfix/lighmode-switch-current-value
Oct 16, 2025
Merged

fix: current color mode#1773
marcel-bitfly merged 4 commits intostagingfrom
hotfix/lighmode-switch-current-value

Conversation

@marcel-bitfly
Copy link
Contributor

Saving the current color mode in a cookie to avoid hydration issues, as this way the server already knows the current color mode.

It was necessary to use useCookie() to save the color mode instead of the storage setting of nuxtjs/color-mode, as the cookie value otherwise will be applied to the current /path. Resulting in different color modes for different `paths.

See: nuxt-modules/color-mode#301

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 15, 2025

Deploying beaconchain with  Cloudflare Pages  Cloudflare Pages

Latest commit: b35a038
Status: ✅  Deploy successful!
Preview URL: https://470e6c07.beaconchain.pages.dev
Branch Preview URL: https://hotfix-lighmode-switch-curre.beaconchain.pages.dev

View logs

@marcel-bitfly marcel-bitfly force-pushed the hotfix/lighmode-switch-current-value branch from 786de29 to daef343 Compare October 15, 2025 14:10
Saving the current `color mode` in a cookie to avoid `hydration issues`,
as this way the `server` already knows the current `color mode`.

It was necessary to use `useCookie()` to save the `color mode`
instead of the `storage setting` of `nuxtjs/color-mode`, as
the cookie value otherwise will be applied to the current `/path`.
Resulting in different `color modes` for different `paths.

See: nuxt-modules/color-mode#301
@marcel-bitfly marcel-bitfly force-pushed the hotfix/lighmode-switch-current-value branch from daef343 to b35a038 Compare October 15, 2025 14:15
@marcel-bitfly marcel-bitfly force-pushed the hotfix/lighmode-switch-current-value branch from b35a038 to b11e510 Compare October 16, 2025 06:15
@marcel-bitfly marcel-bitfly merged commit 1635a45 into staging Oct 16, 2025
1 check passed
@marcel-bitfly marcel-bitfly deleted the hotfix/lighmode-switch-current-value branch October 16, 2025 06:17
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.

2 participants