Overriding component style with theme makes color prop unusable #29529
Labels
package: system
Specific to @mui/system
support: Stack Overflow
Please ask the community on Stack Overflow
When creating a theme and overriding AppBar component with
stylesOverride
the color prop on the Appbar does not work.Current Behavior 😯
When creating a theme override for AppBar component like this:
The appbar has the color I specify above (which is correct)
But when I do
<AppBar color="secondary" />
The color is still stuck on the color specified in the theme override.Expected Behavior 🤔
When specifying another color in the color prop, the theme should not have priority over the color prop.
Steps to Reproduce 🕹
https://codesandbox.io/s/angry-darkness-b2h7y?file=/src/Demo.tsx
When checking the chrome devtools you can see the load order of the background-color is wrong.
the theme override is always loaded last, therefor the color prop value is overrwritten.
Context 🔦
I want all components to follow a default styling, but in some cases my components need to have another color than default.
The text was updated successfully, but these errors were encountered: