Skip to content

[material-next][palette] Adding missing tokens#39518

Open
MarcosBustamante wants to merge 3 commits intomui:v5.xfrom
MarcosBustamante:m3_color_palette
Open

[material-next][palette] Adding missing tokens#39518
MarcosBustamante wants to merge 3 commits intomui:v5.xfrom
MarcosBustamante:m3_color_palette

Conversation

@MarcosBustamante
Copy link
Copy Markdown

@mui-bot
Copy link
Copy Markdown

mui-bot commented Oct 19, 2023

Netlify deploy preview

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

@mui/material-next: parsed: +0.57% , gzip: +0.24%

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 4a1afb7

@DiegoAndai DiegoAndai changed the title Adding missing material-next palette tokens [material-next][palette] Adding missing tokens Oct 19, 2023
@DiegoAndai DiegoAndai self-requested a review October 19, 2023 14:58
@DiegoAndai
Copy link
Copy Markdown
Member

Hey @MarcosBustamante! Thanks for contributing 😊

I would love to hear if you're going to use these tokens for something specific, as feedback on our Material You initiative 😃

Comment on lines 55 to 78
'0': '#000000',
'4': '#0f0d14',
'6': '#15121a',
'10': '#201a1c',
'12': '#211e26',
'17': '#2e282a',
'20': '#352f30',
'22': '#393335',
'24': '#3b3840',
'30': '#4c4546',
'40': '#645c5e',
'50': '#7e7577',
'60': '#988e90',
'70': '#b3a9aa',
'80': '#cfc4c5',
'87': '#ded8e3',
'90': '#ebe0e1',
'92': '#f1e5e6',
'94': '#f2ebf7',
'95': '#faeef0',
'96': '#f7f2fa',
'98': '#fef7ff',
'99': '#fffbff',
'100': '#ffffff',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if there's a better way to handle the concept of colors having 100 tones in TS than adding all 100 values by hand? What do you think? 🤔 Also, I just checked that their Figma theme builder plugin doesn't export all neutral tones 😅 it only exports some (0, 10, 20, 30, ..., 90, 95, 99, 100). Although it does export fixed values for the tokens that use these colors, e.g., surfaceDim

Maybe we could fill the gaps with some color calculation?

Same question for the MD3Tones and MD3NeutralTones TS types. Feels like we should have a better way to do it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

As you mentioned, only a few tones are used in the 100-tone spectrum. I also tried to use the @material\material-color-utilities to generate everything at once on my project, but it didn't generate all needed tones. The only solution that worked to me is the Figma Theme Builder tool.

An interesting question to make is if it worth to create an automated way to generate the colors. My first impression is that, it is a better idea to keep it static, decreasing the processing needed and the chances for unexpected errors.

A possible alternative is to let the type more generic:

type neutral = {[key: number]: string} 

And, maybe, accepting the function create[Light|Dark|Custom]ColorScheme, that is responsible to connect the tones with the color scheme, as parameter on the extendTheme().colorSchemes configs.

But it is definitely an important problem to understand how color schema mapping can be generalized. However, expanding the component library sounds a bigger priority for now, since it blocks people to easily use material-next.

@MarcosBustamante
Copy link
Copy Markdown
Author

Hello @DiegoAndai.

I would love to hear if you're going to use these tokens for something specific, as feedback on our Material You initiative 😃

Yes. I am working in a new product and we are using mui as our component library. The initial plan is to follow the m3 specifications in order to build modern views. The tokens that I added are important, since m3 use different tones to set hierarchy.

The fixed tokens helps to generate more contrast inside the application. Since it will be important in the short term, I decided to add it.

@MarcosBustamante
Copy link
Copy Markdown
Author

@DiegoAndai, Could you share the plans to expand the component library? Is there ETAs? I am restyling lots of components to follow the m3 guidelines

@DiegoAndai
Copy link
Copy Markdown
Member

DiegoAndai commented Oct 24, 2023

@MarcosBustamante, we're tracking the progress here: #29345 (See the Ready to take ⭐ section)

For the material-ui package, we're targeting to have all the components migrated and released as stable for v6, which is planned for September 2024. Still, we're constantly working and releasing updated components in material-next package.

If you're restyling components to follow Material You, would you like to contribute to the material-next package? You could help officially support components faster, and you will be able to use them out of the box. If you're willing to contribute, I would appreciate it and help guide the effort 😊

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 18, 2024
@oliviertassinari oliviertassinari added scope: all components Widespread work has an impact on almost all components. and removed package: material-ui labels Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design: material you PR: out-of-date The pull request has merge conflicts and can't be merged. scope: all components Widespread work has an impact on almost all components.

4 participants