Make WordPress Core


Ignore:
Timestamp:
10/25/2022 12:17:55 PM (4 years ago)
Author:
Bernhard Reiter
Message:

Editor: Correctly apply Button block styles for classic themes

In [54358], styling for Button blocks that had been removed from classic themes was reintroduced. However, it was added with a global scope, whereas editor styles are usually added with a .editor-styles-wrapper selector, which makes them more specific.

This change modifies the way that classic theme styles are added so that they also get wrapped in an .editor-styles-wrapper selector to match specificity.

Furthermore, adjust specificity for some Button block related styling in the editor for the Twenty Twelve and Twenty Twenty themes.

Merges ​Gutenberg PR 44731 into trunk.

Follow-up to [54358].
Props scruffian, cbravobernal, sabernhardt, audrasjb.
See #56467.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r54497 r54687  
    561561add_action( 'admin_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 );
    562562add_action( 'admin_enqueue_scripts', 'wp_common_block_scripts_and_styles' );
    563 add_action( 'admin_enqueue_scripts', 'wp_enqueue_classic_theme_styles' );
    564563add_action( 'enqueue_block_assets', 'wp_enqueue_registered_block_scripts_and_styles' );
    565564add_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 );
    … …  
    573572add_filter( 'customize_controls_print_styles', 'wp_resource_hints', 1 );
    574573add_action( 'admin_head', 'wp_check_widget_editor_deps' );
     574add_filter( 'block_editor_settings_all', 'wp_add_editor_classic_theme_styles' );
    575575
    576576// Global styles can be enqueued in both the header and the footer. See https://core.trac.wordpress.org/ticket/53494.
Note: See TracChangeset for help on using the changeset viewer.