Skip to content

Commit

Permalink
Changed approach to have the margin set on the first dom child of Bas…
Browse files Browse the repository at this point in the history
…eControl
  • Loading branch information
jorgefilipecosta committed Mar 4, 2019
1 parent 880534c commit a98629b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
9 changes: 5 additions & 4 deletions packages/block-library/src/video/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import { getBlobByURL, isBlobURL } from '@wordpress/blob';
import {
BaseControl,
Button,
Disabled,
IconButton,
Expand Down Expand Up @@ -210,12 +211,12 @@ class VideoEdit extends Component {
] }
/>
<MediaUploadCheck>
<div
<BaseControl
className="editor-video-poster-control"
>
<span>
<div>
{ __( 'Poster Image' ) }
</span>
</div>
<MediaUpload
title={ __( 'Select Poster Image' ) }
onSelect={ this.onSelectPoster }
Expand All @@ -235,7 +236,7 @@ class VideoEdit extends Component {
{ __( 'Remove Poster Image' ) }
</Button>
}
</div>
</BaseControl>
</MediaUploadCheck>
</PanelBody>
</InspectorControls>
Expand Down
5 changes: 0 additions & 5 deletions packages/block-library/src/video/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@
.editor-video-poster-control .components-button + .components-button {
margin-top: 1em;
}

.editor-video-poster-control > span {
display: block;
margin-bottom: 4px;
}
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- `withFilters` has been optimized to avoid binding hook handlers for each mounted instance of the component, instead using a single centralized hook delegator.
- `withFilters` has been optimized to reuse a single shared component definition for all filtered instances of the component.
- Make `RangeControl` validate min and max properties.
- Added a margin-bottom to the first dom child inside `BaseControl`, previously only the dom element representing the label contained the margin.

### Bug Fixes

Expand Down
6 changes: 5 additions & 1 deletion packages/components/src/base-control/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
.components-base-control__field {
margin-bottom: $grid-size;

& > *:first-child {
margin-bottom: $grid-size-small;
}

.components-panel__row & {
margin-bottom: inherit;
}
}

.components-base-control__label {
display: block;
margin-bottom: $grid-size-small;

}

.components-base-control__help {
Expand Down

0 comments on commit a98629b

Please sign in to comment.