-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[website] Fix home page dark mode flicker #33545
Conversation
… into docs/home-improve
@mnajdova This one is fixed. |
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.
Oh yeah 🎉
<Chip label="JavaScript" onDelete={() => {}} /> | ||
</Stack> | ||
</ThemeProvider> | ||
}), | ||
]} | ||
> | ||
<Chip label="React" color="primary" onDelete={() => {}} /> | ||
<Chip label="Javascript" onDelete={() => {}} /> |
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.
There is a small regression on this one, fixed in 31eeb83.
@danilo-leal you might be interested in having a look at the new page, and seeing if there are any tweaks you would like to make. For example, some of the colors changed to be truer to how it was initially designed: https://www.figma.com/file/4uv2dT18rXJPZBbrbpw61q/Marketing-site?node-id=3224%3A11442. Before ❌: https://634559a4d8e9450008ca12e0--material-ui-docs.netlify.app/ After ✅: https://634e653c355ff00008613f12--material-ui-docs.netlify.app/ |
@siriwatknp There is a regression on Firefox and Safari: It was reported as a PM https://twitter.com/messages/2927740052-3199492438. It's probably easy to fix, I didn't look. |
Here is the fix: #34822. I will do a hotfix deployment. |
@oliviertassinari at this point, the website is a truer representation of how the website (at least the main pages) should look like rather than Figma 😬 We'll be actually updating Figma to match with what's in production, but thanks for heads-up! |
The home page now seems to default to If I manually use |
You are right! I think the home page should default to system preference. Do you want to submit a PR? |
I can't reproduce #33545 (comment) anymore. I assume the bug was fixed, somewhere? |
It was fixed in #35216 |
@siriwatknp Great, thanks for the link 👍. In pacocoursey/next-themes#20 (comment), I see that they changed the default mode config from |
At present, from my light mode latest version of Chrome on the mui.com I cannot turn on the dark mode of the website. It goes dark and back to light. |
@paulincai please create an issue with a reproduction so that we can see what is the issue. |
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
CssVarsProvider
and set CSS variable prefix to--muidocs
so 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