Make WordPress Core

Opened 20 months ago

Closed 13 months ago

Last modified 5 months ago

#61892 closed defect (bug) (fixed)

Enqueue `classic-theme-styles` earlier in editor styles

Reported by: sabernhardt's profile sabernhardt Owned by: audrasjb's profile audrasjb
Milestone: 6.8 Priority: normal
Severity: normal Version: 6.1
Component: Themes Keywords: has-patch
Focuses: Cc:

Description

[54687] introduced a fallback stylesheet for Button block styles (and later File blocks) for both the front end and the editor. In the editor, that has been added within the body, after the theme's block styles.

That commit had quick fixes for Twenty Twelve and Twenty Twenty, but raising the specificity for those colors should have been unnecessary. Also, themes such as Twenty Fourteen—and non-Core themes—still have had a similar problem with the incorrect order (#61881, GB44731).

Change History (10)

This ticket was mentioned in PR #7205 on WordPress/wordpress-develop by @sabernhardt.


20 months ago
#1

  • Keywords has-patch added
  • Registers the stylesheet outside wp_enqueue_classic_theme_styles().
  • Enqueues classic styles in the enqueue_block_assets action instead of adding them in the block_editor_settings_all filter.
  • Deprecates the wp_add_editor_classic_theme_styles() function.

Trac 61892

@sabernhardt commented on PR #7205:


20 months ago
#2

Related concerns, for other tickets:

  • In the non-framed editor, stylesheets enqueued with the enqueue_block_editor_assets hook still can be added before classic-theme-styles. Trac 61591 should fix that for the bundled themes by using the enqueue_block_assets hook.
  • Twenty Ten shows the Button block links with white text in the iframe and gray in the non-framed editor, but the front end sets links to blue at a higher specificity: a:link { color: #0066cc; }

This ticket was mentioned in Slack in #core by chaion07. View the logs.


18 months ago

#4 @desrosj
18 months ago

  • Milestone changed from 6.7 to 6.8

6.7 RC1 is due out any moment, so unfortunately this one missed the deadline.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


14 months ago

#6 @audrasjb
14 months ago

  • Owner set to audrasjb
  • Status changed from new to reviewing

Self assigning for review

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


13 months ago

#8 @audrasjb
13 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 59980:

Themes: Enqueue classic-theme-styles in enqueue_block_assets.

[54687] introduced a fallback stylesheet for Button block styles (and later File blocks) for both the front end and the editor. In the editor, that has been added within the body, after the theme's block styles. That commit had quick fixes for Twenty Twelve and Twenty Twenty, but raising the specificity for those colors should have been unnecessary. Also, themes such as Twenty Fourteen — and non-bundled themes — still have had a similar problem with the incorrect order.

Thus, this changeset:

  • Registers the stylesheet outside wp_enqueue_classic_theme_styles().
  • Enqueues classic styles in the enqueue_block_assets action instead of adding them in the block_editor_settings_all filter.
  • Deprecates the wp_add_editor_classic_theme_styles() function.

Follow-up to [54687].

Props sabernhardt, mukesh27.
Fixes #61892.

@sabernhardt commented on PR #7205:


13 months ago
#9

Committed in r59980

#10 @westonruter
5 months ago

In 61322:

Docs: Improve accuracy of wp_enqueue_classic_theme_styles() description.

Developed in https://github.com/WordPress/wordpress-develop/pull/10565

Follow-up to [59980], [54687], [54358].

Props manhphucofficial, wildworks, sabernhardt, iflairwebtechnologies, westonruter.
See #61892, #64224.
Fixes #64317.

Note: See TracTickets for help on using tickets.