Description
What problem does this address?
On the above issue, there was some consensus that there would be value in extending theme.json to allow spacing size presets to be added, which gives users a set of preset size tokens to select from as well as/or instead of just adding custom spacing values.
This blog post provides a good introduction to some of the reasons for this.
This is intended to be a top-level issue for some of the initial discussions, as well as tracking the ongoing work needed to implement this.
The block UI will need to allow people to select from the presets (e.g. padding value Medium) in addition to the "absolute value" settings (e.g typing "23px"), and also allow for theme authors to disable the option to add absolute values.
Update
Summary of discussion and suggested way forward
Todo
- Add UI to Global styles to allow managing spacing presets #61986
- Add UI for adding fluid values at the block level. Ensure that [mobile requirements]
- Look at disabling core scale with false or null as well as by setting
steps:0
- Investigate adding of utility classes instead of inline styles (needs to work conditionally based on current blocks or too many classes will be generated)
- Add nearest fallback options if the current theme does include a currently assigned preset
Done
- Theme.json: Add spacing size presets #41527
- Add spacing presets support to style engine #41990
- Spacing presets: add editor UI support #42173
- Fix sizing of custom setting toggle icon (Spacing presets: fix/minor issues noted in initial UI PR #43214)
- Disable presets in global styles if no preset values(Spacing presets: fix/minor issues noted in initial UI PR #43214)
- Plumb through the
customSpacingSize
value fromtheme.json
to UI and disable custom sizing whenfalse
(Spacing presets: Implement disabling of custom space sizes #43216) - Add spacing presets to Margin controls
(Mobile spacing issues #40486) are looked at as part of this - Fix layout of BoxControl when 0 spacing scale steps(Spacing presets: fix/minor issues noted in initial UI PR #43214)
- Add spacing presets to Block Gap controls
- Fix the glitchy spacing visualiser - currently ends up out of sync if changing sizes quickly
- Add some indication to the UI when editing custom sides (eg. group block margins only affect top and bottom) to indicate in linked mode which sides will be affected - Spacing: Optimize & condense unlinked spacing controls #50660
- Add spacing presets option to Spacer block height
- Explore option of easily allowing of editing top/bottom and left/right together - Spacing: Optimize & condense unlinked spacing controls #50660
Metadata
Assignees
Labels
Type
Projects
Status
No status