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

Add missing blocks origin to theme.json #3313

Closed
wants to merge 3 commits into from
Closed

Add missing blocks origin to theme.json #3313

wants to merge 3 commits into from

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Sep 22, 2022

Trac ticket: https://core.trac.wordpress.org/ticket/56467
Backports WordPress/gutenberg#44363

This PR adds a missing origin to the code that processes theme.json. It also consolidates its name to blocks to be more reflective of what it affects. If the data coming from the blocks origin contained presets, it would be overriden by the data coming from the theme origin, which is not expected.

@michalczaplinski
Copy link
Contributor

michalczaplinski commented Sep 22, 2022

Hey @oandregal I don't really have the expertise to judge the code itself.

However, I am mostly just blindly following the testing instructions from WordPress/gutenberg#44363 and I can't reproduce the behaviour mentioned below:

Using a theme without theme.json (for example, Canape):

  • Verify that the styles for the pullquote and navigation blocks are still present in the global-styles-inline-css. These blocks are the only ones that use the __experimentalStyle API in its block.json. It should look like this:
.wp-block-pullquote{font-size: 1.5em;line-height: 1.6;}
.wp-block-navigation a:where(:not(.wp-element-button)){color: inherit;} 

Here's a video of my issue:

2022-09-22_15-20-13.mp4

@oandregal
Copy link
Member Author

Interesting, I've tested in trunk and it does not work either (it should).

It seems that we're missing a backport: I cannot find in trunk the filter *_theme_json_get_style_nodes, neither when it's thrown or when is used. This was introduced at WordPress/gutenberg#41160 and then the filter updated the name at WordPress/gutenberg#44189 Perhaps we're missing some backports?

@scruffian
Copy link

I think the reason it's not working is that this backport is missing: #3319

@hellofromtonya
Copy link
Contributor

I started working on PR #3319 without realizing this PR is dependent upon that one. As they need to be committed together, I'm closing this one in favor of PR #3319 (as I've already made it a complete backport).

@oandregal oandregal deleted the add/missing-origin branch September 27, 2022 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants