theme.json spec: use block names for settings & block selectors for styles #29773
Labels
[Feature] Themes
Questions or issues with incorporating or styling blocks in a theme.
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
The current theme.json spec allows theme authors to change settings & styles for specific blocks by addressing them by "block selectors"
core/paragraph
,core/group
, etc.Some blocks are special in that they represent different HTML markup. An example of this is the Heading block whose name is
core/heading
. In theme.json, it's addressed by block selectors that represent the different HTML markup combination the block can have:core/heading/h1
,core/heading/h2
, etc. Themes can't addresscore/heading
, for example.In practice, these block selectors have proven useful for styles. However, for settings, there has been no use in practice. Which holds the question: does it makes sense that themes can provide settings for different configurations of the same block (the same block with different block attributes)? For example, does it make sense that the heading block can have a different color palette depending on whether it's an H1, H2, etc? This is actually an issue: themes can't provide a specific color palette for the header block, they need to provide the same color palette for all configurations of the block (
core/heading/h1
,core/heading/h2
, etc).Given this rationale, it seems proper that we do the following:
core/paragraph
,core/heading/h1
,core/heading/h2
, etc. As it is currently.core/paragraph
,core/heading
. Change of behavior for two core blocks: heading & post title. It doesn't look like themes are targeting them on settings.The text was updated successfully, but these errors were encountered: