close
Skip to content

[theme] Do not create channel tokens for custom colors when nativeColor is used#47765

Merged
ZeeshanTamboli merged 8 commits intomui:masterfrom
ZeeshanTamboli:theme-do-not-throw-error-for-custom-colors-issue-47740
Mar 30, 2026
Merged

[theme] Do not create channel tokens for custom colors when nativeColor is used#47765
ZeeshanTamboli merged 8 commits intomui:masterfrom
ZeeshanTamboli:theme-do-not-throw-error-for-custom-colors-issue-47740

Conversation

@ZeeshanTamboli
Copy link
Copy Markdown
Member

@ZeeshanTamboli ZeeshanTamboli commented Feb 14, 2026

Resolves comment #47740 (comment).

We do not create the channel tokens when nativeColor is used in theme. This is also mentioned in the docs: https://mui.com/material-ui/migration/upgrade-to-native-color/#remove-usage-of-channel-tokens.
This also avoids throwing the warning mentioned in the comment.


Before: https://stackblitz.com/edit/nze14hel-zah7msat?file=src%2FDemo.tsx
After: https://stackblitz.com/edit/nze14hel-cqrupmyz?file=src%2FDemo.tsx

@ZeeshanTamboli ZeeshanTamboli added type: bug It doesn't behave as expected. customization: theme Higher level theming customizability. labels Feb 14, 2026
@mui-bot
Copy link
Copy Markdown

mui-bot commented Feb 14, 2026

Netlify deploy preview

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

Bundle size report

Bundle Parsed size Gzip size
@mui/material 🔺+9B(0.00%) 🔺+6B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 98087bb

codeCraft-Ritik

This comment was marked as spam.

Comment thread packages/mui-material/src/styles/createThemeWithVars.js
@zannager zannager added the scope: system The system, the design tokens / styling foundations used across components. eg. @mui/system with MUI label Feb 16, 2026
@ZeeshanTamboli ZeeshanTamboli added v7.x needs cherry-pick The PR should be cherry-picked to master after merge. labels Feb 16, 2026
@ZeeshanTamboli
Copy link
Copy Markdown
Member Author

Could this be reviewed?

@siriwatknp
Copy link
Copy Markdown
Member

I have created mui/mui-x#21892, I think we can proceed with this PR.

Comment thread packages/mui-material/src/styles/createThemeWithVars.js Outdated
Comment thread packages/mui-material/src/styles/createThemeWithVars.js Outdated
Copy link
Copy Markdown
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

minor suggestions

ZeeshanTamboli and others added 5 commits March 30, 2026 12:36
Co-authored-by: Siriwat K <siriwatkunaporn@gmail.com>
Signed-off-by: Zeeshan Tamboli <zeeshan.tamboli@gmail.com>
Co-authored-by: Siriwat K <siriwatkunaporn@gmail.com>
Signed-off-by: Zeeshan Tamboli <zeeshan.tamboli@gmail.com>
@ZeeshanTamboli ZeeshanTamboli merged commit d340742 into mui:master Mar 30, 2026
19 checks passed
@ZeeshanTamboli ZeeshanTamboli deleted the theme-do-not-throw-error-for-custom-colors-issue-47740 branch March 30, 2026 07:35
@github-actions
Copy link
Copy Markdown

Cherry-pick PRs will be created targeting branches: v7.x

github-actions Bot pushed a commit that referenced this pull request Mar 30, 2026
…lor` is used (#47765)

Signed-off-by: Zeeshan Tamboli <zeeshan.tamboli@gmail.com>
Co-authored-by: Siriwat K <siriwatkunaporn@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

customization: theme Higher level theming customizability. needs cherry-pick The PR should be cherry-picked to master after merge. scope: system The system, the design tokens / styling foundations used across components. eg. @mui/system with MUI type: bug It doesn't behave as expected. v7.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants