[Resolved] Custom Styles Not Showing In Gutenberg

Home Forums Support [Resolved] Custom Styles Not Showing In Gutenberg

Home Forums Support Custom Styles Not Showing In Gutenberg

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #808523
    Simon

    Hey guys,

    Just wanted to know if there is a way to get the custom styles I have in “additional css” to show up in the Gutenberg editor screen? like if I apply a class to text in a span, with a different color.

    Also I have been using Gutenberg columns with a width of “1” sort of as a section, on the front end it shows up fine, but in the editor it only fills half the screen. It’s really annoying but not essential to fix. not sure if thats a Gutenberg thing or a Generatepress thing.

    Thanks in advance for your help.

    #808814
    Tom
    Lead Developer
    Lead Developer

    Hey Simon,

    If you’re using a child theme, you can enqueue your own CSS to the editor itself. The only issue is you have to deal with CSS specificity.

    For example, if you add an editor.css file in your child theme, you can then add this function to add it to the editor:

    add_action( 'enqueue_block_editor_assets', function() {
        wp_enqueue_style( 'my-block-editor-styles', get_stylesheet_directory_uri() . "/editor.css", false,'1.0', 'all' );
    } );

    Let me know if you need more info πŸ™‚

    #809135
    Simon

    Hey Tom,

    Thanks so much for your help with this. I don’t use a child theme, so I guess I’ll just live with it for now. Maybe one day they will update it to work or something. πŸ™‚

    Cheers,
    Simon

    #809480
    Tom
    Lead Developer
    Lead Developer

    No problem! πŸ™‚

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.