Make WordPress Core

Changeset 55179


Ignore:
Timestamp:
02/01/2023 08:15:38 PM (4 years ago)
Author:
hellofromTonya
Message:

Editor: Separate content styles for iframe in wp_get_iframed_editor_assets() and wp_default_styles().

This changeset:

  • Removes the 'wp-block-editor' and 'wp-block-library' from the iframe's stylesheet collection (i.e. _wp_get_iframed_editor_assets()).
  • Adds the new 'wp-block-editor-content' for the separate stylesheet to the list of editor ('wp-edit-blocks') dependencies.

Why?

These PHP changes are part of the initiative to:

  • Separate the content styles contained in the block editor package into a separate stylesheet.
  • Avoid loading all block editor styles into the iframe.

References:

Follow-up to [53160], [50761].

Props ellatrix, youknowriad.
Fixes #57550.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-editor.php

    r55147 r55179  
    301301        $script_handles = array();
    302302        $style_handles  = array(
    303                 'wp-block-editor',
    304                 'wp-block-library',
    305303                'wp-edit-blocks',
    306304        );
  • trunk/src/wp-includes/script-loader.php

    r55086 r55179  
    16101610        );
    16111611
     1612        $styles->add(
     1613                'wp-block-editor-content',
     1614                "/wp-includes/css/dist/block-editor/content$suffix.css",
     1615                array()
     1616        );
     1617
    16121618        $wp_edit_blocks_dependencies = array(
    16131619                'wp-components',
    … …  
    16181624                'wp-block-library',
    16191625                'wp-reusable-blocks',
     1626                'wp-block-editor-content',
    16201627        );
    16211628
Note: See TracChangeset for help on using the changeset viewer.