-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Consider allowing changing the default block style variation #11451
Comments
That's probably because the block has already a default style variation. Why not just style the default variation in your stylesheet instead of adding a new one? |
I'm testing out this feature as I'm currently writing a tutorial on block style variations. According to the docs you can set the This isn't currently happening as described by the docs. The Ideally you should be able to (re)set the default block style variation with the |
From the docs:
I am completely confused now. What is wrong, the implementation or the docs? |
I confirm that It also seems that we can't change the default block variation to |
With #11478 we clarified how
What else should be done to consider this issue resolved? |
Hmm... confirm that it works according to the docs? |
I can test later on. But I still worry that Style label is still Rounded (current default from Core) even if I change the default via
I'm going to test is that the case or not. |
@samikeijonen That's not what |
@youknowriad So basically it's another issue which I should open a new ticket? |
Yes, that would be the best approach to open a new issue which proposes changes you expect. |
Describe the bug
I'm trying to use
registerBlockStyle()
to register a custom block style variation for the core Button block and set it as the default style when a new Button block is inserted in the editor.The result I'm currently getting is that the block style variation is available in block settings when the Button block is inserted, but it's not being set as the default.
To Reproduce
I'm adding the new block style variation via a Twenty Seventeen child theme using this code:
https://gist.github.com/dgwyer/fad8d4e5edfcd91cafc44b6a2b4a79d4
When the theme is active go to a page and add a Button block. The block style variation is available for selection but is not set as the default style.
Expected behavior
When the Button block is inserted into the editor the custom block style variation should be automatically set in block settings and in the inspector panel. Also the CSS class name should be automatically added to the Additional CSS Class text box in the inspector panel.
Desktop (please complete the following information):
Additional context
I'm seeing the same behavior in Gutenberg v4.1.1 and v4.2.
The text was updated successfully, but these errors were encountered: