Skip to content
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-ui] Do not generate CSS variables for a custom spacing function #43389

Merged
merged 6 commits into from
Aug 22, 2024

Conversation

siriwatknp
Copy link
Member

closes #43378

Before: I was too optimistic that the custom spacing function from users will result will used with just number or string (see the test cases), so when creating a theme with cssVariables: true, it tries to create a spacing variable and use multiply with the user's input like this calc(var(--mui-spacing) * 2).

However, this is a breaking change for a case like #43378 if the user provide a custom value when using theme.spacing('xs').

After: If the custom spacing is a function, do not create a spacing variable and do not alter the function.


@mui-bot
Copy link

mui-bot commented Aug 21, 2024

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 17784e9

@trungutt
Copy link

FYI this resolves our issue with CSS Vars 🎉

@aarongarciah aarongarciah modified the milestone: Material UI: v6 Aug 21, 2024
Co-authored-by: Aarón García Hervás <aaron.garcia.hervas@gmail.com>
Signed-off-by: Siriwat K <siriwatkunaporn@gmail.com>
@siriwatknp siriwatknp enabled auto-merge (squash) August 21, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression A bug, but worse v6.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[material-ui] Spacing customization not working on 6.0.0-beta.6 when enabling CSS variables
5 participants