WordPress.org

Make WordPress Core

Opened 13 days ago

Closed 13 days ago

Last modified 10 days ago

#54781 closed defect (bug) (fixed)

WordPress default presets aren't loaded for all themes

Reported by: oandregal Owned by: jorgefilipecosta
Milestone: 5.9 Priority: normal
Severity: normal Version: trunk
Component: General Keywords: has-patch dev-reviewed commit close
Focuses: Cc:

Description

The default preset styles of WordPress (font sizes, colors, gradients) are now provided via the global stylesheet to avoid duplication of styles. This stylesheet can be found in the front-end with the name global-styles-inline-css.

The default presets are important to support old content that may use them and also patterns, that can use cross-theme styles.

Change History (9)

This ticket was mentioned in PR #2129 on WordPress/wordpress-develop by oandregal.


13 days ago

  • Keywords has-patch added

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 https://github.com/WordPress/gutenberg/pull/35182 and https://github.com/WordPress/gutenberg/pull/34510) and are now provided by the global stylesheet, which is enabled to all themes as of https://github.com/WordPress/gutenberg/pull/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.

#2 @jorgefilipecosta
13 days ago

  • Keywords dev-reviewed added

#3 @jorgefilipecosta
13 days ago

  • Keywords commit added

#4 @jorgefilipecosta
13 days ago

  • Owner set to jorgefilipecosta
  • Resolution set to fixed
  • Status changed from new to closed

In 52547:

Fix: WordPress default presets aren't loaded for all themes.

The default preset styles of WordPress (font sizes, colors, gradients) are now provided via the global stylesheet to avoid duplication of styles. This stylesheet can be found in the front-end with the name global-styles-inline-css.
The default presets are important to support old content that may use them and also patterns, that can use cross-theme styles.

Props oandregal.
Fixes #54781.

#5 @prbot
13 days ago

oandregal commented on PR #2129:

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

I have a fix for TwentyTwenty at https://github.com/WordPress/wordpress-develop/pull/2130 TwentyNineteen and TwentyTwentyone still need a patch.

#6 @jorgefilipecosta
13 days ago

In 52548:

Fix: WordPress default presets aren't loaded for all themes.

The default preset styles of WordPress (font sizes, colors, gradients) are now provided via the global stylesheet to avoid duplication of styles. This stylesheet can be found in the front-end with the name global-styles-inline-css.
The default presets are important to support old content that may use them and also patterns, that can use cross-theme styles.

Props oandregal.
Merges [52547] to the 5.9 branch.
Fixes #54781.

#7 @jorgefilipecosta
13 days ago

  • Keywords close added
  • Milestone changed from Awaiting Review to 5.9

Backported to the 5.9 branch.

#9 @prbot
10 days ago

noisysocks commented on PR #2129:

Thanks @oandregal!

Note: See TracTickets for help on using tickets.