-
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
BaseControl: Deprecate bottom margin #38730
Labels
Needs Dev Note
Requires a developer note for a major WordPress release cycle
[Package] Components
/packages/components
[Type] Tracking Issue
Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
Comments
This was referenced Feb 11, 2022
mirka
added
the
[Type] Tracking Issue
Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
label
Mar 15, 2022
This was referenced Mar 16, 2022
Just flagging that, with #41269, the |
This was referenced Aug 11, 2022
This was referenced Aug 30, 2022
This was referenced Sep 8, 2022
This was referenced Nov 22, 2022
This was referenced Feb 8, 2023
This was referenced Jul 16, 2024
This was referenced Aug 2, 2024
igorschoester
added a commit
to Yoast/wordpress-seo
that referenced
this issue
Sep 12, 2024
Gutenberg added a deprecation warning for SelectControl via WordPress/gutenberg#38730 This opts in to that behavior and adds the margin top to the ExternalLink below (therefor needing block layout to get the margin to take effect)
18 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Needs Dev Note
Requires a developer note for a major WordPress release cycle
[Package] Components
/packages/components
[Type] Tracking Issue
Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
What problem does this address?
The
BaseControl
component currently has an inherentmargin-bottom
, making it hard to reuse in different contexts, since it requires a style override of an internal element. This kind of internal override is something we want to discourage.Additionally, the current margin-bottom leads to inconsistent results when
help
text is supplied, because the margin is inserted before and not after the help text.What is your proposed solution?
Deprecate the bottom margin (similar to #37160), following the guidelines stipulated in the devdocs.
Because this change impacts a large number of components (even just inside the Gutenberg codebase), I suggest we approach this in phases:
__nextHasNoMarginBottom
prop to BaseControl to opt-in to the correct styles, without adding a deprecation warningBaseControl
, with a relatively long grace period Deprecate bottom margin on BaseControl-based components #64408✍️ Dev Note (WordPress 6.2 release)
A number of UI components currently ship with styles that give them top and/or bottom margins. This can make it hard to reuse them in arbitrary layouts, where you want different amounts of gap or margin between components.
To better suit modern layout needs, we will gradually deprecate these outer margins. A deprecation will begin with an opt-in period where you can choose to apply the new margin-free styles on a given component instance. Eventually in a future version, the margins will be completely removed.
Continuing the effort started in previous releases, for the WordPress 6.2 release we focused on the
BaseControl
component and its consumers. While the effort is still ongoing, the outer margins on the following components have been deprecated.BaseControl
CheckboxControl
ComboboxControl
FocalPointPicker
RadioControl
RangeControl
SearchControl
SelectControl
TextControl
TextareaControl
ToggleControl
ToggleGroupControl
TreeSelect
To start opting into the new margin-free styles, set the
__nextHasNoMarginBottom
prop totrue
.We're in the process of migrating all internal usages to use the new
__nextHasNoMarginBottom
prop. Once all usages are migrated, an official deprecation will be added to theBaseControl
componentThe text was updated successfully, but these errors were encountered: