-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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(v2): support prefers-color-scheme & fix dark mode FOUC on refresh #2069
Conversation
@@ -62,9 +63,6 @@ | |||
|
|||
:global(.react-toggle--disabled) { | |||
cursor: not-allowed; | |||
opacity: 0.5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this so it doesnt look transparent on first paint.
Cursor not allowed is needed for a11y, because anyway the toggle can't be clicked until reactjs load
Deploy preview for docusaurus-2 ready! Built with commit 65f7761 |
Deploy preview for docusaurus-preview ready! Built with commit 65f7761 |
Motivation
Fix #1995
Before this PR, notice the FOUC
Also have prefer color scheme.
Have you read the Contributing Guidelines on pull requests?
yes
Test Plan
You can also try it on netlify :)
https://deploy-preview-2069--docusaurus-2.netlify.com/
cc @lex111 in case you want to give this a try. Seems that this should fit all of our use case
Extra notes
isClient
context is needed because we need to do two pass renderingWhy do we need two pass rendering ?
For full reasoning, please check the whole thread starting from this comment #2057 (comment)
I tweaked the CSS such that it looks very perfect now.