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

Darkmode: Fixed initial flash of light 📸 #396

Merged
3 commits merged into from
Mar 26, 2022
Merged

Darkmode: Fixed initial flash of light 📸 #396

3 commits merged into from
Mar 26, 2022

Conversation

EthanThatOneKid
Copy link
Owner

The Proposal

When the user prefers light but saved the dark theme in localStorage, they will still get the flash of light. But if they prefer dark, there should be no flash. This should help at least eliminate flash for users who actually have prefers dark set on their computer

Changelog

  • Removed unused CSS styles from global.css
  • Refactored dark/light mode logic in global.css (see @media(prefers-color-scheme))
  • Added .light selector into the mix in src/lib/stores/theme.ts

Resolves #358.

@EthanThatOneKid EthanThatOneKid added enhancement New feature or request bugfix A PR that fixes a bug labels Mar 25, 2022
@vercel
Copy link

vercel bot commented Mar 25, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/ethanthatonekid/acm-csuf-site/BnhDnnviMGgzxy2cBTmx8JNmPabT
✅ Preview: https://acm-csuf-site-git-fix-358-ethanthatonekid.vercel.app

@jaasonw
Copy link
Contributor

jaasonw commented Mar 26, 2022

there is now a flash of dark mode when light mode is selected on a dark mode system

@jaasonw jaasonw disabled auto-merge March 26, 2022 00:35
@jaasonw jaasonw enabled auto-merge March 26, 2022 00:36
@jaasonw
Copy link
Contributor

jaasonw commented Mar 26, 2022

ignore that i was trying some shit xd

@jaasonw jaasonw disabled auto-merge March 26, 2022 01:04
@vercel vercel bot temporarily deployed to Preview March 26, 2022 01:05 Inactive
@EthanThatOneKid EthanThatOneKid requested a review from a user March 26, 2022 22:12
@vercel vercel bot temporarily deployed to Preview March 26, 2022 22:19 Inactive
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, fixed link colors myself.

@ghost ghost merged commit 3e3d89c into main Mar 26, 2022
@ghost ghost deleted the fix/358 branch April 17, 2022 17:13
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix A PR that fixes a bug enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flash of light mode when dark mode is set
2 participants