-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(button): allow button to increase in height when text wraps #27547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4bd5e1e
4754703
c580970
fc5366f
6b0c29e
acc0715
a023423
6516ee4
a126529
8092213
eb77dab
06909bf
b5df308
ffa307f
1226aa6
13a5655
88b448e
84db5ce
8a8dcff
0a41736
f345d93
94d18c4
1957d51
46d60af
657109b
360628b
859f2cb
d67a688
2fe8870
23f1fe7
85a2ab2
5c0e69f
6053e0f
c4f7bc5
162ff26
74bed96
d4a1c99
c4da8b4
a63c246
b8320d8
31a31c1
37811ce
da0ef0d
6f125a7
7d30a65
69c1f84
c01a1e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -55,8 +55,8 @@ | |||||
|
||||||
text-align: center; | ||||||
text-decoration: none; | ||||||
text-overflow: ellipsis; | ||||||
|
||||||
// TODO(FW-4599): change to normal | ||||||
white-space: nowrap; | ||||||
|
||||||
user-select: none; | ||||||
|
@@ -114,8 +114,6 @@ | |||||
:host(.button-block) .button-native { | ||||||
@include margin-horizontal(0); | ||||||
|
||||||
display: block; | ||||||
|
||||||
width: 100%; | ||||||
|
||||||
clear: both; | ||||||
|
@@ -138,8 +136,6 @@ | |||||
:host(.button-full) .button-native { | ||||||
@include margin-horizontal(0); | ||||||
|
||||||
display: block; | ||||||
|
||||||
width: 100%; | ||||||
|
||||||
contain: content; | ||||||
|
@@ -159,12 +155,17 @@ | |||||
@include padding(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start)); | ||||||
@include text-inherit(); | ||||||
|
||||||
display: block; | ||||||
display: flex; | ||||||
|
||||||
position: relative; | ||||||
|
||||||
align-items: center; | ||||||
|
||||||
width: 100%; | ||||||
height: 100%; | ||||||
|
||||||
min-height: inherit; | ||||||
|
||||||
transition: var(--transition); | ||||||
|
||||||
border-width: var(--border-width); | ||||||
|
@@ -210,11 +211,20 @@ | |||||
} | ||||||
|
||||||
|
||||||
// Button Slots | ||||||
// -------------------------------------------------- | ||||||
|
||||||
::slotted([slot=start]), | ||||||
::slotted([slot=end]) { | ||||||
flex-shrink: 0; | ||||||
} | ||||||
averyjohnston marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
|
||||||
// Button Icons | ||||||
// -------------------------------------------------- | ||||||
|
||||||
::slotted(ion-icon) { | ||||||
font-size: 1.4em; | ||||||
font-size: 1.35em; | ||||||
Comment on lines
-217
to
+227
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We tried to fix it by setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It also turns out that the icons were not aligned with the text in
In There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that some buttons may have an "off by 1" alignment due to fonts that are odd (i.e. Example: The small button on MD has a font size of 12px. 1.4em * 12 = 16.8 (which gets rounded to 17px). As a result small buttons in However, the large button has a font size of 20px. 1.35em (the new icon size) * 20 = 27. As a result, large buttons will have an off by 1 alignment issue instead of small buttons. Long term we should avoid odd font sizes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The small items in an item on MD also have a font size of 12px which results in 1.4 * 12 = 16.8 (rounded to 17px). I considered changing this to be 13px to avoid changing the icon size. However, this caused larger visual regressions than I was comfortable with, so I opted to stick with the above approach. |
||||||
pointer-events: none; | ||||||
} | ||||||
|
||||||
|
Uh oh!
There was an error while loading. Please reload this page.