material-components-web icon indicating copy to clipboard operation
material-components-web copied to clipboard

[Button] --mdc-typography-button-line-height is overridden in Button component

Open e111077 opened this issue 5 years ago • 2 comments

Bug report

the typography theming system's line-height is overridden by this following line:

https://github.com/material-components/material-components-web/blob/master/packages/mdc-button/_mixins.scss#L418

Steps to reproduce

  1. Open a demo of button
  2. set --mdc-typography-button-line-height: 50px; on the button
  3. set line-height: 20px; on the button

Actual behavior

line-height is set to 20px on the label

Expected behavior

line-height should be set to 50px

Your Environment:

Software Version(s)
MDC Web canary
Browser chrome
Operating System mac os

Additional context

internal shadow parts migration

Possible solution

remove it and migrate people

e111077 avatar Apr 13 '20 21:04 e111077

cc: @asyncLiz

e111077 avatar Apr 13 '20 21:04 e111077

We originally did this to account for different font type ascenders/descenders who would get cut off with the button's line height.

Do you have a link to the clients who are setting the line height? It'd be curious to know what the use case is (or if it's a way to secretly set the height, which will come later with density for MWC).

One alternate that we could do if it's a valid use case would be to consume the same property but use inherit as the fallback.

cl/306557841 for reference.

asyncliz avatar Apr 17 '20 19:04 asyncliz