-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Layout: Skip outputting base layout rules that reference content or wide sizes if no layout sizes exist #6362
Conversation
I've just added a draft for this PR — I haven't quite finished this yet (still need to update tests), but thought I'd at least push the PR to save my progress, as I've finished up for the week. I'll return to this on Monday. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN:
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
I've switched the PR over to "ready for review" now that the tests have been updated. A note on the tests as the readability of the changes is not great:
Between the above two changes to existing tests, there should be good coverage for the two states (outputting rules that reference content/wideSize and skipping the output). |
…ide sizes if no layout sizes exist
9098739
to
bc7430f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Changes LGTM and work as expected.
Committed in r57948. |
This is a backport of WordPress/gutenberg#60489 from the Gutenberg repo.
Skip outputting base layout rules that reference content of wide sizes CSS variables, if no layout sizes exist in the current
theme.json
.Testing instructions
Activate Twenty Twenty theme and add the following test markup from WordPress/gutenberg#60413 to a post:
Save and publish the post. On the site front end, prior to this PR, the wide group block will extend to the full width of its container. With this PR applied, its
max-width
should be that provided by the theme (in the case of Twenty Twenty, it's 120rem).To test against regressions, switch to a block theme and make sure that constrained layout works as expected in the post and site editors and on the site front end.
Trac ticket: https://core.trac.wordpress.org/ticket/60936
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.