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

gutenberg_add_global_styles_for_blocks should add all global styles. #52228

Conversation

zpericic
Copy link

@zpericic zpericic commented Jul 2, 2023

Closes #52276
Regression after #50310

What?

Load all elements global styles for non 'core/' blocks.

Why?

Any style with $metadata['path'] will be skipped if does not have element starting with 'core/'. We should use 'wp_add_inline_style' for all global styles.

How?

Call 'wp_add_inline_style' for all block global styles.

Testing Instructions

  1. Install custom block (name in block.json not starting with "core/") with support any global style defined in styles.blocks.some/block.elements (eg. button, link, h[1-6]) of theme.json
  2. Change some value for button, link, h[1-6] in styles.blocks.some/block.elements
  3. See change are effective

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jul 2, 2023
@github-actions
Copy link

github-actions bot commented Jul 2, 2023

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @zpericic! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@zpericic zpericic force-pushed the fix/add-non-core-blocks-global-styles branch from 9dd48aa to 1a8f96c Compare October 17, 2023 20:51
@zpericic
Copy link
Author

This is resolved in Wordpress by 4174 and merged in Trac 56254.

Error still persist if guttenberg is active.

@zpericic zpericic closed this Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block specific elements styles are not applied for non-core block plugins
2 participants