Change the color for the Angular Material Design label text (Angular 1.3.0 & ngMaterial 0.11)

柔情痞子 提交于 2020-01-04 06:32:09

问题


I have a setup an AngularJS app (1.3) with Angular Material (v10.1) - when I click into a input field (eg it is in focus) that is setup to use Material Design the label text changes to the default colour of blue - I want to change this to a color of my choice how is the best way to do this.

<md-input-container class="md-block">
  <label>Name</label>
  <input required>
</md-input-container>

Once I focus on the input field above the label changes the colour of the text 'Name' to blue - what is the recommended way to change this to another colour in Material Design?


回答1:


This selector for default state

md-input-container:not(.md-input-invalid).md-input-has-value label {
      color: #000; // your color here
}

Focused state

md-input-container:not(.md-input-invalid).md-input-focused label {
      color: #000; // your color here
}


来源:https://stackoverflow.com/questions/43652733/change-the-color-for-the-angular-material-design-label-text-angular-1-3-0-ngm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!