Skip to content

Embedding Editor Style (add_editor_style) during development #1171

Open
@lnilya

Description

@lnilya

Hi there,

I am experimenting with WPack.io and so far love the speed, it solved a lot of my build chain issues I had previously! thanks for this amazing work.

My question is what would be the best workflow to use editor-styles during development (because CSS files are not generated and Wordpress wants a CSS file).

Normally I would just embed my main CSS file via something like this: add_editor_style( 'assets/css/theme.css' ); but I can only do this when the theme/plugin was actually built, since only then I have the files.

Right now I am just adding a new entry point that embeds the css file via the Wordpress 'enqueue_block_editor_assets' hook. This way I get the style in the backend in the block editor only, however the styles of course apply to the whole site, that means all the Wordpress buttons and h1/h2 tags etc get styled as well, not only the ones inside the block editor as it would be when using add_editor_style.

Does the WPackio\Enqueue class have some sort of functionality to enable this? Or are there any workarounds for this? Getting hot reloading in the Wordpress block editor would be absolutely stellar!

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions