Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Fixed spacing between `BaseControl` fields and help text within the `ToolsPanel` ([#36334](https://github.com/WordPress/gutenberg/pull/36334))
- Replaced hardcoded blue in `ColorPicker` with UI theme color ([#36153](https://github.com/WordPress/gutenberg/pull/36153)).
- Fixed empty `ToolsPanel` height by correcting menu button line-height ([#36895](https://github.com/WordPress/gutenberg/pull/36895)).
- Normalized label line-height and spacing within the `ToolsPanel` ([36387](https://github.com/WordPress/gutenberg/pull/36387))

### Enhancements

Expand Down
29 changes: 29 additions & 0 deletions packages/components/src/tools-panel/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import { css } from '@emotion/react';
import {
StyledField as BaseControlField,
StyledHelp as BaseControlHelp,
StyledLabel as BaseControlLabel,
Wrapper as BaseControlWrapper,
} from '../base-control/styles/base-control-styles';
import { LabelWrapper } from '../input-control/styles/input-control-styles';
import { COLORS, CONFIG } from '../utils';
import { space } from '../ui/utils/space';

Expand Down Expand Up @@ -118,6 +120,33 @@ export const ToolsPanelItem = css`
${ BaseControlHelp } {
margin-bottom: 0;
}

/**
* Standardize InputControl and BaseControl labels with other labels when
* inside ToolsPanel.
*
* This is a temporary fix until the different control components have their
* labels normalized.
*/
&& ${ LabelWrapper } {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up using LabelWrapper from the input control styles here as I couldn't get BaseLabel to work for me. Open to suggestions to improve this.

label {
margin-bottom: ${ space( 2 ) };
padding-bottom: 0;
line-height: 1.4em;
}
}

/**
* The targeting of .components-custom-select-control__label here is a
* temporary measure only.
*
* It should be replaced once CustomSelectControl component has been
* refactored and can be targeted via component interpolation.
*/
.components-custom-select-control__label,
${ BaseControlLabel } {
line-height: 1.4em;
}
`;

export const ToolsPanelItemPlaceholder = css`
Expand Down