Skip to content

Commit

Permalink
nicer style rules for margin around footnote defs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
WaffleLapkin committed Jan 15, 2025
1 parent 35ed24c commit 1bffe0f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/theme/css/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,12 @@ sup {
line-height: 0;
}

:not(.footnote-definition) + .footnote-definition,
.footnote-definition + :not(.footnote-definition) {
.footnote-definition:first-of-type {
margin-block-start: 2em;
}
.footnote-definition:last-of-type {
margin-block-end: 2em;
}
.footnote-definition {
font-size: 0.9em;
margin: 0.5em 0;
Expand Down

0 comments on commit 1bffe0f

Please sign in to comment.