• Resolved ashuga

    (@ashuga)


    Hi there. After updating to WP 6.3, I noticed that image blocks are missing the added block spacing above them. Every other block has block spacing above them. The missing block spacing on the image only happens on the front end, in the editor it looks normal.

    The culprit is the following style, included with a <style> tag:

    <style id='wp-block-image-theme-inline-css'>
       .wp-block-image {
          margin: 0 0 1em;
       }
    </style>

    How is this style being added? It is not from my stylesheets, or specified in my theme.json… I think. I noticed that the problem goes away if I remove blockGap: true from my spacing settings. But then, blocks that can use block spacing no longer have the option in their style settings… so removing blockGap: true is not a solution for me.

    Has anyone else run into this? Where is the wp-block-image-theme-inline-css coming from, how do I remove it?

    • This topic was modified 1 year, 3 months ago by ashuga.
    • This topic was modified 1 year, 3 months ago by ashuga.
    • This topic was modified 1 year, 3 months ago by ashuga.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator jordesign

    (@jordesign)

    Hi @ashuga – the default spacing is something that could also be affected by the theme you’re using. It’s possible that updates in 6.3 affected the way they relate to one another.

    Could you please try switching to a default theme like TwentyTwentyThree and see if you still have the same issue?

    Thread Starter ashuga

    (@ashuga)

    Hi @jordesign – thanks for your response. I switched to TwentyTwentyThree and the same issue does not occur there. I am comparing it to my theme that I’m having trouble with, but still haven’t tracked down the issue.

    Out of curiosity, I also tried TwentyTwentyTwo. The same spacing issue above images also happens there. I’m not sure why, but maybe someone more familiar with that theme might know.

    Thread Starter ashuga

    (@ashuga)

    I figured it out! Posting here in case anyone else is having issues. I was including this in functions.php:

    add_theme_support('wp-block-styles');

    Which includes wp-includes/css/dist/block-library/theme.css in my theme, which I don’t really need anymore.

    Moderator jordesign

    (@jordesign)

    @ashuga That’s great news – and thanks for posting the solution as well for all those in the future!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Theme.json: image block missing block spacing on front end’ is closed to new replies.