Make WordPress Core

Opened 3 years ago

Last modified 2 years ago

#51490 new defect (bug)

Editor Styles Not Loading in Correct Sequence for Blocks

Reported by: susanwrotethis's profile susanwrotethis Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.5.1
Component: Editor Keywords: reporter-feedback
Focuses: css Cc:

Description

In the block editor, styles loaded by WP core are overriding those from editor-style.css in a custom theme I'm building, causing particular display issues with line heights and margins for header blocks.

It appears as though this is due to an error at line 190 of edit-form-blocks.php, the file that sets up $editor_settings. The line:

if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {

The current_theme_supports check should be for 'editor-style' rather than 'editor-styles'. As a result, styles from editor-style.css are being skipped.

(Some earlier sequence is loading the styles from editor-style.css, so they do exist in the block editor. However, the WP core styles loaded in edit-form-blocks.php are overriding them.)

Change History (2)

This ticket was mentioned in Slack in #core-css by kirstyburgoine. View the logs.


2 years ago

#2 @sabernhardt
2 years ago

  • Keywords reporter-feedback added

Hi @susanwrotethis and thanks for opening the ticket!

Please confirm whether you have both of these:

add_theme_support( 'editor-styles' );
add_editor_style();

A similar report is on GitHub regarding the documentation for add_theme_support plus add_editor_style with the block editor. The theme support function is supposed to include editor-styles, and add_editor_style does not have the s.

Note: See TracTickets for help on using tickets.