WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.3k stars 4.11k forks source link

Tabs: Make default text alignment consistent #62025

Open afercia opened 3 months ago

afercia commented 3 months ago

Description

Noticed while working on https://github.com/WordPress/gutenberg/issues/62018

Wondering whether there is any reason why the text horizontal alignment for some tabs is left and for some tabs is centered. I would expect the alignment to be consistent across the UI.

Example screenshot from latest trunk:

Screenshot 2024-05-27 at 14 37 27

I'd think at least the default alignment should be always consistent. In the rare cases where a different alignment is desired, this should be done with a variant of the base component rather than with ad-hoc CSS.

Cc @WordPress/gutenberg-design

Step-by-step reproduction instructions

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

afercia commented 3 months ago

Note: the left alignment doesn't look great, especially when the focus style is visible:

Screenshot 2024-05-27 at 14 50 31

HILAYTRIVEDI commented 3 months ago
Screenshot 2024-05-27 at 9 44 07 PM

I think aligning it in the center looks nice.

HILAYTRIVEDI commented 3 months ago

Just adding justify-content:center will achieve the above.

.block-editor-inserter__tabs div[role=tablist] button[role=tab]{
         justify-content:center;
}
DaniGuardiola commented 3 months ago

Related: https://github.com/WordPress/gutenberg/pull/61974