如何设置纸质输入元素的样式,该元素放在我的index.html文件中,并附带我的style.css文件?
我尝试了聚合物文档中提到的例子:
paper-input.my-class {
--paper-input-container-color: red;
--paper-input-container-focus-color: blue;
--paper-input-container-invalid-color: green;
--paper-input-container-input-color: black;
}

<paper-input class="my-class" label="test" ></paper-input>
&#13;
但没有变化!
我的代码有什么问题?
答案 0 :(得分:0)
您的样式必须是<style is="custom-style">
或自定义元素的样式,才能使用自定义css属性。
Here are the docs了解更多信息。