Make WordPress Core

Opened 4 years ago

Closed 6 months ago

#55369 closed defect (bug) (worksforme)

Block styles preview are unstyled since 5.9 if styles are in a global editor styles css

Reported by: johndbb's profile JohnDBB Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.9.1
Component: Editor Keywords: reporter-feedback close
Focuses: Cc:

Description

Hello,

Block stlyes registered with

    wp.blocks.registerBlockStyle( 'acf/featured-news', {
        name: 'featured-news-black',
        label: 'Featured news black',
        isDefault: false,
    } );

Editor stylesheet enqueued with:

function legit_block_editor_styles() {
	wp_enqueue_style( 'legit-editor-styles', get_theme_file_uri( '/style-editor.css' ), false, '11.0', 'all' );
}

add_action( 'enqueue_block_editor_assets', 'legit_block_editor_styles' );

Since WordPress 5.9 the iframe that shows the block styles show them unstyled as doesn't include the style-editor.css

Thank you

Change History (3)

#1 @costdev
4 years ago

  • Component changed from General to Editor
  • Keywords reporter-feedback added

Hi @JohnDBB, welcome to Trac!

Can you please install the latest version of the Gutenberg plugin and if the issue still occurs, please open an issue on the Gutenberg repository to allow the team to investigate this further.

If you do create an issue on the Gutenberg repository, please paste the link into a new comment on this ticket. If you don't plan to create an issue, please let us know. I'll leave this ticket open until then.

#2 @JohnDBB
4 years ago

Thank you @costdev I have installed the latest version of the Gutenberg plugin and it seems that they have completely removed the styles preview! Now there are just buttons with the name of the style on them.

#3 @karmatosed
6 months ago

  • Keywords close added
  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

@JohnDBB the styles preview should appear if you have loaded styles a certain way. My feeling at this point is that it is something to do with your install and the way styles have been set up. Unfortunately due to the amount of time, apologies there and it being unique to your site this makes it a little hard to work out.

What I would recommend is reviewing how you have created the styles, then if you continue to have issues please do report on the Gutenberg repo as requested. For now, I am however going to close this issue as it does seem to be particular to your site and more if anything either a support need or something that we need to diagnose through your site setup first.

Note: See TracTickets for help on using tickets.