Negative spacing broken when using css variables and an array as spacing transformation #45500
Labels
bug 🐛
Something doesn't work
customization: css
Design CSS customizability
package: system
Specific to @mui/system
Steps to reproduce
Steps:
spacing
property of thecreateTheme
function, things work as expectedcssVariables: true
property and notice that negative spacing when passing an array to thespacing
property works as expectedCurrent behavior
When using css variables and defining an array for the
theme.spacing
property, then trying to use a negative spacing in thesx
utility, the value will be transformed to0
.Note that interestingly there's a difference between the stackblitz repro and my local environment. In my local env, the value is transformed to
-var(--mui-spacing-2)
. I'm on v6.3.1 though, didn't see anyting related to tthis in the changelog but I might have missed it.Expected behavior
Ideally the transformation would result to
calc(-1 * var(--mui-spacing-2))
Context
No response
Your environment
npx @mui/envinfo
Search keywords: negative spacing css variables
The text was updated successfully, but these errors were encountered: