【问题标题】:Change the highlighted color of angular material input text box [duplicate]更改角度材料输入文本框的突出显示颜色[重复]
【发布时间】:2021-09-14 07:02:58
【问题描述】:

您好,我使用的是角度材质,我喜欢在点击时更改材质输入焦点颜色

现在默认显示为紫色,我喜欢改成白色

我尝试了很多 CSS。但没有什么对我有用

下面是stackblitz URL的例子

https://stackblitz.com/edit/material-input-sample?file=src/app/app.component.ts

【问题讨论】:

  • 你想换主题还是单输入?

标签: html css angular angular-material material-ui


【解决方案1】:

您可以使用 ::ng-deep 修改 mat-input 元素的 css。

::ng-deep {
  .mat-form-field-label {
    color: white !important;
  }

  .mat-form-field.mat-focused .mat-form-field-ripple {
    background-color: white !important;
  }
}

Example in stackblitz

【讨论】:

    猜你喜欢
    • 2021-02-09
    • 1970-01-01
    • 1970-01-01
    • 2016-05-04
    • 2019-07-23
    • 1970-01-01
    • 2016-03-29
    • 2010-09-29
    • 1970-01-01
    相关资源
    最近更新 更多