-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add margin-bottom lint rules for ToggleControl #64213
Changes from 9 commits
aadf524
71287ed
e24495d
c084230
af06717
e9e48e0
f9d793e
2316998
c2d8505
1620be8
639fb00
8ccb6a2
e3e6b76
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,6 +201,7 @@ function BlockHooksControlPure( { | |
|
||
return ( | ||
<ToggleControl | ||
__nextHasNoMarginBottom | ||
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. Testing instructionsApply the following diff. In the Site Editor, go to Templates ▸ Single Posts template. See the block inspector for the Content block. diff --git a/gutenberg.php b/gutenberg.php
index b12c346741..fe14f2cafb 100644
--- a/gutenberg.php
+++ b/gutenberg.php
@@ -74,3 +74,14 @@ function gutenberg_pre_init() {
require_once __DIR__ . '/lib/load.php';
}
+
+add_filter( 'hooked_block_types', function ( $hooked_blocks, $position, $anchor_block ) {
+ if ( $anchor_block === 'core/post-content' && $position === 'after' ) {
+ // Add some core blocks after the post content.
+ $hooked_blocks[] = 'core/paragraph';
+ $hooked_blocks[] = 'core/separator';
+ $hooked_blocks[] = 'core/page-list';
+ }
+
+ return $hooked_blocks;
+}, 10, 3 );
|
||
checked={ checked } | ||
key={ block.title } | ||
label={ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ const AvatarInspectorControls = ( { | |
/> | ||
{ attributes.isLink && ( | ||
<ToggleControl | ||
__nextHasNoMarginBottom | ||
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. |
||
label={ __( 'Open in new tab' ) } | ||
onChange={ ( value ) => | ||
setAttributes( { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ function DetailsEdit( { attributes, setAttributes, clientId } ) { | |
<InspectorControls> | ||
<PanelBody title={ __( 'Settings' ) }> | ||
<ToggleControl | ||
__nextHasNoMarginBottom | ||
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. |
||
label={ __( 'Open by default' ) } | ||
checked={ showContent } | ||
onChange={ () => | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,6 +202,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) { | |
<InspectorControls> | ||
<PanelBody title={ __( 'Post content' ) }> | ||
<ToggleControl | ||
__nextHasNoMarginBottom | ||
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. |
||
label={ __( 'Post content' ) } | ||
checked={ displayPostContent } | ||
onChange={ ( value ) => | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ export default function EnhancedPaginationControl( { | |
return ( | ||
<> | ||
<ToggleControl | ||
__nextHasNoMarginBottom | ||
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. |
||
label={ __( 'Force page reload' ) } | ||
help={ help } | ||
checked={ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,6 +169,7 @@ function TagCloudEdit( { attributes, setAttributes } ) { | |
required | ||
/> | ||
<ToggleControl | ||
__nextHasNoMarginBottom | ||
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. |
||
label={ __( 'Show tag counts' ) } | ||
checked={ showTagCounts } | ||
onChange={ () => | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,7 @@ export default function InitPatternModal() { | |
__next40pxDefaultSize | ||
/> | ||
<ToggleControl | ||
__nextHasNoMarginBottom | ||
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. 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. Related discussion about how much space we actually want before the primary button. Tl;dr — we're not sure yet. |
||
label={ _x( 'Synced', 'pattern (singular)' ) } | ||
help={ __( | ||
'Sync this pattern across multiple locations.' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,6 +131,7 @@ export function CreatePatternModalContents( { | |
categoryMap={ categoryMap } | ||
/> | ||
<ToggleControl | ||
__nextHasNoMarginBottom | ||
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. |
||
label={ _x( 'Synced', 'pattern (singular)' ) } | ||
help={ __( | ||
'Sync this pattern across multiple locations.' | ||
|
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.
Testing instructions
In Global Styles, go to Blocks ▸ Image.