code-block-pro icon indicating copy to clipboard operation
code-block-pro copied to clipboard

Code block has no bottom margin

Open KevinBatdorf opened this issue 1 year ago • 1 comments

So non-block themes will add <pre> margin bottom values that I should respect somehow. I zero these out since block themes will add spacing between blocks, so the <pre> bottom margins there will add double spacing.

I'm not sure how to yet how to solve this, as I want to force override margins on block themes, but allow them on non-block themes.

For now, if you end up here, you can add this CSS (update the margin-bottom value to your preference)

div[class*='code-block-pro']:not(.x) pre {
    margin-bottom: 1rem !important;
}

related: https://wordpress.org/support/topic/after-code-block-paragraph-is-combined-without-any-space/

KevinBatdorf avatar Apr 09 '24 17:04 KevinBatdorf

I saw this issue with my GeneratePress theme, which I understand is a non-block theme.

I added the above CSS using the "Simple CSS" plugin. It worked great for me. Thanks.

georgew509 avatar Apr 09 '24 18:04 georgew509