-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Labels
[Feature] Block APIAPI that allows to express the block paradigm.API that allows to express the block paradigm.[Feature] Block VariationsBlock variations, including introducing new variations and variations as a featureBlock variations, including introducing new variations and variations as a feature[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.Questions or issues with incorporating or styling blocks in a theme.[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] EnhancementA suggestion for improvement.A suggestion for improvement.
Description
What problem does this address?
After using (custom) block variations in a larger scale project, block styles seem to miss fine-grained control over when they appear in relation to variations.
Use case:
- I have added a new group variation called 'section'.
- I want to add a block style for the section but not for the other variations of the group block.
This is possible with a few lines of CSS, but the block editor UI has no way to know and shows all block styles for each group variation.
By giving theme developers more fine-grained control over which block styles appear to the end-user, based on the type of block variation(s), we can extend possibilities in styling, and clean-up valuable UI space.
What is your proposed solution?
I propose some more options when registering block styles (in php).
register_block_style(
'core/group',
[
'name' => 'custom',
'label' => 'custom',
'variations' => [ 'section', 'stack', 'row' ], // if empty, style will apply to all
]
);
Andrew-Starr, gziolo, crimann, patrickdorival, seansean and 11 morepatrickdorival
Metadata
Metadata
Assignees
Labels
[Feature] Block APIAPI that allows to express the block paradigm.API that allows to express the block paradigm.[Feature] Block VariationsBlock variations, including introducing new variations and variations as a featureBlock variations, including introducing new variations and variations as a feature[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.Questions or issues with incorporating or styling blocks in a theme.[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] EnhancementA suggestion for improvement.A suggestion for improvement.