我正在尝试自定义角度材料 mat-form-field :
我可以使用以下命令自定义下划线边框:
::ng-deep.mat-form-field-ripple {
background-color: yellow;
}
现在我正在尝试将禁用状态下的下划线边框自定义为实线而不是虚线:
我尝试了这个,但它对下划线不起作用:
::ng-deep.mat-form-field-disabled
{
}
我希望它在禁用状态下呈灰色固体
<mat-form-field>
<input matInput placeholder="Input" [disabled]='true'>
</mat-form-field>
这解决了它:
::ng-deep.mat-form-field-disabled .mat-form-field-underline
{
background-image: linear-gradient( to right, rgba(0, 0, 0, 1) 0, rgba(0, 0, 0, 0.42) 33%, #c2c7cc 0 ) !important;
background-size: 1px 100% !important;
background-repeat: repeat-x !important;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)