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

Dequeue FSE global styles #1724

Merged
merged 4 commits into from
Mar 10, 2022
Merged

Dequeue FSE global styles #1724

merged 4 commits into from
Mar 10, 2022

Conversation

laurelfulford
Copy link
Contributor

@laurelfulford laurelfulford commented Mar 4, 2022

All Submissions:

Changes proposed in this Pull Request:

WordPress 5.9 introduced a Global Styles file, which is meant to be populated by a theme's theme.json file. It's still enqueued on non-FSE themes, and is causing a couple small issues in the Newspack theme:

Closes #1713; see #1718 and Automattic/newspack-newsletters#755.

How to test the changes in this Pull Request:

  1. Start on a test site running the Newsletter plugin.
  2. Create and publish a blank page. Either view the non-AMP version of the page and confirm the presence of a global-styles-inline-css style tag in the source, or confirm those styles are there in AMP's CSS usage.
  3. In the editor, view source and confirm the presence of a global-styles-css-custom-properties-inline-css style tag.
  4. To test out the issue in Button block: !important in WP 5.9+ CSS variables overrides hover styles #1713, add a button block and make the background white and the text colour one of the other colours in the editor palette. On the front end, try hovering over the button; note that it turns white-on-white.
  5. To test out the issue in Default font sizes from WP 5.9+ overriding theme #1718, add multiple Heading blocks, and make one small, one large, and one x-large; note how they're smaller than the theme's defaults (small: 16px, large: 36px, huge: 44px), and are actually picking up the sizes set in the Newsletter (small: 12px, large: 24px, x-large: 36px). They should be too small in the editor and on the front-end.
  6. Apply the PR and run npm run build.
  7. Confirm that the button hover is now working as expected -- rather than being white on white, it is now white on #111.
  8. Confirm that the font sizes on the front end line up with the theme's settings (small: 16px, large: 36px, x-large/huge: 44px).
  9. With AMP disabled, view the source and confirm global-styles-inline-css is no longer loaded, or confirm those styles are no longer there in AMP's CSS usage.
  10. In the editor, view source and confirm that the global-styles-css-custom-properties-inline-css styles are no longer getting loaded.
  11. Out of an abundance of caution, confirm that theme/block styles that did appear in the global styles still work as expected.

image

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@laurelfulford laurelfulford added the [Status] Needs Review The issue or pull request needs to be reviewed label Mar 4, 2022
@laurelfulford laurelfulford requested a review from a team as a code owner March 4, 2022 19:18
Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the issues described and I'm still able to use the dutone and gradient options in the editor. 👍

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Mar 9, 2022
@laurelfulford
Copy link
Contributor Author

Thanks @dkoo!

@laurelfulford laurelfulford merged commit d96734d into master Mar 10, 2022
@laurelfulford laurelfulford deleted the fix/dequeue-global-styles branch March 10, 2022 17:42
matticbot pushed a commit that referenced this pull request Mar 15, 2022
## [1.56.2-alpha.1](v1.56.1...v1.56.2-alpha.1) (2022-03-15)

### Bug Fixes

* dequeue Gutenberg's global styles ([#1724](#1724)) ([d96734d](d96734d))
* remove ads custom media queries ([#1717](#1717)) ([6850700](6850700))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.56.2-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Mar 22, 2022
## [1.56.2](v1.56.1...v1.56.2) (2022-03-22)

### Bug Fixes

* dequeue Gutenberg's global styles ([#1724](#1724)) ([d96734d](d96734d))
* remove ads custom media queries ([#1717](#1717)) ([6850700](6850700))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.56.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button block: !important in WP 5.9+ CSS variables overrides hover styles
3 participants