Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change font-size of paper-input in Polymer 1.0

Tags:

polymer

In Polymer 1.0 I can easily change the font-size of the iron-input component with for example:

input {
   font-size: 24px;
}

If I use the iron-input component within a paper-input-container it does not work. If I use just the paper-input component it does not work as well. So, how do you do it? Thanks in advance.

like image 612
jansolo Avatar asked May 29 '15 14:05

jansolo


2 Answers

I allow myself to elaborate on the correct answer since I had trouble understanding how the mixin concept work and how to apply the solution that can be used for many other things (changing the other attributes such as the font, the style..). The solution if I have the following paper-input in my element

<paper-input id="title" label="Note title"></paper-input>

is to have the following style in my element

<style>
  #title {
    --paper-input-container-input: {
      font-size: 24px;
    };
  }
</style>

I can also have the style define globally in an html file I import

<style is="custom-style">
  :root {
    --paper-input-container-input: {
      font-size: 24px;
    };
  }
</style>
like image 167
alextk Avatar answered Nov 10 '22 05:11

alextk


You can do that by using the --paper-input-container-input mixin. You can use it on your own element or via <style is="custom-style">. Also don't forget those semicolons after every mixin.

like image 29
Neil John Ramal Avatar answered Nov 10 '22 07:11

Neil John Ramal