-1

I would like to change the color of the icon from enter image description here

to this : enter image description here

I know that it's not .Mui-active nor .Mui-completed , I tested .Mui-disabled but it doesn't work

here is the link to the sandbox :

https://codesandbox.io/s/horizontalnonlinearstepper-demo-material-ui-forked-u2yt0e?fontsize=14&hidenavigation=1&theme=dark

Any help ?

Abdelkader
  • 43
  • 8
  • Please copy and paste the code here instead of giving a link. This is because code on other sites can change over time. See this [FAQ for more detail](https://meta.stackoverflow.com/q/254428/17493431) – Ethan Jul 16 '22 at 20:33
  • Also, it seems that is this already solved? – Chaotic Pechan Jul 19 '22 at 02:27

1 Answers1

1

This one was a bit tricky, I had to add quite a few styles to achieve that.

First I've given every icon a round and visible border. The second style object ensures that the icon color is white and it excludes checked icons since we want them to look like usual.

  ".MuiSvgIcon-root": {
    borderRadius: "50%",
    border: "1px solid #1976d2"
  },
  ".MuiSvgIcon-root:not(.Mui-completed)": {
    color: "white"
  }

Next the text is being filled with the same color as the border and I made it more bold to be more readable.

  ".MuiStepIcon-text": {
    fill: "#1976d2",
    fontWeight: 500
  }

Last but not least the active icon should still remain the same so I've reduced the margin from -4px to -3px since the border adds 1px in every direction. The check icon should remain white so thats styled with fill: "white".

  ".MuiSvgIcon-root.Mui-active": {
    color: "#1976d2",
    padding: "3px",
    borderRadius: "50%",
    border: "1px solid #1976d2",
    marginY: "-3px"
  },
  ".Mui-active .MuiStepIcon-text": {
    fill: "white"
  }

And this is the result:

enter image description here

Live Demo

Edit HorizontalNonLinearStepper demo — Material UI (forked)

sm3sher
  • 2,764
  • 1
  • 11
  • 23