-
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 SelectControl #64283
Conversation
Doesn't matter because this is wrapped in a ToolsPanelItem, which already does normalization on BaseControl margins.
@@ -44,6 +44,7 @@ export default function ResolutionTool( { | |||
panelId={ panelId } | |||
> | |||
<SelectControl | |||
__nextHasNoMarginBottom |
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.
Doesn't matter because this is wrapped in a ToolsPanelItem
, which already does normalization on BaseControl
margins.
<SelectControl | ||
label={ labelComponent } | ||
options={ sizeOptions } | ||
__nextHasNoMarginBottom |
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.
Doesn't matter because this is a test.
__nextHasNoMarginBottom | ||
__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.
__next40pxDefaultSize | ||
__nextHasNoMarginBottom |
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 | ||
__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.
Size Change: +1.75 kB (+0.1%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
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. |
@@ -27,6 +27,7 @@ const orderOptions = [ | |||
function OrderControl( { order, orderBy, onChange } ) { | |||
return ( | |||
<SelectControl | |||
__nextHasNoMarginBottom |
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.
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.
Looks good, thanks @mirka 👍 Very useful testing instructions as always 🚀
A few potential areas we might have missed to update - please check them before merging:
- https://github.com/WordPress/gutenberg/blob/margin-lint-7/packages/block-editor/src/components/inspector-controls/README.md#L129-L138
- https://github.com/WordPress/gutenberg/blob/margin-lint-7/packages/components/src/dimension-control/index.tsx#L88-L96
- https://github.com/WordPress/gutenberg/blob/margin-lint-7/packages/components/src/select-control/stories/index.story.tsx#L37-L61
- https://github.com/WordPress/gutenberg/blob/margin-lint-7/packages/components/src/select-control/test/select-control.tsx
- https://github.com/WordPress/gutenberg/blob/margin-lint-7/packages/components/src/tree-select/index.tsx#L95-L99
- A formatting issue in https://github.com/WordPress/gutenberg/blob/margin-lint-7/packages/components/src/tree-select/index.tsx#L40 which I discovered by accident and we seem to have introduced in Add margin-bottom lint rules for FocalPointPicker, TextareaControl, TreeSelect #63633
@@ -69,6 +69,7 @@ $footer-height: 70px; | |||
color: $gray-900; | |||
} | |||
|
|||
// TODO: See if this can be removed after https://github.com/WordPress/gutenberg/issues/38730 |
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.
👍
Part of #38730
What?
Adds eslint rules to prevent new instances of
SelectControl
to be introduced in the Gutenberg codebase without the__nextHasNoMarginBottom
prop being added.Why?
These lint rules should prevent new violating usages from being added, until we are ready to officially deprecate the margins on the BaseControl-based components all at once.
Testing Instructions
See code comments.