wordpress-develop icon indicating copy to clipboard operation
wordpress-develop copied to clipboard

Fix block library and global styles stylesheet ordering when a block …

Open talldan opened this issue 1 year ago • 3 comments

Trac ticket: https://core.trac.wordpress.org/ticket/61748 Gutenberg issue: https://github.com/WordPress/gutenberg/issues/63912 Gutenberg PR: https://github.com/WordPress/gutenberg/pull/63918

What?

Reorders the dependencies for block-style-variations-styles

Why?

The order of the dependencies here was causing different ordering of stylesheets on the page

When a theme is using theme.json presets that match the naming used by core, this can suddenly cause those core styles to override those from the theme.json (the css variables from core take precedence over those generated from the theme.json.

Props to @aaronrobertshaw for spotting the problematic line of code

Testing Instructions

  • Alter the Twenty Twenty Four theme.json file to include a font size with the slug normal that is something fairly large, like 2rem
  • Make a page with some text using that font size and preview it - note that the text is correctly sized to 2rem
  • Add a button with the Outline style on the same page and preview it again

Expected: the text is still 2rem Before: the text was incorrectly 16px

Screenshots or screencast

Before

Regular button Outline button
Screenshot 2024-07-25 at 10 33 43 AM Screenshot 2024-07-25 at 10 33 32 AM

After

Regular button Outline button
Screenshot 2024-07-25 at 10 33 57 AM Screenshot 2024-07-25 at 10 34 08 AM

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.

talldan avatar Jul 25 '24 03:07 talldan

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props talldanwp, aaronrobertshaw, andrewserong, mukesh27.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

github-actions[bot] avatar Jul 25 '24 03:07 github-actions[bot]

Test using WordPress Playground

The 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

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance, it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

github-actions[bot] avatar Jul 25 '24 03:07 github-actions[bot]

Mark ready for commit.

mukeshpanchal27 avatar Jul 25 '24 06:07 mukeshpanchal27

committed to trunk in r58850

talldan avatar Aug 05 '24 06:08 talldan