Change the color for the Angular Material Design l

2019-07-08 12:24发布

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条回答
Juvenile、少年°
2楼-- · 2019-07-08 12:56

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
}
查看更多
登录 后发表回答