This repository was archived by the owner on Oct 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Add overflow handling and text truncation to Button #1053
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
'@crowdstrike/glide-core': patch | ||
--- | ||
|
||
Button can now truncate and show an ellipsis when the label overflows by adding the following to the host: | ||
|
||
```css | ||
max-width: 100%; | ||
white-space: nowrap; | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ export default [ | |
font-weight: var(--glide-core-typography-weight-bold); | ||
gap: var(--glide-core-spacing-base-xs); | ||
justify-content: center; | ||
max-inline-size: 100%; | ||
padding-block: var(--glide-core-spacing-base-xs); | ||
padding-inline: var(--glide-core-spacing-base-md); | ||
transition-duration: var(--glide-core-duration-moderate-02); | ||
|
@@ -144,6 +145,7 @@ export default [ | |
font-size: var(--glide-core-typography-size-body-default); | ||
font-weight: var(--glide-core-typography-weight-regular); | ||
padding: 0; | ||
text-align: start; | ||
|
||
&.disabled { | ||
color: var(--glide-core-color-interactive-text-link--disabled); | ||
|
@@ -168,12 +170,24 @@ export default [ | |
} | ||
} | ||
|
||
.tooltip { | ||
max-inline-size: 100%; | ||
white-space: inherit; | ||
} | ||
|
||
.prefix-icon-slot { | ||
&.hidden { | ||
display: none; | ||
} | ||
} | ||
|
||
.label { | ||
min-inline-size: 3ch; | ||
overflow: hidden; | ||
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. You'll notice some changes in the visual test report. I tracked it down to this line. For some reason, adding Font smoothing/antialiasing thing in Linux maybe? That's about all I can think of. |
||
text-overflow: ellipsis; | ||
white-space: inherit; | ||
} | ||
|
||
.suffix-icon-slot { | ||
&.hidden { | ||
display: none; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to pull this out if we don't think it should be there for Button.