PolymerElements / paper-button

A button à la Material Design
https://www.webcomponents.org/element/PolymerElements/paper-button
138 stars 64 forks source link

Paper-button does not follow MD typographical styles #129

Open diogocamposwd opened 7 years ago

diogocamposwd commented 7 years ago

https://material.google.com/components/buttons.html#buttons-style

diogocamposwd commented 7 years ago

(sigh) Just saw #95. Sorry.

Anyway:

And, since I'm here: why paper-button is setting paddings, margins and width in 'em' units instead of CSS pixels?

Sorry for bad English. Hugs.

notwaldorf commented 7 years ago

Just a quick note: as I mentioned on the PR, not importing typography.html is intentional -- this way you can use the Roboto font if you want (by explicitly including typography.html in your app), but by default, the button would inherit whatever font you were using.

diogocamposwd commented 7 years ago

Interesting.

BTW, it can also be done with:

:root {
    --paper-font-common-base: {
        font-family: 'Comic Sans', sans-serif;
        -webkit-font-smoothing: antialiased;
    };
}
notwaldorf commented 7 years ago

Sure, but by then you've already downloaded the Roboto font (if you make paper-button always use it), only to un-use it. That's extra problematic if your app is offline, becausetypography.html tries to download it from google fonts. That's a whole network request and response you don't need

RhysyG commented 7 years ago

Hopefully this is somewhat related. In the paper-button demo the height of the button is 35.59 including the touchable target, however in MD spec it says the height should be 48px including touchable target? Also, when using the button from Polymer starter kit which sets the body line-height to 1.5, it ends up being 40.59. Am I interpreting this wrong or are there some inconsistency here?