PolymerElements / paper-input

A Material Design text field
https://www.webcomponents.org/element/PolymerElements/paper-input
130 stars 162 forks source link

Import of typography.html overrides any --paper-font-common-base mixin set. #584

Open KeithHenry opened 6 years ago

KeithHenry commented 6 years ago

paper-input imports ../paper-styles/typography.html in three places:

https://github.com/PolymerElements/paper-input/blob/56089b9e2e6609fc1d0e3a34be9a9e332f2a1b4b/paper-input-container.html#L14

https://github.com/PolymerElements/paper-input/blob/0a50e7670f20db308338278b3c9f20828980b490/paper-input-error.html#L13

https://github.com/PolymerElements/paper-input/blob/0a50e7670f20db308338278b3c9f20828980b490/paper-input-char-counter.html#L12

Each of these will cause any --paper-font-common-base mixin that is already set to be overridden with the typography.

Instead paper-input should not re-import typography.html, but it should include a comment similar to paper-radio-button's approach:

/*
This element applies the mixin `--paper-font-common-base` but does not import `paper-styles/typography.html`.
In order to apply the `Roboto` font to this element, make sure you've imported `paper-styles/typography.html`.
*/

See also this issue on paper-styles and this SO question.

renfeng commented 6 years ago

Paper elements should have consistency over --paper-font-common-base. I'd vote for paper-radio-button's approach as @KeithHenry suggested.