Jur*_*uri 2 angular-material angular-material-15
像这样的简单表格
<form [formGroup]="myForm">
<mat-form-field class="my-light-field">
<mat-label>Name</mat-label>
<input matInput type="text" [value]="myObj?.name" required readonly/>
</mat-form-field>
</form>
Run Code Online (Sandbox Code Playgroud)
我喜欢让现场变得透明
.my-light-field {
.mdc-text-field--filled{
background-color: transparent !important;
}
}
Run Code Online (Sandbox Code Playgroud)
盘旋在田野上空时,天色越来越暗。是否可以删除悬停效果?还有对焦...
只需在 中添加以下 CSS styles.scss:
// Manipulate initial background color
.mdc-text-field--filled:not(.mdc-text-field--disabled) {
background-color: transparent;
}
// Manipulate background color on hover and focus
.mat-mdc-form-field-focus-overlay {
background-color: transparent;
}
Run Code Online (Sandbox Code Playgroud)
观看现场演示。
注意:如果上面的代码不适合您,请添加!important.
| 归档时间: |
|
| 查看次数: |
1276 次 |
| 最近记录: |