css - 下一步活动时如何更改角度步进器进度颜色
问题描述
这是我在 css 中的代码
.mat-step-header[aria-selected="true"] {
background-color: #07C496;
}
.mat-step-header[ng-reflect-active='true']{
background-color: #07C496;
}
html:
<mat-horizontal-stepper #stepper labelPosition="bottom" linear >
<ng-template matStepperIcon="edit" let-index="index"> {{index + 1}}
</ng-template>
<mat-step>
<ng-template matStepLabel>test</ng-template>
<div>
</mat-step>
<mat-step>
<ng-template matStepLabel>test</ng-template>
<div>
</mat-step>
<mat-step>
<ng-template matStepLabel>test</ng-template>
<div>
</mat-step>
<mat-step>
<ng-template matStepLabel>test</ng-template>
<div>
</mat-step>
</mat-horizontal-stepper>
这个东西只在开发模式下工作,但在 prod 模式下不起作用,因为 ng-reflect-active 在 prod 模式下不存在。任何人都可以帮我在css中做到这一点吗?
解决方案
您可以借助通用兄弟组合器( ) 在行为之前模拟选择所有元素:~
.mat-step-header {
background-color: #07C496 !important;
}
.mat-step-header[aria-selected="true"] ~ * {
background-color: transparent !important;
}
推荐阅读
- android - Android Nougat 通知操作按钮未显示在通知中
- cors - 通过跨域重定向透明移动启用 CORS 的资源
- facebook-marketing-api - 使用他们的 API 检索过去一段时间的 Facebook 覆盖率?
- python - 通过代理使用 TLSv1.0 的 Scrapy 握手失败
- android-workmanager - 发现多个文件的操作系统独立路径为“META-INF/proguard/androidx-annotations.pro”
- c++ - 这是一个很好的短字符串散列函数吗?
- angular6 - Angular 6 中从 API 数据中预填充的选择
- sass - 一系列属性作为映射值
- vue.js - Vue js将HTML按钮名称属性作为PROPS传递
- vue.js - VueJS将计算数据作为道具传递返回未定义