Block styles slugs & custom styles future stability issue #43822
Labels
[Feature] Block Style Variations
Issues or PRs that are related to the style variations for blocks
[Type] Discussion
For issues that are high-level and not yet ready to implement.
[Type] Enhancement
A suggestion for improvement.
Description
Block core style slugs are reserved. But we don't know in advance which slugs will be added in the future.
Example:
If I disable
outline
style oncore/button
block (both in PHP and in JS), and then try to register a custom style on the same block with the same slug'core/button', 'outline'
, my style does not appear.This action is not useful, but it proves that if I create, for example, a custom style named 'shinny' on a core block (
'core/button, 'shinny'
) and if next year Gutenberg adds a 'shinny' style to the same core block, my style will stop working.I can get away with prefixing my style
prefix-shinny
, but it affects the naming of my classesis-style-prefix-shinny
, and the documentation doesn't specify that we should prefix names.Isn't it possible to find a solution so that the style slugs don't compete?
Thanks :)
Step-by-step reproduction instructions
'core/button', 'outline'
Custom style won't work.
Screenshots, screen recording, code snippet
No response
Environment info
WordPress 6.0.1
Custom Full Site Editing WooCommerce theme
Desktop with Windows 10
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: