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

[Material You] Use md as a CSS var prefix #36177

Merged
merged 3 commits into from
Feb 14, 2023

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Feb 14, 2023

Preview: https://deploy-preview-36177--material-ui.netlify.app/material-ui/react-button/#material-you-version

Why

  • To follow the spec and leverage the official Figma tool for exporting the theme.

Below is what I get from the Material Theme Builder.

Screen Shot 2566-02-14 at 14 40 39

  • This will also ensure that Material UI and Material You can coexist on the same page without clashing due to different prefixes.

@siriwatknp siriwatknp added customization: theme Centered around the theming features design: material you labels Feb 14, 2023
function ModeSwitcher({ md2Mode }: { md2Mode: Mode | undefined }) {
const { mode, setMode } = useColorScheme();
if (md2Mode && mode !== md2Mode) {
setMode(md2Mode ?? mode);
Copy link
Member Author

Choose a reason for hiding this comment

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

I found that this line setState at the render phase which is not allowed in React.

@mui-bot
Copy link

mui-bot commented Feb 14, 2023

Netlify deploy preview

https://deploy-preview-36177--material-ui.netlify.app/

Bundle size report

Details of bundle changes

Generated by 🚫 dangerJS against c6ffe0d

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Let's add test in Material UI Next's extendTheme for the css variables prefix change.

@siriwatknp siriwatknp merged commit 15b80c2 into mui:master Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customization: theme Centered around the theming features design: material you
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants