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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
margin-bottom: $grid-unit-15;

legend {
padding-bottom: $grid-unit-05;
margin-bottom: $grid-unit-10;
}

.components-border-radius-control__wrapper {
Expand Down
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug Fix

- Update label spacing for the `BoxControl`, `CustomGradientPicker`, `FormTokenField`, `InputControl`, and `ToolsPanel` components to use a bottom margin of `8px` for consistency. ([#37844](https://github.com/WordPress/gutenberg/pull/37844))
- Add missing styles to the `BaseControl.VisualLabel` component. ([#37747](https://github.com/WordPress/gutenberg/pull/37747))

## 19.2.0 (2022-01-04)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const Root = styled.div`

export const Header = styled( Flex )`
color: ${ COLORS.ui.label };
padding-bottom: 8px;
margin-bottom: 8px;
`;

export const HeaderControlWrapper = styled( Flex )`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ $components-custom-gradient-picker__padding: $grid-unit-20; // 48px container, 1
.components-custom-gradient-picker {
.components-input-control__label {
line-height: 1;
padding-bottom: $grid-unit-10 !important;
}
label {
text-transform: uppercase;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/form-token-field/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

.components-form-token-field__label {
display: inline-block;
margin-bottom: $grid-unit-05;
margin-bottom: $grid-unit-10;
}

.components-form-token-field__help {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,30 +228,31 @@ export const Input = styled.input< InputProps >`
}
`;

const labelPadding = ( {
const labelMargin = ( {
labelPosition,
}: {
labelPosition?: LabelPosition;
} ) => {
let paddingBottom = 4;
let marginBottom = 8;

if ( labelPosition === 'edge' || labelPosition === 'side' ) {
paddingBottom = 0;
marginBottom = 0;
}

return css( { paddingTop: 0, paddingBottom } );
return css( { marginTop: 0, marginRight: 0, marginBottom, marginLeft: 0 } );
};

const BaseLabel = styled( Text )< { labelPosition?: LabelPosition } >`
&&& {
box-sizing: border-box;
color: currentColor;
display: block;
margin: 0;
padding-top: 0;
padding-bottom: 0;
max-width: 100%;
z-index: 1;

${ labelPadding }
${ labelMargin }
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
Expand Down
2 changes: 0 additions & 2 deletions packages/components/src/tools-panel/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ export const ToolsPanelItem = css`
*/
&& ${ LabelWrapper } {
label {
margin-bottom: ${ space( 2 ) };
padding-bottom: 0;
Comment on lines -133 to -134
Copy link
Contributor

Choose a reason for hiding this comment

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

So nice to see these style overrides being cleaned up!

line-height: 1.4em;
}
}
Expand Down