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

Setting Button block to Outline Style causes CSS output order to change and cause conflicts #63912

Closed
2 tasks done
eric-michel opened this issue Jul 24, 2024 · 2 comments · Fixed by #63918
Closed
2 tasks done
Assignees
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@eric-michel
Copy link

Description

Typically, wp-block-library-inline-css is output before global-styles-inline-css so that styles from global-styles-inline-css (i.e. those from theme.json) override those from wp-block-library-inline-css (like the various WP default colors and font sizes).

For some reason, setting a Button block on a page to Outline style causes wp-block-library-inline-css to print after global-styles-inline-css, causing it to override any same-name settings in theme.json.

This is an absolute disaster for us, because our theme defines a normal font size, and now it is being overridden with by the WP default of 16px on any page that uses an Outline button.

Step-by-step reproduction instructions

  • Spin up a fresh site on WP 6.6.1 running the Twenty Twenty Four
  • 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 - note that the text is now 16px

Screenshots, screen recording, code snippet

Normal print order when an Outline style button is not on the page:

image

Print order with an Outline style button on the page:

image

Environment info

WordPress version 6.6.1
Twenty Twenty Four theme (only modified to add a font size to theme.json)
no plugins

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes
@eric-michel eric-michel added the [Type] Bug An existing feature does not function as intended label Jul 24, 2024
@talldan talldan added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Jul 25, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 25, 2024
@talldan
Copy link
Contributor

talldan commented Jul 25, 2024

@eric-michel Thanks for reporting this and providing such a detailed bug report. I've put a fix together in #63918.

I'll also work on a core patch and aim to get this released in 6.6.2

@eric-michel
Copy link
Author

Thank you so much @talldan! Once the problem was figured out my next step was going to be to figure out who I had to beg to get this added to a point release, so you saved me a lot of anxiety there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
2 participants