-
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
ToggleGroupControl: Add lint rule for 40px size prop usage #64524
Conversation
Size Change: +66 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
@@ -125,6 +125,7 @@ export default { | |||
) } | |||
{ allowJustification && ( | |||
<ToggleGroupControl | |||
__next40pxDefaultSize |
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.
@@ -325,6 +325,7 @@ function FlexLayoutJustifyContentControl( { | |||
|
|||
return ( | |||
<ToggleGroupControl | |||
__next40pxDefaultSize |
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.
@@ -449,6 +449,7 @@ function GridLayoutTypeControl( { layout, onChange } ) { | |||
|
|||
return ( | |||
<ToggleGroupControl | |||
__next40pxDefaultSize |
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.
@@ -10,6 +10,7 @@ import { | |||
export function CommentsPaginationArrowControls( { value, onChange } ) { | |||
return ( | |||
<ToggleGroupControl | |||
__next40pxDefaultSize |
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.
@@ -626,10 +626,11 @@ function Navigation( { | |||
</div> | |||
</> | |||
) } | |||
<h3>{ __( 'Overlay Menu' ) }</h3> |
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.
Moving this unnecessary h3
to a label on ToggleGroupControl.
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.
I'd be curious (and also a bit scared) to see how many more h3
s are being used as labels (since the styles are the same)
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.
😅
May be alleviated if we add fieldset/legend support to BaseControl (or provide a new component for it)? Like the h3
below this is used as a heading for multiple ToggleControls.
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.
Yeah, it definitely sounds like we need to gather and brainstorm all requirements that we'd like for a new version of BaseControl
. Support for fieldset/legend and for multiple/composed inputs seem to be important and more frequent that we thought
<ToggleGroupControl | ||
__next40pxDefaultSize |
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.
@@ -203,6 +203,7 @@ const DimensionControls = ( { | |||
panelId={ clientId } | |||
> | |||
<ToggleGroupControl | |||
__next40pxDefaultSize |
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.
@@ -120,6 +120,7 @@ export default function PostNavigationLinkEdit( { | |||
/> | |||
) } | |||
<ToggleGroupControl | |||
__next40pxDefaultSize |
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.
@@ -10,6 +10,7 @@ import { | |||
export function QueryPaginationArrowControls( { value, onChange } ) { | |||
return ( | |||
<ToggleGroupControl | |||
__next40pxDefaultSize |
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.
__nextHasNoMarginBottom | ||
className="wp-block-navigation__overlay-menu-icon-toggle-group" |
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.
A bit of style wrangling going on here. See screenshot above.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
🚀
@@ -626,10 +626,11 @@ function Navigation( { | |||
</div> | |||
</> | |||
) } | |||
<h3>{ __( 'Overlay Menu' ) }</h3> |
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.
I'd be curious (and also a bit scared) to see how many more h3
s are being used as labels (since the styles are the same)
Part of #63871
What?
Add a lint rule to prevent people from introducing new usages of ToggleGroupControl that do not adhere to the new default size.
Testing Instructions
The lint error should trigger for violations as expected.