-
-
Notifications
You must be signed in to change notification settings - Fork 31.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
[material-next][theme] Move ref palette out of color schemes #40341
[material-next][theme] Move ref palette out of color schemes #40341
Conversation
Netlify deploy previewhttps://deploy-preview-40341--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
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.
If I am not mistaken, this was initially defined like this, because people may want to define different palettes for light and dark mode, although the default Material You theme does not need it. How about we accept both and have a documentation about the different use-cases?
Edit: On the other hand, we can go initially with the minimal necessary API and see if it is needed based on the feedback.
@mnajdova I think that's a valid concern.
Naming might be confusing here. In v5 we use different palettes for different color modes. In Material You, the tokens for this use case are the system tokens. These are even named similarly to v5's palette tokens: So, if people want to create tokens that change depending on the color mode, they should do it with system tokens, not reference tokens. This keeps the users in line with how the design system was designed. It will also mean our implementation is more in line with that, making it more predictable. This is how material-web has it implemented as well: system tokens have different values for light and dark modes, but reference tokens do not.
I agree with the edited part; start with what the design system defined and don't go outside unless we have a good reason for it. |
Agree! Likely it won't be needed, the palette itself should stay the same 👍 |
Move the
ref.palette
out ofcolorSchemes
as it doesn't depend on the color mode (light | dark
). Having it inside thecolorSchemes.light
might confuse users. The change in usage is the following: