Skip to content
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

Typography: Font appearance control sits at different height to line height and other controls #63886

Closed
2 tasks done
andrewserong opened this issue Jul 24, 2024 · 4 comments · Fixed by #63911
Closed
2 tasks done
Assignees
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] UI Components Impacts or related to the UI component system [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@andrewserong
Copy link
Contributor

Description

I noticed that the Font Appearance typography controls currently sit slightly lower in the UI than the other UI elements for Typography.

This is possibly related to some of the changes to the custom select control. I've added a comment over in #63258 (review) in case it's a part of that work.

Step-by-step reproduction instructions

  1. Add a Group block to a post
  2. In the Typography panel in the block inspector, enable all the typography controls
  3. Notice that in Gutenberg trunk, the Appearance controls sit slightly lower than the others
  4. In WP 6.6.1, the controls are at the correct height

Screenshots, screen recording, code snippet

Gutenberg trunk WordPress 6.6
image image

Environment info

  • WP 6.6.1 with Gutenberg trunk running

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes
@andrewserong andrewserong added [Type] Bug An existing feature does not function as intended [Feature] UI Components Impacts or related to the UI component system [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Jul 24, 2024
@ciampo ciampo self-assigned this Jul 24, 2024
@ciampo
Copy link
Contributor

ciampo commented Jul 24, 2024

Thank you for flagging.

@mirka and I had noticed this behavior in our early tests, but we assumed it would be mitigated by other common styles in the editor: #63137 (comment)

Likely, the fact that we stopped using a label element for the label could have played a role.

This could be fixed in a bunch of ways, I'll look into it to understand what's the best one.

@ciampo
Copy link
Contributor

ciampo commented Jul 24, 2024

I see two main ways to solve this:

Patch it locally in CustomSelectControl

By making the root div a flexbox container, which automatically trims white space.

Patch it in BaseControl

We could change the display property of StyledLabel from inline-block to block.

  • Pros: it would prevent more issues like this one from happening, since display: block trims white space
  • Cons: it could have unexpected consequences (although they should be easy to fix, and it would also be a way to spot unusual usages of BaseControl)

What do folks think?

@mirka
Copy link
Member

mirka commented Jul 24, 2024

I think we need to bite the bullet and fix it in BaseControl. I believe this change won't affect consumers of BaseControl, but only direct consumers of StyledLabel, which is still limited to the wp-components package.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 24, 2024
@ciampo
Copy link
Contributor

ciampo commented Jul 24, 2024

Sounds good, opened #63911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] UI Components Impacts or related to the UI component system [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants