-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
[Feature] Block VariationsBlock variations, including introducing new variations and variations as a featureBlock variations, including introducing new variations and variations as a feature[Feature] Theme Style VariationsRelated to style variations provided by block themesRelated to style variations provided by block themes[Type] DiscussionFor issues that are high-level and not yet ready to implement.For issues that are high-level and not yet ready to implement.
Description
This stems from #33157 and older threads such as #22208 (comment)
Example: tt1-blocks theme
I've looked at what the TT1-blocks theme needs for styling in CSS. A large part of its styles is block style variations. This is what the theme has to do to set up the block style variations it wants.
Register its own block style variations:
- In block-styles.php: register its own block style variations.
- In blocks.css: define the CSS for those block style variations.
- In functions.php enqueues the CSS for the block styles variatons for the editor (via hooking into
after_setup_theme
) and for the front-end (via hooking intowp_enqueue_scripts
).
Unregister existing block styles variations it doesn't want active:
- In unregister-block-style.js: unregister the block style variations it doesn't want to be shown.
- In functions.php: enqueue the above script via
enqueue_block_editor_assets
so it takes effect.
Metadata
Metadata
Assignees
Labels
[Feature] Block VariationsBlock variations, including introducing new variations and variations as a featureBlock variations, including introducing new variations and variations as a feature[Feature] Theme Style VariationsRelated to style variations provided by block themesRelated to style variations provided by block themes[Type] DiscussionFor issues that are high-level and not yet ready to implement.For issues that are high-level and not yet ready to implement.