You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Non-core block styles defined in theme.json currently being filtered-out before rendering #41614
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] Needs More InfoFollow-up required in order to be actionable.[Status] StaleGives the original author opportunity to update before closing. Can be reopened as needed.
When adding block styles for non-core blocks in theme.json, I expect styles to populate in the editor and front-end in a similar fashion to core blocks.
Seems that since #40185 was merged into Gutenberg 13.1, this is no longer happening — is this intended behaviour?
Add a block style in theme.json for the block in question. In this case, for example, {"styles":{"blocks":{"tabor/share-on-twitter":{"color":{"background":"rebeccapurple","text":"white"},"border":{"radius":"10px"},"typography":{"fontSize":"2rem"}}}}}
Add a block style in theme.json for a core block. For example, {"styles":{"blocks":{"core/paragraph":{"color":{"text":"teal"},"typography":{"fontSize":"2rem"}}}}}
Add both blocks into a new page — notice that the core styles are parsed, but the non-core block styles aren't.
In the plugin file compat/wordpress-6.0/block-editor-settings.php on line 85, remove the if-condition wrapping $styles_without_existing_global_styles[] = $style;
Non-core block styles are now successfully being parsed.
Screenshots, screen recording, code snippet
Before making the change listed above in compat/wordpress-6.0/block-editor-settings.php on line 85
After making the change listed above in compat/wordpress-6.0/block-editor-settings.php on line 85
Environment info
Wordpress 6.01 (tested and replicated on 5.9.3 and 6.0)
Gutenberg 13.4 (tested and replicated on 13.1 RC1, 13.1, 13.2 and 13.3)
macOS Monterray 12.3.1, Safari 15.4, Firefox 102
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
And both "Share on Twitter Block" and the paragraph look as expected. Could you please share the minimal theme.json file where you are able to reproduce the issue?
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.
This issue has not had any activity for a while and I cannot reproduce this either. I am going to close this but please feel free to reopen it if you can provide more details, @drwsmth. Thank you!
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] Needs More InfoFollow-up required in order to be actionable.[Status] StaleGives the original author opportunity to update before closing. Can be reopened as needed.
Activity
annezazu commentedon Jun 17, 2022
@jorgefilipecosta perhaps you have some insights here? I know André is out still!
jorgefilipecosta commentedon Jun 23, 2022
Hi @drwsmth,
I'm not able to reproduce this issue. I applied the following theme.json
And both "Share on Twitter Block" and the paragraph look as expected. Could you please share the minimal theme.json file where you are able to reproduce the issue?
Thank you in advance!
github-actions commentedon Jul 9, 2022
Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.
mrfoxtalbot commentedon Sep 19, 2022
This issue has not had any activity for a while and I cannot reproduce this either. I am going to close this but please feel free to reopen it if you can provide more details, @drwsmth. Thank you!