找到你要的答案

Q:Polymer - paper-input floating label color

Q:聚合物纸输入浮动标签颜色

How can i change color of focused floating label in polymer?

Thanks for answers.

如何改变聚合物中的浮动标签颜色?

感谢答案。

answer1: 回答1:

The only way I was able to get around this issue was with this:

paper-input-decorator[focused] /deep/ .floating-label,
paper-input-decorator[focused] /deep/ .label-text {
/* floating label color when the input is focused */
color: orange !important;
}

Notice how it was necessary to type paper-input-decorator[focused] /deep/ twice

我能解决这个问题的唯一办法就是用这个:

paper-input-decorator[focused] /deep/ .floating-label,
paper-input-decorator[focused] /deep/ .label-text {
/* floating label color when the input is focused */
color: orange !important;
}

注意,这是必要的型纸装饰[聚焦]输入/深/次

answer2: 回答2:

You could also use core-style to do this if you didn't want to use the /deep/ selectors, it would look something like this (untested):

<core-style id="paper-input-decorator">
  .floating-label, .label-text {
    color: orange;
  }
</core-style>

你也可以使用核心风格,如果你不想使用/深/选择器,它会看起来像这样(未测试):

<core-style id="paper-input-decorator">
  .floating-label, .label-text {
    color: orange;
  }
</core-style>
answer3: 回答3:

You can set the following polymer style variable: --paper-input-container-focus-color, for example

#myInput{
   --paper-input-container-focus-color: red;
}

您可以设置以下聚合物样式变量:纸输入容器焦点颜色,例如

#myInput{
   --paper-input-container-focus-color: red;
}
html  css  dart  dart-polymer  paper-elements