Tracking: Improve blocks that have placeholder form #41961
Labels
[Block] Embed
Affects the Embed Block
[Block] RSS
Affects the RSS Block - used to display entries from an RSS/Atom feed
[Block] Shortcode
Affects the Shortcode Block
[Block] Table
Affects the Table Block
[Package] Components
/packages/components
[Status] In Progress
Tracking issues with work in progress
[Type] Enhancement
A suggestion for improvement.
Overview
Some blocks have
form
elements withinPlaceholder
component.In this tracking issue, I would like to discuss applying a uniform style to these blocks and solving some problems.
I would like to hear your opinions.
Target blocks
core/embed
core/rss
core/table
core/shortcode
What's the problem?
As may be related to this comment, I think the following problems exist with blocks that have
form
elements withinPlaceholder
component.Solution
I propose the following 3 solutions to these problems.
1. Don't use the element directly
In the
core/embed
block, theinput[type="url"]
element is used, but it should be replaced withTextControl
as in thecore/rss
block.gutenberg/packages/block-library/src/embed/embed-placeholder.js
Lines 28 to 35 in c489f75
2. Use gap style in form tags
In
core/table
,core/rss
,core/embed
block, input elements and button are placed directly underform
tag, but the styling of these elements varies from block to block.e.g.
gutenberg/packages/block-library/src/table/editor.scss
Lines 61 to 68 in c489f75
Applying
gap: 8px;
to the form tag eliminates the need for the block's own styling and ensures that the margins are correctly maintained at any screen width.3. Apply
box-sizing
to form elementsThe site editor doesn't apply
box-sizing:border-box
to form elements, so the layout is broken in several blocks.To fix this, I think we should apply
box-sizing:border-box
to the input element directly below theform
tag.Problems per block
The following are problems per block I have found:
core/embed
input[type="url"]
element is used.Embed Block: Replace native input element with InputControl component #64668
Unify placeholders #59275
✅
core/rss
Placeholder: Tweak placeholder style #61590
InputControl-based components: Add opt-in prop for next 40px default size #53819
✅
core/table
Tweak table block placeholder with __next40pxDefaultSize props #56935
BaseControl: Add
box-sizing
resets #42889✅
core/shortcode
Placeholder
component are used to create a unique layout.Shortcode Block: fix layout margin override #55028
The text was updated successfully, but these errors were encountered: