Skip to content

[material-ui] Filter only valid theme palette for generating styles#42147

Merged
siriwatknp merged 3 commits intomui:nextfrom
siriwatknp:fix/theme-entries
May 17, 2024
Merged

[material-ui] Filter only valid theme palette for generating styles#42147
siriwatknp merged 3 commits intomui:nextfrom
siriwatknp:fix/theme-entries

Conversation

@siriwatknp
Copy link
Member

From #41367 (comment)

@siriwatknp siriwatknp added the type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. label May 6, 2024
@siriwatknp siriwatknp requested a review from DiegoAndai May 6, 2024 12:48
@mui-bot
Copy link

mui-bot commented May 6, 2024

Netlify deploy preview

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

packages/material-ui/material-ui.production.min.js: parsed: +0.01% , gzip: -0.10% 😍
@material-ui/core: parsed: -0.02% 😍, gzip: -0.07% 😍

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against c6f3d6c

Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

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

Could we add a test to check for this?

@siriwatknp
Copy link
Member Author

Could we add a test to check for this?

Thanks for calling out! it's done. This will test all the component that iterate theme.palette.

Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

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

The fix looks good. In the future, I think we could export a util to make mapping palette values less verbose and not having to check the object each time 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants