-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normalize spacing in Layout hook controls #65132
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,13 @@ | ||
.block-editor-hooks__layout-controls-units { | ||
display: flex; | ||
flex-direction: column; | ||
gap: $grid-unit-20; | ||
} | ||
|
||
.block-editor-block-inspector .block-editor-hooks__layout-controls-unit-input { | ||
margin-bottom: 0; | ||
} | ||
|
||
.block-editor-hooks__layout-controls-reset { | ||
display: flex; | ||
justify-content: flex-end; | ||
margin-bottom: $grid-unit-30; | ||
.block-editor-hooks__layout-constrained { | ||
.components-base-control { | ||
margin-bottom: 0; // Cancel out margins added by block inspector | ||
} | ||
} | ||
|
||
.block-editor-hooks__layout-controls-helptext { | ||
.block-editor-hooks__layout-constrained-helptext { | ||
color: $gray-700; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed the class for consistency with the JS file name. (Naming it |
||
font-size: $helptext-font-size; | ||
margin-bottom: $grid-unit-20; | ||
margin-bottom: 0; // Cancel out margins added by common.css | ||
} | ||
|
||
.block-editor-hooks__flex-layout-justification-controls, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import { | |
__experimentalToggleGroupControl as ToggleGroupControl, | ||
__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon, | ||
__experimentalInputControlPrefixWrapper as InputControlPrefixWrapper, | ||
__experimentalVStack as VStack, | ||
} from '@wordpress/components'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { | ||
|
@@ -70,12 +71,14 @@ export default { | |
availableUnits: availableUnits || [ '%', 'px', 'em', 'rem', 'vw' ], | ||
} ); | ||
return ( | ||
<> | ||
<VStack | ||
spacing={ 4 } | ||
className="block-editor-hooks__layout-constrained" | ||
> | ||
{ allowCustomContentAndWideSize && ( | ||
<div className="block-editor-hooks__layout-controls-units"> | ||
<> | ||
<UnitControl | ||
__next40pxDefaultSize | ||
className="block-editor-hooks__layout-controls-unit-input" | ||
label={ __( 'Content width' ) } | ||
labelPosition="top" | ||
value={ contentSize || wideSize || '' } | ||
|
@@ -98,7 +101,6 @@ export default { | |
/> | ||
<UnitControl | ||
__next40pxDefaultSize | ||
className="block-editor-hooks__layout-controls-unit-input" | ||
label={ __( 'Wide width' ) } | ||
labelPosition="top" | ||
value={ wideSize || contentSize || '' } | ||
|
@@ -119,12 +121,12 @@ export default { | |
</InputControlPrefixWrapper> | ||
} | ||
/> | ||
<p className="block-editor-hooks__layout-controls-helptext"> | ||
<p className="block-editor-hooks__layout-constrained-helptext"> | ||
{ __( | ||
'Customize the width for all elements that are assigned to the center or wide columns.' | ||
) } | ||
</p> | ||
</div> | ||
</> | ||
) } | ||
{ allowJustification && ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<ToggleGroupControl | ||
|
@@ -148,7 +150,7 @@ export default { | |
) } | ||
</ToggleGroupControl> | ||
) } | ||
</> | ||
</VStack> | ||
); | ||
}, | ||
toolBarControls: function DefaultLayoutToolbarControls( { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any chance any of these removed classes were used for additional styling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, we're good 👍