[website] Fix home page dark mode flicker#33545
Merged
siriwatknp merged 144 commits intomui:masterfrom Oct 18, 2022
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: https://master--material-ui.netlify.app/
After: https://deploy-preview-33545--material-ui.netlify.app/
Changes
Most of the changes are refactoring existing styles to support CSS variables
Add
theme.applyDarkStyles()to docs theme: A utility for creating styles for dark mode. It will check the theme CSS variables and apply the proper styles for dark mode.e.g.
This utility is specific to our docs because there are pages that are not wrapped with
CssVarsProvider. This way developers (us) don't need to write both syntaxes to apply dark mode styles.Wrap the home page with
CssVarsProviderand set CSS variable prefix to--muidocsso that it does not interfere with Material UI demos in the future.Theme tokens do not change (copy from the existing implementation)
Workaround for
:where()selector. This is an existing issue inemotion(as well as styled-components)Part of #15588