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

feat: light mode with optional dark mode toggle #999

Merged
merged 4 commits into from
Jul 28, 2020

Conversation

olizilla
Copy link
Collaborator

Allow the user to specify their prefered color-scheme. It will default to whatever the users OS color-scheme preference is.

Light mode
Screenshot 2020-07-21 at 09 48 47

Dark mode
Screenshot 2020-07-21 at 09 48 54

This is implemented by providing dark mode as an alternate stylesheet, and providing a toggle to let the user switch between the two. As the specs site is static, we can't rely on the server to maintain the chosen color-scheme, so we use local storage. If you have selected dark theme, you may see the light theme for a few milliseconds before we get the preference from localstorage to tell us to switch to dark mode. I've mitigated it as much as I can for this iteration, and as this is a very low priority feature, I'm not gonna explore it any further for now. It's more noticable in FF than Chromes.

Fixes: #983

License: MIT
Signed-off-by: Oli Evans oli@tableflip.io

olizilla added 2 commits July 21, 2020 09:44
Allow the user to specify their prefered color-scheme.

Fixes: #983

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
@olizilla olizilla requested a review from hugomrdias July 21, 2020 08:59
@olizilla
Copy link
Collaborator Author

@hugomrdias merge conflicts fixed up on this here color-scheme selector PR

hugomrdias
hugomrdias previously approved these changes Jul 23, 2020
Copy link
Contributor

@hugomrdias hugomrdias left a comment

Choose a reason for hiding this comment

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

LGTM can you rebase again :/

@olizilla
Copy link
Collaborator Author

@hugomrdias conflicts be gone

@olizilla
Copy link
Collaborator Author

ping @hugomrdias pls to eyes.

@hugomrdias hugomrdias merged commit 2272e00 into beta Jul 28, 2020
@hugomrdias hugomrdias deleted the feat/color-scheme-toggle branch July 28, 2020 09:45
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.

Add light mode UI
2 participants