-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block Styles: Truncate long button labels #42975
Changes from 2 commits
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 |
---|---|---|
|
@@ -43,6 +43,16 @@ | |
display: inline-block; | ||
width: calc(50% - #{$grid-unit-05}); | ||
|
||
&-text { | ||
word-break: break-all; | ||
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. Great catch, I looked into this a little further and it's pretty interesting. This might be something we need to bake into Truncate. Maybe |
||
// The Button component is white-space: nowrap, and that won't work with line-clamp. | ||
white-space: normal; | ||
|
||
// Without this, the ellipsis can sometimes be partially hidden by the Button padding. | ||
text-align: start; | ||
text-align-last: center; | ||
} | ||
|
||
&:focus, | ||
&:hover { | ||
color: var(--wp-admin-theme-color); | ||
|
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.
Nit: I'd prefer this to be written out (
.block-editor-block-styles__item-text
) so it can be searched easily across the codebase.Also, no need to nest it this deep since the class will never appear anywhere else, and it just adds unnecessary specificity.
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.
@mirka
Thanks for the review.
I've adjusted the
.block-editor-block-styles__item-text
class to make it easier to isolate and search.How about something like this?