Style engine: extend block support style definitions#45296
Closed
Style engine: extend block support style definitions#45296
Conversation
|
Size Change: 0 B Total Size: 1.51 MB ℹ️ View Unchanged
|
ramonjd
commented
Oct 26, 2022
1 task
2a85fc4 to
a018edf
Compare
6872bfa to
03bc1da
Compare
25 tasks
9754130 to
bb95fde
Compare
this commit adds a new class to the style engine that manages extensions of the block style definitions adding tests
- moving CSS style output tests to style-engine-test.php
Update var name
627d8a6 to
eb569b9
Compare
|
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ phpunit/style-engine/class-wp-style-engine-block-style-metadata-test.php ❔ lib/load.php ❔ phpunit/style-engine/style-engine-test.php |
Member
Author
|
Closing for now. I'll come back later if this feature is required and time permits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By "too early" I mean that there's little demand for such a feature, and also that we should implemented and reach stability with global styles before we open up the extensibility genie.
What?
Takes inspiration from #41965
Adds a new class to the style engine that manages extensions of the block style definitions.
❗ This PR only allows setting new style definitions, that is, those that do not already exist in
BLOCK_STYLE_DEFINITIONS_METADATAas either top-level style groups or their children. It does not allow overwriting existing definitions.Why?
Plugins and/or themes may want to register new a block support, and also have the Style Engine generate styles for this block support.
See: https://github.com/WordPress/gutenberg/blob/trunk/packages/style-engine/docs/using-the-style-engine-with-block-supports.md
Furthermore, allowing users to extend the default block style definitions list opens up handling of preset vars, classnames and other functionality.
TODO
This is the first iteration. Follow ups will:
value_funccallables.BLOCK_STYLE_DEFINITIONS_METADATAHow?
A new class:
WP_Style_Engine_Block_Style_MetadataTesting Instructions
npm run test:unit:php:base -- --filter WP_Style_Engine_Block_Style_Metadata_Testnpm run test:unit:php:base -- --filter WP_Style_Engine_TestYou can also test manually, e.g,: