Skip to content
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

Block styles slugs & custom styles future stability issue #43822

Open
webaxones opened this issue Sep 2, 2022 · 2 comments
Open

Block styles slugs & custom styles future stability issue #43822

webaxones opened this issue Sep 2, 2022 · 2 comments
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.

Comments

@webaxones
Copy link

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 on core/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 classes is-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

  1. Unregister 'core/button', 'outline'
  2. Register custom '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

@skorasaurus
Copy link
Member

related: #11763

@cbirdsong
Copy link

cbirdsong commented Sep 6, 2022

@artemiomorales artemiomorales added [Type] Enhancement A suggestion for improvement. [Feature] Theme Style Variations Related to style variations provided by block themes [Type] Discussion For issues that are high-level and not yet ready to implement. labels Sep 17, 2022
@colorful-tones colorful-tones added [Feature] Block Variations Block variations, including introducing new variations and variations as a feature and removed [Feature] Theme Style Variations Related to style variations provided by block themes labels Sep 11, 2023
@fabiankaegy fabiankaegy added [Feature] Block Style Variations Issues or PRs that are related to the style variations for blocks and removed [Feature] Block Variations Block variations, including introducing new variations and variations as a feature labels Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

6 participants