Skip to content

Commit

Permalink
Block Editor: Load the classic layout stylesheet conditionallty.
Browse files Browse the repository at this point in the history
Historically, the block editor has been opinionated about the size of the canvas and the alignments.
Themes with theme.json will have to define a "layout" in their settings and the classic stylesheet won't be loaded anymore for this.

Props nosolosw.
See #53175.

Built from https://develop.svn.wordpress.org/trunk@50992


git-svn-id: http://core.svn.wordpress.org/trunk@50601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
youknowriad committed May 25, 2021
1 parent dd68caa commit 2b7ad8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -1510,12 +1510,13 @@ function wp_default_styles( $styles ) {
'wp-reset-editor-styles',
'wp-block-library',
'wp-reusable-blocks',

// This dependency shouldn't be added for themes with theme.json support
// It's here for backward compatibility only.
// A check should be added here when theme.json is backported to Core.
'wp-editor-classic-layout-styles',
);

// Only load the default layout and margin styles for themes without theme.json file.
if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) {
$wp_edit_blocks_dependencies[] = 'wp-editor-classic-layout-styles';
}

global $editor_styles;
if ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) {
// Include opinionated block styles if no $editor_styles are declared, so the editor never appears broken.
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-alpha-50991';
$wp_version = '5.8-alpha-50992';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit 2b7ad8a

Please sign in to comment.