Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 更改透明度切换开关的颜色_Css_Angular_Clarity - Fatal编程技术网

Css 更改透明度切换开关的颜色

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

我有一个带.Net内核的Angular项目,我也在使用Clarity,我想知道是否有办法更改Clarity切换开关的颜色

我迄今为止尝试过但不起作用的代码:

 <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;   
}