Skip to content

Commit

Permalink
ToolbarButton: Fix text centering for short labels (#59117)
Browse files Browse the repository at this point in the history
* Center toolbar button content

* Changelog

* Move style to toolbar group

Co-authored-by: talldan <talldanwp@git.wordpress.org>
Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
Co-authored-by: kevin940726 <kevin940726@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
  • Loading branch information
5 people authored Feb 19, 2024
1 parent d673498 commit ac64d16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- `CustomSelectControl`: Remove deprecated `__nextUnconstrainedWidth` prop and promote to default behavior ([#58974](https://github.com/WordPress/gutenberg/pull/58974)).

### Bug Fix

- `ToolbarButton`: Center text for short labels ([#59117](https://github.com/WordPress/gutenberg/pull/59117)).

### Internal

- `ColorPicker`: Style without accessing internal `InputControl` classes ([#59069](https://github.com/WordPress/gutenberg/pull/59069)).
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/toolbar/toolbar-group/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// Icons are 36px, as set by a 24px icon and 12px padding.
.components-button.components-button, // This needs specificity to override padding values inherited from the button component.
.components-button.has-icon.has-icon {
justify-content: center;
min-width: $block-toolbar-height - $grid-unit-15;
padding-left: $grid-unit-15 * 0.5; // 6px.
padding-right: $grid-unit-15 * 0.5;
Expand Down

0 comments on commit ac64d16

Please sign in to comment.