【发布时间】:2019-06-20 02:19:53
【问题描述】:
<mat-horizontal-stepper #stepper>
<mat-step class="red-stepper">
<ng-template matStepLabel>
<span>Step 1</span>
</ng-template>
</mat-step>
<mat-step class="red-stepper">
<ng-template matStepLabel>
<span>step 2</span>
</ng-template>
</mat-step>
<mat-step>
<ng-template matStepLabel>
<span>Step 3</span>
</ng-template>
</mat-step>
<mat-step>
<ng-template matStepLabel>
<span>Step 4</span>
</ng-template>
</mat-step>
</mat-horizontal-stepper>
例如我这里有 4 个 mat-steps,但是我想改变前两个的颜色,我该如何实现呢?我知道如何更改所选的,但事实并非如此。
我尝试在不同的类中应用步进器的 bg 颜色,但没有成功。
.red-stepper {
.mat-step-icon {
span.ng-star-inserted {
background-color: red !important;
}
}
background-color: red !important;
.mat-step-header .mat-step-icon {
background-color: #007FAD !important;
}
}
【问题讨论】:
标签: css angular angular-material