如何在 Material UI Stepper Step 中自定义颜色?

nik*_*ohn 6 javascript css reactjs material-ui

我正在尝试在Material UI Steppers上自定义禁用的 Step 颜色

默认颜色为蓝色(启用)+ 灰色(禁用)。但我希望将其更改为如下所示:

在此处输入图片说明

但我似乎无法IconStepLabel. 我已经尝试将 CSS 应用于IconContainer,但特异性还不够。

我的代码在这里可用:https : //codesandbox.io/s/0102v4z1op

蒂亚!

Ade*_*ran 5

<Stepper
      activeStep={activeStep}
      orientation="vertical"
      connector={false}
    >
      {steps.map((label, index) => {
        return (
          <Step key={label} className={classes.step} classes={{ completed: classes.completed }}>
            <StepButton icon={<DeleteIcon className={classes.xiconRoot}/>} completed={index === 2}>
              <StepLabel
                classes={{
                  iconContainer: classes.iconContainer
                }}
              >
                {label}
              </StepLabel>
            </StepButton>
          </Step>
        );
      })}
</Stepper>
Run Code Online (Sandbox Code Playgroud)

类似于completed应用于您可以classes应用Step以下内容来覆盖不同的状态。https://material-ui.com/api/step/#css-api

完整示例片段https://codesandbox.io/s/vn8m2rqol3