Skip to content

[SnackbarContent] Fix error when theme value is CSS variable #46198

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

Merged

Conversation

0210shivam
Copy link
Contributor

Summary

This PR fixes #46192 by the SnackbarContentRoot from applying the emphasize color function to theme.palette.background.default, ensuring correct theming behavior when using background defaults. Also added a test case to verify correct application of the CSS variable

@ZeeshanTamboli ZeeshanTamboli added bug 🐛 Something doesn't work component: snackbar This is the name of the generic UI component, not the React module! labels May 24, 2025
@ZeeshanTamboli ZeeshanTamboli changed the title Fix/snackbarcontent css vars emphasize [SnackbarContent] Fix error when theme value is CSS variable May 24, 2025
@mui-bot
Copy link

mui-bot commented May 24, 2025

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 48e3c66

Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

@0210shivam Thanks for the pull request. Looks good. Just changed from using extendTheme to createTheme with cssVariables option in test.

@ZeeshanTamboli ZeeshanTamboli merged commit 661b217 into mui:master May 24, 2025
20 checks passed
@0210shivam
Copy link
Contributor Author

@0210shivam Thanks for the pull request. Looks good. Just changed from using extendTheme to createTheme with cssVariables option in test.

Thanks for merging and for the update! Appreciate it. 😊

@0210shivam 0210shivam deleted the fix/snackbarcontent-css-vars-emphasize branch May 24, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: snackbar This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SnackbarContent] when using CSS variables in palette component still tries to use emphasize when it doesn't need to
3 participants