The Block - Theme contract #35470
Replies: 2 comments 1 reply
-
The only proper contract we provide are class names of the form We have not added classes for all blocks (notably headings, paragraphs, lists, render as vanilla html elements when they have no customizations). So those three questions would be:
Block Style Variations would be one way, in that it allows pairing to an explicit class that is hooked into the block wrapper. The block style variations APIs are not fully developed yet and need a lot of further work. See a fairly old overview: #7551. There's also an expectation to provide per-block custom CSS hooks, following something like this implementation exploration: #25413 |
Beta Was this translation helpful? Give feedback.
-
I just opened #38998 that I hope can provide a path for the "contract" core provides with some standards that would benefit everyone. |
Beta Was this translation helpful? Give feedback.
-
I'd like to learn more about the guarantees that a block grants to a theme, in the sense of: what parts of a block can the themes rely on?
For example:
An example of a theme relying on inner block class names can be seen on the the Blockbase theme.
Based on the answers, I have two follow-up questions:
If themes cannot rely on any block internals, how will they make the necessary modifications to the blocks? This is related to my where blocks end and themes start question.
If themes can rely on block internals, what are the current plans for blocks to evolve over time?
In the second scenario, imagine a theme or a pattern needs to create some sort of layout/style that is not possible using the layout/styling options of core blocks and global styles, and it ends up using custom CSS.
Beta Was this translation helpful? Give feedback.
All reactions