Css 更改透明度切换开关的颜色
我有一个带.Net内核的Angular项目,我也在使用Clarity,我想知道是否有办法更改Clarity切换开关的颜色 我迄今为止尝试过但不起作用的代码:Css 更改透明度切换开关的颜色,css,angular,clarity,Css,Angular,Clarity,我有一个带.Net内核的Angular项目,我也在使用Clarity,我想知道是否有办法更改Clarity切换开关的颜色 我迄今为止尝试过但不起作用的代码: <input type="checkbox" formControlName="validateAll" Color="red" clrToggle /> 在包装div中添加一个自定义类,按照 切换开关是使用标签上的::before和::after创建的。因此,如果您为div自定义样式命名包装器类,那么您的css
<input type="checkbox" formControlName="validateAll" Color="red" clrToggle />
在包装div中添加一个自定义类,按照 切换开关是使用
标签上的::before
和::after
创建的。因此,如果您为div自定义样式命名包装器类,那么您的css应该如下所示:
.custom-styles input[type=checkbox]+label::before {
border-color: blue;
background-color: blue;
}
和为选中的
.custom-styles input[type=checkbox]:checked+label::before {
border-color: red;
background-color: red;
}
.custom-styles input[type=checkbox]+label::before {
border-color: blue;
background-color: blue;
}
.custom-styles input[type=checkbox]:checked+label::before {
border-color: red;
background-color: red;
}