Skip to content

Commit

Permalink
Add margin-bottom lint rules for ToggleGroupControl (WordPress#63960)
Browse files Browse the repository at this point in the history
* Add margin-bottom lint rules for ToggleGroupControl

* BackgroundControlsPanel: Tangential fixes

* Fix new violation in Query Loop block

Co-authored-by: mirka <[email protected]>
Co-authored-by: tyxla <[email protected]>
  • Loading branch information
3 people authored Jul 29, 2024
1 parent 6c26d0b commit 628d7a6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ module.exports = {
'RangeControl',
'SearchControl',
'TextareaControl',
'ToggleGroupControl',
'TreeSelect',
].map( ( componentName ) => ( {
selector: `JSXOpeningElement[name.name="${ componentName }"]:not(:has(JSXAttribute[name.name="__nextHasNoMarginBottom"]))`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export default function ScaleTool( {
panelId={ panelId }
>
<ToggleGroupControl
__nextHasNoMarginBottom
label={ __( 'Scale' ) }
isBlock
help={ scaleHelp[ displayValue ] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ function BackgroundSizeControls( {
onChange={ updateBackgroundPosition }
/>
<ToggleControl
__nextHasNoMarginBottom
label={ __( 'Fixed background' ) }
checked={ attachmentValue === 'fixed' }
onChange={ toggleScrollWithPage }
Expand All @@ -577,6 +578,7 @@ function BackgroundSizeControls( {
) }
/>
<ToggleGroupControl
__nextHasNoMarginBottom
size="__unstable-large"
label={ __( 'Size' ) }
value={ currentValueForToggle }
Expand Down Expand Up @@ -626,6 +628,7 @@ function BackgroundSizeControls( {
}
/>
<ToggleControl
__nextHasNoMarginBottom
label={ __( 'Repeat' ) }
checked={ repeatCheckedValue }
onChange={ toggleIsRepeated }
Expand Down
4 changes: 0 additions & 4 deletions packages/block-editor/src/components/global-styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,6 @@
.block-editor-global-styles-background-panel__dropdown-content-wrapper {
min-width: 260px;
overflow-x: hidden;
.components-base-control__help,
.components-toggle-control {
margin-bottom: 0;
}

.components-focal-point-picker-wrapper {
background-color: $gray-100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export default function QueryInspectorControls( props ) {
{ showInheritControl && (
<ToggleGroupControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Query type' ) }
isBlock
onChange={ ( value ) => {
Expand Down

0 comments on commit 628d7a6

Please sign in to comment.