Skip to content

Commit bf6ebae

Browse files
Space code blocks from the paragraph that follows
Bulma gives a pre a bottom margin only when it is not the last child of its parent. Rouge wraps every fenced block in two divs with the pre as the only child, so the margin never applied and a code block sat flush against the next paragraph, while the paragraph before it kept its own margin above the block. The wrapper now takes the 1em Bulma meant for the pre, so both sides match.
1 parent 43dd681 commit bf6ebae

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

assets/main.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,14 @@ article {
600600
}
601601
}
602602

603+
// Bulma spaces a pre from what follows it, but only when it is not the last
604+
// child. Rouge wraps every fenced block in two divs with the pre as the only
605+
// child, so that rule never fires and a code block sits flush against the
606+
// next paragraph. The wrapper takes the space Bulma meant for the pre.
607+
.content .highlighter-rouge:not(:last-child) {
608+
margin-bottom: 1em;
609+
}
610+
603611
.copyright {
604612
border-top: 1px #848B89 solid;
605613
text-align: center;

0 commit comments

Comments
 (0)