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

The global stylesheet should be enqueued for all themes #2129

Closed
wants to merge 1 commit into from
Closed

The global stylesheet should be enqueued for all themes #2129

wants to merge 1 commit into from

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Jan 10, 2022

Track ticket https://core.trac.wordpress.org/ticket/54781

For themes without theme.json support, we only enqueue the default styles provided by WordPress, such as the preset classes
(font sizes, colors, gradients). These classes should be always present as they may be used by old content and patterns.

For themes with theme.json support, we also enqueue the theme styles.

More context

In WordPress 5.8 the preset classes (font sizes, colors, gradients) were provided via a CSS stylesheet that we enqueued to all themes plus the global stylesheet for the themes that supported theme.json. To avoid this duplication, in WordPress 5.9 the preset classes were removed from the common stylesheet (see WordPress/gutenberg#35182 and WordPress/gutenberg#34510) and are now provided by the global stylesheet, which is enabled to all themes as of WordPress/gutenberg#34334

Related devnote, see "Changes to the global stylesheet" section.

How to test

  • Load the TwentyTwenty theme.
  • Go to the front end and verify that there's a stylesheet called global-styles-inline-css.
For themes without theme.json support we only enqueue the default
styles provided by WordPress, such as the preset classes
(font sizes, colors, etc). These should be always present
as they may be used by old content and patterns.

For themes with theme.json support, we also enqueue the theme styles.
@oandregal
Copy link
Member Author

cc @noisysocks @youknowriad @jorgefilipecosta Somehow, this little piece of logic was missed during the backports.

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

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

Works well on my tests 👍

@oandregal
Copy link
Member Author

Related issue at https://core.trac.wordpress.org/ticket/54782

I have a fix for TwentyTwenty at #2130 TwentyNineteen and TwentyTwentyone still need a patch.

@oandregal
Copy link
Member Author

Merged as of 16e0165

@oandregal oandregal closed this Jan 10, 2022
@oandregal oandregal deleted the fix/enable-gs-for-all-themes branch January 10, 2022 18:35
@noisysocks
Copy link
Member

Thanks @oandregal!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants