[material-ui][theme] Array syntax doesn't work for values in styleOverrides in theme #41971
Labels
customization: theme
Centered around the theming features
docs
Improvements or additions to the documentation
package: material-ui
Specific to @mui/material
v5.x migration
Steps to reproduce
Link to live example: https://codesandbox.io/p/sandbox/mui5-theme-limitations-skx78f
Steps:
components
for a MUI componentstyleOverrides
key for that component using array syntaxCurrent behavior
Currently, styles added as
styleOverrides
to a theme don't work if using array syntax, but more normal string syntax will work.This is confusing because array syntax does work for custom keys in the theme. It also works when creating styles with
makeStyles
/withStyles
from@mui/styles
.For example:
You can see examples of both these behaviors in the linked Codesandbox.
Expected behavior
Ideally, array syntax would work in
styleOverrides
like it does everywhere else. At a minimum, the limitation should be documented.Context
I've been migrating my app from v4 to v5 and following the migration guide and ran into this issue. I did not see this mentioned anywhere in the breaking changes for styles and themes or anywhere else in the v5 docs.
Your environment
npx @mui/envinfo
I'm using Chrome 123.
Search keywords: theme, styleOverrides, array
The text was updated successfully, but these errors were encountered: