Large list of spacing sizes causes var:preset|spacing|default
value for other dimensions
#52976
Labels
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
[Package] Style Engine
/packages/style-engine
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
If a theme has more than 8 spacing size presets, when customizing a dimension for margin, padding or block gap in the block editor for a block, the other non-customized dimensions for that "dimension group" will have a value of
var:preset|spacing|default
which for most themes will not exist.8 is the threshold for whether
<SpacingInputControl>
displays a range control or a dropdown control:https://github.com/WordPress/gutenberg/blob/v16.1.2/packages/block-editor/src/components/spacing-sizes-control/input-controls/spacing-input-control.js#L60
It seems likely then that it could be a bug with the way the dropdown control is used to handle the default value.
Step-by-step reproduction instructions
wp-content/themes/twentytwentythree/theme.json
to add 3 extra members insettings.spacing.spacingSizes
:core/group
block.var:preset|spacing|default
value.Screenshots, screen recording, code snippet
✅ With 8 or less spacing sizes
The other padding dimensions are not set when editing the top padding (commented formatted for readability):
❌ With more than 9 spacing sizes
The other padding dimensions are set to
var:preset|spacing|default
when editing the top padding (commented formatted for readability):Environment info
WordPress 6.3-RC2-56310
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: