【问题标题】:How to change mat-icon colour when focus in mat-Input field?在 mat-Input 字段中聚焦时如何更改 mat-icon 颜色?
【发布时间】:2019-04-02 12:44:53
【问题描述】:

我正在使用 mat-form-field 和 mat-icon,当我在 mat-form-field(mat-Input field) 内单击或聚焦时,应该更改 mat-icon 颜色-icon 保持原来的颜色。(Stackblitz)see in this example & make changes inside

【问题讨论】:

标签: html css angular-material


【解决方案1】:

您可以在代码中添加以下样式,

.mat-focused .mat-icon {
    color: red;
}

【讨论】:

  • 先生,同样的 mat-focus 样式也适用于 mat-input 文本颜色?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-02-27
  • 1970-01-01
  • 2021-10-31
  • 1970-01-01
  • 2021-02-28
  • 2022-07-22
  • 2017-10-08
相关资源
最近更新 更多