-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow styling custom styles registered via register_block_style in theme.json #49550
Comments
Sorry, I didn't see that PR. Thanks! |
Reopening because the linked PR is about adding support for the "css" property to elements and variations, and my issue is about adding simple styling support (color, margin, padding, typography, etc.) to variations. |
Regarding adding styling support to block variations, I think this was implemented in #46343. The example code can be found in this section, which is part of the WordPress 6.2 Field Guide. |
Yes, I know, but it only works for CORE styles (for example, the "rounded" style in the image block), not custom styles registered via |
Thanks for bringing this up!
Correct, the initial implementation only included core style variations, with the standard design tools. Because existing custom style variations are styled via a classic stylesheet, which depending on specificity might not be overridable with the core design tools such as color, typography etc.., custom styles were excluded then. I'm thinking that the custom CSS field could be leveraged to solve that problem, and also that it should be possible to add new custom variations from theme.json. I opened an issue in #49602 suggesting some next steps. |
Since WP 6.2, one can style core block style variations via the "variations" key in theme.json that can be added under styles.blocks.blockname. Right now, this does not work with custom styles registered via register_block_style.
Can you add this feature, please?
The text was updated successfully, but these errors were encountered: