Skip to content

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.


@siriwatknp siriwatknp added type: regression A bug, but worse, it used to behave as expected. v6.x labels Aug 21, 2024
@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

type: regression A bug, but worse, it used to behave as expected. 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