[Stepper] Cannot customize StepIcon style via StepIconProps (prop of StepLabel API) #27387
Closed
2 tasks done
Labels
component: stepper
This is the name of the generic UI component, not the React module!
support: Stack Overflow
Please ask the community on Stack Overflow
I think Issue #26830 also has the somewhat same problem but I think I have found the issue which is causing this problem.
Current Behavior 😯
StepIcon's active and completed property does not have the style applied when passing the styles with StepIconProps, but when styles are passed to root property it works only on root property.
Here I am passing styles to root, active and completed css rules but styles are applied only on root css, active and completed styles didn't work.
Expected Behavior 🤔
Styles should work on all three css rules, not just only on root.
Steps to Reproduce 🕹
https://codesandbox.io/s/material-ui-override-step-icon-color-forked-0f81n?file=/demo.js
Here for active rule instead of
.MuiStepIcon-active
class.MuiStepIcon-root.MuiStepIcon-active
is applied.If I remove
.MuiStepIcon-root
from.MuiStepIcon-root.MuiStepIcon-active
then active rule gets applied and we see active button color=red.Same goes for completed rule - It would display blue color but if we remove
.MuiStepIcon-root
from.MuiStepIcon-root.MuiStepIcon-completed
then styles get applied and it would show the new style color=greenThis is a more than 2yr old problem I found the solution here - https://stackoverflow.com/questions/52394040/material-ui-override-step-icon-style/52394315
Till this issue is fixed I am going to mark color property !important in both active and completed css classes.
The text was updated successfully, but these errors were encountered: