gpt4 book ai didi

angular - 如何自定义处于禁用状态的 mat-form-field

转载 作者:行者123 更新时间:2023-12-03 15:56:55 26 4
gpt4 key购买 nike

我正在尝试自定义 Angular Material mat-form-field :
我能够使用以下方法自定义下划线边框:

::ng-deep.mat-form-field-ripple {
background-color: yellow;
}

现在我正在尝试将禁用状态下的下划线边框自定义为实线而不是虚线:

我试过这个,但它对下划线不起作用:
::ng-deep.mat-form-field-disabled
{

}

enter image description here

我希望它在禁用状态下呈灰色实心
 <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;
}

关于angular - 如何自定义处于禁用状态的 mat-form-field,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54355907/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com