Skip to content

Commit 64cca13

Browse files
committed
nicer style rules for margin around footnote defs
previous implementation used `:not(.fd) + .fd` and `.fd + :not(.fd)`. the latter selector caused many problems: - it doesn't select footnote defs which are last children (this can be easily triggered in a blockquote) - it changes the margin of the next sibling, rather than the footnote def itself, which can also *shrink* margin for elements with big margins (this happens to headings) - because it applies to the next sibling it is also quite hard to override in user styles, since it may apply to any element this commit replaces the latter selector with `:not(:has(+ .fd))`, which fixes all of the mentioned problems.
1 parent 35ed24c commit 64cca13

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/theme/css/general.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,12 @@ sup {
200200
line-height: 0;
201201
}
202202

203-
:not(.footnote-definition) + .footnote-definition,
204-
.footnote-definition + :not(.footnote-definition) {
203+
:not(.footnote-definition) + .footnote-definition {
205204
margin-block-start: 2em;
206205
}
206+
.footnote-definition:not(:has(+ .footnote-definition)) {
207+
margin-block-end: 2em;
208+
}
207209
.footnote-definition {
208210
font-size: 0.9em;
209211
margin: 0.5em 0;

0 commit comments

Comments
 (0)