Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code block has no bottom margin #314

Open
KevinBatdorf opened this issue Apr 9, 2024 · 1 comment
Open

Code block has no bottom margin #314

KevinBatdorf opened this issue Apr 9, 2024 · 1 comment

Comments

@KevinBatdorf
Copy link
Owner

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants