问题
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