[wp-trac] [WordPress Trac] #58605: Core block editor styles registered with frontend stylesheet URL instead of editor stylesheet URL

WordPress Trac noreply at wordpress.org
Thu Jun 22 20:45:39 UTC 2023


#58605: Core block editor styles registered with frontend stylesheet URL instead of
editor stylesheet URL
--------------------------+-------------------------
 Reporter:  flixos90      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  6.3
Component:  Editor        |    Version:
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:                |
--------------------------+-------------------------
 While taking a closer look at the `register_block_style_handle()` function
 for #58528, I noticed that all core block editor style handles (i.e. `wp-
 block-{$block_name}-editor`) are registered pointing to the frontend
 stylesheet (`style.css`) rather than the editor stylesheet (`editor.css`).
 This happens because the `style.css` file name is hard-coded in the
 function regardless of whether the `style` or `editorStyle` is being
 registered.

 Effectively, right now every pair of `wp-block-{$block_name}` and `wp-
 block-{$block_name}-editor` handles uses the same stylesheet file, which
 looks wrong given that several of them have dedicated editor stylesheets.

 Looking at the Gutenberg plugin, it appears to work correctly there since
 Gutenberg has a dedicated logic path for editor styles, see
 https://github.com/WordPress/gutenberg/blob/3a419b840da0117ea05925c994861919acbe0c3d/lib/blocks.php#L277.
 So this is specifically a WordPress core bug that we should fix.

 Adding this to the 6.3 milestone for consideration.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58605>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list