Make WordPress Core

Opened 23 months ago

Closed 23 months ago

Last modified 23 months ago

#54781 closed defect (bug) (fixed)

WordPress default presets aren't loaded for all themes

Reported by: oandregal's profile oandregal Owned by: jorgefilipecosta's profile jorgefilipecosta
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.9
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.


23 months ago
#1

  • 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
23 months ago

  • Keywords dev-reviewed added

#3 @jorgefilipecosta
23 months ago

  • Keywords commit added

#4 @jorgefilipecosta
23 months 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.

oandregal commented on PR #2129:


23 months ago
#5

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
23 months 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
23 months ago

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

Backported to the 5.9 branch.

noisysocks commented on PR #2129:


23 months ago
#9

Thanks @oandregal!

Note: See TracTickets for help on using tickets.