-
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
FontSizePicker: Add display: contents
rule to custom size select
#68280
FontSizePicker: Add display: contents
rule to custom size select
#68280
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
display: contents
rule to font size picker
Hi @Mamaduka, |
.components-font-size-picker { | ||
display: contents; | ||
} |
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.
Instead of introducing a new stylesheet, it likely makes more sense to add it next to the pre-existing Emotion styles:
gutenberg/packages/components/src/font-size-picker/styles.ts
Lines 15 to 19 in 2078ac4
export const Container = styled.fieldset` | |
border: 0; | |
margin: 0; | |
padding: 0; | |
`; |
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.
Thanks, @tyxla for reviewing the PR. The suggested changes are implemented in the latest commit. The changes seem to work as expected.
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.
Looks good! I confirmed that this is currently safe and accessible in modern browsers.
packages/components/CHANGELOG.md
Outdated
@@ -19,6 +19,7 @@ | |||
### Bug Fixes | |||
|
|||
- `BoxControl`: Better respect for the `min` prop in the Range Slider ([#67819](https://github.com/WordPress/gutenberg/pull/67819)). | |||
- `FontSizePicker`: Add `display:contents` rule to fix overflowing text in the font size picker. ([#68280](https://github.com/WordPress/gutenberg/pull/68280)). |
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.
We can be more specific here:
- `FontSizePicker`: Add `display:contents` rule to fix overflowing text in the font size picker. ([#68280](https://github.com/WordPress/gutenberg/pull/68280)). | |
- `FontSizePicker`: Add `display:contents` rule to fix overflowing text in the custom size select. ([#68280](https://github.com/WordPress/gutenberg/pull/68280)). |
display: contents
rule to font size picker
display: contents
rule to custom size select
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.
LGTM, good to go once @mirka's feedback is addressed 👍
… text in custom size select
Fixes: #68271
What, Why & How?
Fixes text overflow issues in the Font Size Picker component by implementing
display: contents
oncomponents-font-size-picker
element for long font size names.Changes:
Adds
display: contents
rule to fix text overflowAdds a new stylesheet for the
font-size-picker
component.Testing Instructions
Screenshots
Large Devices
Mobile Devices
Screencast
Screen.Recording.2024-12-25.at.12.08.18.PM.mov
The fix works regardless of the screen width.