要更改Angular Material分页选择器在聚焦时的颜色,可以使用CSS伪类:focus和Angular Material的MatSelect组件。以下是代码示例:
.mat-focused .mat-form-field-label { color: #2196F3; /* change the color to blue */ }
.mat-focused .mat-select-arrow { color: #2196F3; /* change the color to blue */ }
.mat-select:focus { outline: none; /* remove the default blue outline on focus / border-bottom: 2px solid #2196F3; / add a blue underline on focus */ }
我们使用.mat-focused类来指定聚焦状态下要更改的样式,使用.mat-select-arrow类来改变选择器箭头的颜色。最后,我们使用:focus伪类和CSS属性来更改选择器的样式。
上一篇:AngularMaterial分页器只有在点击后才能正常工作。
下一篇:Angularmaterialformfieldisnotupdatingwhenchangingvaluesinthecomponent