Apply css backend defined in a css file

Is there a way to apply backend the custom css of a class defined via “Code Snippet” or “Advanced Script”.

If I add to a block the class defined in such a file:

  • frontend → display ok
  • backend → css not displayed

Hello @weedor,

You’ll want to use the add_editor_style() function in the after_setup_theme hook.

There’s a nice answer here: css - How do I make my block-editor styles match my front-end styles? - WordPress Development Stack Exchange


1 Like

Hello @Louis
Thank you for your answer.
This is a good answer for a css written in a separate file (e.g. style.css).
In my case, the css is written in Advanced Script so the above solution doesn’t fit.
I must dig further…
As soon as I find a solution, I will post it.