-
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
RangeControl: Add lint rule for 40px size prop usage #64558
Conversation
Size Change: -100 B (-0.01%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
@@ -51,6 +51,7 @@ export default function QueryPaginationNumbersEdit( { | |||
<InspectorControls> | |||
<PanelBody title={ __( 'Settings' ) }> | |||
<RangeControl | |||
__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.
@@ -231,6 +231,7 @@ export default function PostExcerptEditor( { | |||
} | |||
/> | |||
<RangeControl | |||
__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.
@@ -264,6 +264,7 @@ function GridLayoutMinimumWidthControl( { layout, onChange } ) { | |||
</FlexItem> | |||
<FlexItem isBlock> | |||
<RangeControl | |||
__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.
@@ -368,6 +369,7 @@ function GridLayoutColumnsAndRowsControl( { | |||
/> | |||
) : ( | |||
<RangeControl | |||
__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.
@@ -249,6 +249,7 @@ export default function SpacingInputControl( { | |||
} } | |||
/> | |||
<RangeControl | |||
__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.
<DropdownContentWrapper paddingSize="medium"> | ||
<RangeControl | ||
__next40pxDefaultSize | ||
__nextHasNoMarginBottom | ||
label={ __( 'Zoom' ) } | ||
min={ MIN_ZOOM } | ||
max={ MAX_ZOOM } | ||
value={ Math.round( zoom ) } | ||
onChange={ setZoom } | ||
/> | ||
</DropdownContentWrapper> |
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.
@@ -164,6 +164,7 @@ export default function HeightControl( { | |||
<FlexItem isBlock> | |||
<Spacer marginX={ 2 } marginBottom={ 0 }> | |||
<RangeControl | |||
__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.
@@ -104,6 +104,7 @@ export default function BorderRadiusControl( { onChange, values } ) { | |||
units={ units } | |||
/> | |||
<RangeControl | |||
__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.
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. |
Flaky tests detected in d46937c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10409746115
|
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.
LGTM 👍 Thanks!
A few places we could potentially add the new prop to:
- This
RangeControl
usage which seems to use an underlyingRangeControl
component. RangeControl
's storybook examplesRangeControl
's tests
height: 40px; | ||
/* Vertically center the RangeControl until it has true 40px height. */ | ||
display: flex; | ||
align-items: center; | ||
margin-bottom: 0; |
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.
Love it that we can clean up all those styles 🚀
Good catch, done in 7f28701 |
Is it expected that the lint rule didn't pick that up? |
I thought it was because of the suppressed TS error in the instance, but upon further testing it was a configuration error 😓 So complicated... I'll fix it after all the open PRs are merged. |
Thanks for keeping things tidy 🙏 |
Part of #63871
What?
Add a lint rule to prevent people from introducing new usages of RangeControl that do not adhere to the new default size.
Testing Instructions
The lint error should trigger for violations as expected.