Block Inspector: Deprecate bottom margin on BaseControl components #65191
Labels
[Package] Block editor
/packages/block-editor
[Type] Enhancement
A suggestion for improvement.
[Type] Tracking Issue
Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
What problem does this address?
The block inspector currently sets a margin bottom on all BaseControl components.
gutenberg/packages/block-editor/src/components/block-inspector/style.scss
Lines 13 to 19 in cf8aeba
This was probably convenient at the time, when flexbox was yet to be widely available. Now, it is hindering our ability to use modern layout methods like
flex
andgrid
. And devs are going to need a way to space out elements that are not BaseControl-based anyway.Some consumers are forced to override the margin added by the block inspector so they can handle their own layout:
gutenberg/packages/block-library/src/search/editor.scss
Lines 20 to 25 in 20a0eda
What is your proposed solution?
The pathway I have in mind at the moment is:
__next
prop and/or data attribute so certain container components can opt out of the automatic margin-bottom on BaseControl. Ideally we'd expose the prop only onInspectorControls
and not on any@wordpress/components
components.spacing
is 8px instead of the 16px we want in the inspector)? Is it a new, dedicated layout component (Implement a standard "controls grid" component for sidebar #43423)? To be decided.The text was updated successfully, but these errors were encountered: