更改Angular Material Design标签文本的颜色(Angular 1.3.0& ngMaterial 0.11) [英] Change the color for the Angular Material Design label text (Angular 1.3.0 & ngMaterial 0.11)

查看:90
本文介绍了更改Angular Material Design标签文本的颜色(Angular 1.3.0& ngMaterial 0.11)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Angular Material(v10.1)的AngularJS应用程序(1.3)的设置-当我单击输入栏(例如,焦点对准)以使用Material Design进行设置时,标签文本更改为默认值蓝色-我想将其更改为我选择的颜色,如何才能做到这一点的最佳方法.

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?

推荐答案

默认状态的此选择器

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

关注状态

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

这篇关于更改Angular Material Design标签文本的颜色(Angular 1.3.0&amp; ngMaterial 0.11)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆