mirror of
https://github.com/material-components/material-web.git
synced 2026-01-09 07:21:09 +08:00
fix(button): height increases when label wraps
PiperOrigin-RevId: 582478806
This commit is contained in:
parent
bf8d3f6289
commit
7cd657b83d
@ -21,8 +21,15 @@
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
gap: 8px;
|
||||
height: var(--_container-height);
|
||||
// min-height instead of height so that label can wrap and expand height
|
||||
min-height: var(--_container-height);
|
||||
outline: none;
|
||||
// Add extra space between label and the edge for if the label text wraps.
|
||||
// The padding added should be relative to the height of the container and
|
||||
// the height of its content on a single line (label or icon, whichever is
|
||||
// bigger).
|
||||
$single-line-height: max(var(--_label-text-line-height), var(--_icon-size));
|
||||
padding-block: calc((var(--_container-height) - $single-line-height) / 2);
|
||||
padding-inline-start: var(--_leading-space);
|
||||
padding-inline-end: var(--_trailing-space);
|
||||
place-content: center;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user