Skip to content

Commit 1bffe0f

Browse files
committed
nicer style rules for margin around footnote defs
previous implementation used `:not(.fd) + .fd` and `.fd + :not(.fd)`, which is not only quite awkward, but the latter rule also applies padding to an arbitrary element (`:not(.fd)`), which makes it very hard to override in user styles. this commit replaces these awkward rules with much nicer `.fd:{first,last}-of-type`, which also describe exactly our usecase.
1 parent 35ed24c commit 1bffe0f

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+
.footnote-definition:first-of-type {
205204
margin-block-start: 2em;
206205
}
206+
.footnote-definition:last-of-type {
207+
margin-block-end: 2em;
208+
}
207209
.footnote-definition {
208210
font-size: 0.9em;
209211
margin: 0.5em 0;

0 commit comments

Comments
 (0)