Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark mode: Fix ssr issue reloading the page when dark mode is enabled #1789

Merged
merged 1 commit into from
Nov 29, 2021
Merged

Dark mode: Fix ssr issue reloading the page when dark mode is enabled #1789

merged 1 commit into from
Nov 29, 2021

Conversation

manvoid
Copy link
Contributor

@manvoid manvoid commented Nov 27, 2021

Summary

When dark mode is selected and the page is reloaded the ssr doesn't know the page is in dark mode so it ssr the page with light mode instead but the browser has dark mode so this makes a mistmatch and the UI doesn't have the correct colors.

This PR changes the way the dark mode value is stored to use cookies instead of local storage so the ssr can generate the page correctly whe dark mode is enabled.

Links

Checklist

  • Added unit and Flow Tests
  • Added documentation + accessibility tests
  • Verified accessibility: keyboard & screen reader interaction
  • Checked dark mode, responsiveness, and right-to-left support
  • Checked stakeholder feedback (e.g. Gestalt designers)

@manvoid manvoid requested a review from a team as a code owner November 27, 2021 03:55
@netlify
Copy link

netlify bot commented Nov 27, 2021

✔️ Deploy Preview for gestalt ready!

🔨 Explore the source changes: 6c7b1a1

🔍 Inspect the deploy log: https://app.netlify.com/sites/gestalt/deploys/61a1ac16abefe70007b416f0

😎 Browse the preview: https://deploy-preview-1789--gestalt.netlify.app

@christianvuerings christianvuerings added the patch release Patch release label Nov 29, 2021
@AlbertCarreras AlbertCarreras merged commit b7be3fb into pinterest:master Nov 29, 2021
@manvoid manvoid deleted the fix-dark-mode-ssr branch December 1, 2021 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch release Patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants