如何在Polymer 1.0中更改纸张输入的字体大小

jan*_*olo 8 polymer

在Polymer 1.0中,我可以轻松更改铁输入组件的字体大小,例如:

input {
   font-size: 24px;
}
Run Code Online (Sandbox Code Playgroud)

如果我在纸张输入容器中使用铁输入组件,它就不起作用.如果我只使用纸张输入组件,它也不起作用.你是怎么做到的?提前致谢.

ale*_*xtk 13

我允许自己详细说明正确的答案,因为我无法理解mixin概念如何工作以及如何应用可用于许多其他事情的解决方案(更改其他属性,如字体,样式......).解决方案,如果我在我的元素中有以下纸张输入

<paper-input id="title" label="Note title"></paper-input>
Run Code Online (Sandbox Code Playgroud)

是在我的元素中具有以下样式

<style>
  #title {
    --paper-input-container-input: {
      font-size: 24px;
    };
  }
</style>
Run Code Online (Sandbox Code Playgroud)

我也可以在我导入的html文件中全局定义样式

<style is="custom-style">
  :root {
    --paper-input-container-input: {
      font-size: 24px;
    };
  }
</style>
Run Code Online (Sandbox Code Playgroud)


Nei*_*mal 9

你可以使用--paper-input-container-inputmixin 来做到这一点.您可以在自己的元素或通过它使用它<style is="custom-style">.每次混音后也不要忘记那些分号.