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 causes flash of color change #443

Closed
Nikschavan opened this issue Aug 31, 2022 · 1 comment · Fixed by #445
Closed

Dark mode causes flash of color change #443

Nikschavan opened this issue Aug 31, 2022 · 1 comment · Fixed by #445
Assignees

Comments

@Nikschavan
Copy link

Bug Description

The preference of dark mode is stored in localStorage, this gets executed after the dom is ready and after which the required attribute is added to the body and the CSS kicks in. On slower connections this causes a flash of colors where it first loads with different style and then switches to the preferred style.

This can be emulated on local with fast or slow 3g network throttling -

Screen.Recording.2022-08-31.at.10.00.24.AM.mp4

Expected Behaviour

Page loads with preferred style instead of changing the style after load,

Steps to reproduce

  1. In the network inspector set the throttling to slow/fast 3G
  2. Set the default of the dark mode to light from theme
  3. In the frontend change the preference to be dark mode
  4. See the color scheme change,

Screenshots

Additional context

  • WordPress version:
  • Plugin version:
  • Gutenberg plugin version (if applicable):
  • PHP version:
  • OS:
  • Browser: [e.g. chrome, safari]
  • Device: [e.g. iPhone6]

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

@PatelUtkarsh
Copy link
Collaborator

Thanks @Nikschavan, I've raised #445 to fix this issue. cc: @igruszkauy

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 a pull request may close this issue.

3 participants