Improve the way we handle custom units and how we interact with themes config. #33470
Labels
Customization
Issues related to Phase 2: Customization efforts
[Feature] Themes
Questions or issues with incorporating or styling blocks in a theme.
[Type] Code Quality
Issues or PRs that relate to code quality
There are a couple of issues with the way we handle units right now. Themes provide the available themes by adding
spacing.units
to theirtheme.json
or by definingadd_theme_support( 'custom-units' )
I noticed a number of issues though:
false
value for the config but since we have fallbacks each time we douseSetting( 'spacing.units' )
in core blocks, it means we'll still allow custom units. I guess that means custom units are opt-out these days, that's fine but we should clarify how themes can opt-out of custom units and if that's even something we allow.%
from the available units, it is still possible to use a pattern or a variation with that unit (for instance columns variations), Right now, the block works well but the UI in the inspector shows another unit as selected, maybe we should show the unit but disabled?useSetting( 'spacing.units' )
as a prop to the UI component. Some refactoring/simplification might be needed there.cc @nosolosw @aristath
The text was updated successfully, but these errors were encountered: