Make WordPress Core


Ignore:
Timestamp:
05/25/2021 07:39:30 AM (3 years ago)
Author:
youknowriad
Message:

Block Editor: Load the classic layout stylesheet conditionallty.

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r50981 r50992  
    15111511        'wp-block-library',
    15121512        'wp-reusable-blocks',
    1513 
    1514         // This dependency shouldn't be added for themes with theme.json support
    1515         // It's here for backward compatibility only.
    1516         // A check should be added here when theme.json is backported to Core.
    1517         'wp-editor-classic-layout-styles',
    1518     );
     1513    );
     1514
     1515    // Only load the default layout and margin styles for themes without theme.json file.
     1516    if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) {
     1517        $wp_edit_blocks_dependencies[] = 'wp-editor-classic-layout-styles';
     1518    }
     1519
    15191520    global $editor_styles;
    15201521    if ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) {
Note: See TracChangeset for help on using the changeset viewer.