KevinBatdorf / code-block-pro

A Gutenberg code block with syntax highlighting powered by VS Code
https://code-block-pro.com
132 stars 10 forks source link

Code block has no bottom margin #314

Open KevinBatdorf opened 7 months ago

KevinBatdorf commented 7 months ago

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/

georgew509 commented 7 months ago

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.