Commit cbbaad8 h
Changes: 3 files +45 -6
Changes (Side-by-Side)
share/jenny/layout/page.sh +14 -3
cat << _EOF_ | |||
| 635 | them with classes and leaves naming to the theme, which keeps |
635 | them with classes and leaves naming to the theme, which keeps |
| 636 | English out of the parser and lets a theme relabel or hide either |
636 | English out of the parser and lets a theme relabel or hide either |
| 637 | by overriding one rule. Styled to match an h5. */ |
637 | by overriding one rule. Styled to match an h5. */ |
| 638 | /* A quarter of the old 1em. These labels sit above lists that bring |
||
| 639 | their own leading, so a full line of margin on top of that left a |
||
| 640 | visible empty band under the word -- the same thing that made the |
||
| 641 | tag heading look detached from its links. */ |
||
| 638 | ul.fn-list::before, |
642 | ul.fn-list::before, |
| 639 | .citations::before { display: block; font-size: 1em; font-weight: normal; |
643 | .citations::before { display: block; font-size: 1em; font-weight: normal; |
| 640 | text-transform: uppercase; color: var(--text-primary); |
644 | text-transform: uppercase; color: var(--text-primary); |
| 641 | margin: 0 0 1em; } |
||
| 645 | margin: 0 0 .25em; } |
||
| 642 | ul.fn-list { list-style: none; padding: 2em 0 0; margin-top: 2.5em; font-size: .9em; } |
646 | ul.fn-list { list-style: none; padding: 2em 0 0; margin-top: 2.5em; font-size: .9em; } |
| 643 | ul.fn-list::before { content: "Notes"; } |
647 | ul.fn-list::before { content: "Notes"; } |
| 644 | |
648 | |
| 645 | .citations { margin-top: 2.5em; padding-top: 2em; font-size: .9em; } |
649 | .citations { margin-top: 2.5em; padding-top: 2em; font-size: .9em; } |
| 646 | .citations::before { content: "References"; } |
650 | .citations::before { content: "References"; } |
| 647 | .citations hr { display: none; } |
651 | .citations hr { display: none; } |
| 648 | .citations ol { padding-left: 1.4em; } |
||
| 652 | /* The list's own top margin sat under the label as well, so |
||
| 653 | references opened with a 14px band where notes and tags had 4-5. |
||
| 654 | The label supplies the gap for all three now. */ |
||
| 655 | .citations ol { padding-left: 1.4em; margin-top: 0; } |
||
| 649 | .citations li { margin-bottom: .5em; } |
656 | .citations li { margin-bottom: .5em; } |
| 650 | .fn-handle, .fn-text { display: table-cell; } |
657 | .fn-handle, .fn-text { display: table-cell; } |
| 651 | .fn-handle { padding-right: 1ch; } |
658 | .fn-handle { padding-right: 1ch; } |
cat << _EOF_ | |||
| 659 | :has(a) because the div is emitted whether or not the post has tags; |
666 | :has(a) because the div is emitted whether or not the post has tags; |
| 660 | without it every untagged post grew a heading over nothing. */ |
667 | without it every untagged post grew a heading over nothing. */ |
| 661 | .tags { margin-top: 2.5em; padding-top: 1.5em; font-size: .9em; border-top: 2px solid var(--border-lighter); } |
668 | .tags { margin-top: 2.5em; padding-top: 1.5em; font-size: .9em; border-top: 2px solid var(--border-lighter); } |
| 669 | /* No bottom margin: notes and references set 1em because each sits |
||
| 670 | above a list with its own leading, and a row of inline links needs |
||
| 671 | none of that -- it left roughly 22px of empty band under the word. |
||
| 672 | The label's own line box is the gap. */ |
||
| 662 | .tags:has(a)::before { content: "Tags"; display: block; font-size: 1em; |
673 | .tags:has(a)::before { content: "Tags"; display: block; font-size: 1em; |
| 663 | font-weight: normal; text-transform: uppercase; |
674 | font-weight: normal; text-transform: uppercase; |
| 664 | color: var(--text-primary); margin: 0 0 1em; } |
||
| 675 | color: var(--text-primary); } |
||
| 665 | /* MMD metadata pairs are preserved in the output rather than |
676 | /* MMD metadata pairs are preserved in the output rather than |
| 666 | stripped, so nothing the author wrote is lost. The default theme |
677 | stripped, so nothing the author wrote is lost. The default theme |
| 667 | hides them: the title comes from the heading and tags render |
678 | hides them: the title comes from the heading and tags render |
share/jenny/layout/post.sh +14 -3
cat << _EOF_ | |||
| 399 | them with classes and leaves naming to the theme, which keeps |
399 | them with classes and leaves naming to the theme, which keeps |
| 400 | English out of the parser and lets a theme relabel or hide either |
400 | English out of the parser and lets a theme relabel or hide either |
| 401 | by overriding one rule. Styled to match an h5. */ |
401 | by overriding one rule. Styled to match an h5. */ |
| 402 | /* A quarter of the old 1em. These labels sit above lists that bring |
||
| 403 | their own leading, so a full line of margin on top of that left a |
||
| 404 | visible empty band under the word -- the same thing that made the |
||
| 405 | tag heading look detached from its links. */ |
||
| 402 | ul.fn-list::before, |
406 | ul.fn-list::before, |
| 403 | .citations::before { display: block; font-size: 1em; font-weight: normal; |
407 | .citations::before { display: block; font-size: 1em; font-weight: normal; |
| 404 | text-transform: uppercase; color: var(--text-primary); |
408 | text-transform: uppercase; color: var(--text-primary); |
| 405 | margin: 0 0 1em; } |
||
| 409 | margin: 0 0 .25em; } |
||
| 406 | ul.fn-list { list-style: none; padding: 2em 0 0; margin-top: 2.5em; font-size: .9em; } |
410 | ul.fn-list { list-style: none; padding: 2em 0 0; margin-top: 2.5em; font-size: .9em; } |
| 407 | ul.fn-list::before { content: "Notes"; } |
411 | ul.fn-list::before { content: "Notes"; } |
| 408 | |
412 | |
| 409 | .citations { margin-top: 2.5em; padding-top: 2em; font-size: .9em; } |
413 | .citations { margin-top: 2.5em; padding-top: 2em; font-size: .9em; } |
| 410 | .citations::before { content: "References"; } |
414 | .citations::before { content: "References"; } |
| 411 | .citations hr { display: none; } |
415 | .citations hr { display: none; } |
| 412 | .citations ol { padding-left: 1.4em; } |
||
| 416 | /* The list's own top margin sat under the label as well, so |
||
| 417 | references opened with a 14px band where notes and tags had 4-5. |
||
| 418 | The label supplies the gap for all three now. */ |
||
| 419 | .citations ol { padding-left: 1.4em; margin-top: 0; } |
||
| 413 | .citations li { margin-bottom: .5em; } |
420 | .citations li { margin-bottom: .5em; } |
| 414 | .fn-handle, .fn-text { display: table-cell; } |
421 | .fn-handle, .fn-text { display: table-cell; } |
| 415 | .fn-handle { padding-right: 1ch; } |
422 | .fn-handle { padding-right: 1ch; } |
cat << _EOF_ | |||
| 423 | :has(a) because the div is emitted whether or not the post has tags; |
430 | :has(a) because the div is emitted whether or not the post has tags; |
| 424 | without it every untagged post grew a heading over nothing. */ |
431 | without it every untagged post grew a heading over nothing. */ |
| 425 | .tags { margin-top: 2.5em; padding-top: 1.5em; font-size: .9em; border-top: 2px solid var(--border-lighter); } |
432 | .tags { margin-top: 2.5em; padding-top: 1.5em; font-size: .9em; border-top: 2px solid var(--border-lighter); } |
| 433 | /* No bottom margin: notes and references set 1em because each sits |
||
| 434 | above a list with its own leading, and a row of inline links needs |
||
| 435 | none of that -- it left roughly 22px of empty band under the word. |
||
| 436 | The label's own line box is the gap. */ |
||
| 426 | .tags:has(a)::before { content: "Tags"; display: block; font-size: 1em; |
437 | .tags:has(a)::before { content: "Tags"; display: block; font-size: 1em; |
| 427 | font-weight: normal; text-transform: uppercase; |
438 | font-weight: normal; text-transform: uppercase; |
| 428 | color: var(--text-primary); margin: 0 0 1em; } |
||
| 439 | color: var(--text-primary); } |
||
| 429 | /* MMD metadata pairs are preserved in the output rather than |
440 | /* MMD metadata pairs are preserved in the output rather than |
| 430 | stripped, so nothing the author wrote is lost. The default theme |
441 | stripped, so nothing the author wrote is lost. The default theme |
| 431 | hides them: the title comes from the heading and tags render |
442 | hides them: the title comes from the heading and tags render |
test/regressions.sh +17 -0
assert_file_contains "$tl_post" ':has(a)::before' | |||
| 893 | it "pages carry the same rule" |
893 | it "pages carry the same rule" |
| 894 | assert_file_contains "$tl/.dist/plain.html" '.tags:has(a)::before { content: "Tags";' |
894 | assert_file_contains "$tl/.dist/plain.html" '.tags:has(a)::before { content: "Tags";' |
| 895 | |
895 | |
| 896 | it "a section heading sits close to what it labels" |
||
| 897 | # 1em of margin on top of a list's own leading left a visible empty band under |
||
| 898 | # the word -- about 22px under the tag row. The three headings now open their |
||
| 899 | # content at 4-5px apiece. |
||
| 900 | assert_file_contains "$tl_post" 'margin: 0 0 .25em; }' |
||
| 901 | |
||
| 902 | it "the tag label leans on its own line box for the gap" |
||
| 903 | # A row of inline links has no list leading to account for, so it needs no |
||
| 904 | # bottom margin at all. |
||
| 905 | tag_rule=$("$SED" -n '/\.tags:has(a)::before/,/}/p' "$tl_post") |
||
| 906 | assert_not_contains "$tag_rule" 'margin' |
||
| 907 | |
||
| 908 | it "the references list adds no second gap" |
||
| 909 | # The <ol> brought its own top margin, so references opened 14px below its |
||
| 910 | # heading where notes and tags opened at 4. |
||
| 911 | assert_file_contains "$tl_post" '.citations ol { padding-left: 1.4em; margin-top: 0; }' |
||
| 912 | |
||
| 896 | it "the build is clean" |
913 | it "the build is clean" |
| 897 | assert_eq "$stderr_output" "" |
914 | assert_eq "$stderr_output" "" |
| 898 | |
915 | |
Raw
commit cbbaad87330b1ba428cb1a17881408856a067642
Author: Pat Ambrosio <cp.ambrosio@gmail.com>
Date: Wed Aug 26 14:01:53 2026 +0800
Close the gap under the section headings
The tag heading sat about 22px above its links. It had copied "margin:
0 0 1em" from the notes and references labels, but those sit above lists
that bring their own leading -- over a single row of inline links the same
margin was a visible empty band.
The tag label now takes no bottom margin at all; its own line box is the
gap. Notes and references drop from 1em to .25em for the same reason, and
the citations list loses the top margin that was stacking underneath its
heading -- references opened 14px below its label where notes opened at 4.
All three now open their content at 4-5px, so REFERENCES, NOTES and TAGS
read as one family rather than three spacings.
Tests pin each of the three values. Checked by mutation -- restoring the
1em margin, restoring the citations list gap -- both caught.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WnSAstgnDYdKPwLGv1YZE5
diff --git a/share/jenny/layout/page.sh b/share/jenny/layout/page.sh
index 9f48148..e079730 100755
--- a/share/jenny/layout/page.sh
+++ b/share/jenny/layout/page.sh
@@ -635,17 +635,24 @@ cat << _EOF_
them with classes and leaves naming to the theme, which keeps
English out of the parser and lets a theme relabel or hide either
by overriding one rule. Styled to match an h5. */
+ /* A quarter of the old 1em. These labels sit above lists that bring
+ their own leading, so a full line of margin on top of that left a
+ visible empty band under the word -- the same thing that made the
+ tag heading look detached from its links. */
ul.fn-list::before,
.citations::before { display: block; font-size: 1em; font-weight: normal;
text-transform: uppercase; color: var(--text-primary);
- margin: 0 0 1em; }
+ margin: 0 0 .25em; }
ul.fn-list { list-style: none; padding: 2em 0 0; margin-top: 2.5em; font-size: .9em; }
ul.fn-list::before { content: "Notes"; }
.citations { margin-top: 2.5em; padding-top: 2em; font-size: .9em; }
.citations::before { content: "References"; }
.citations hr { display: none; }
- .citations ol { padding-left: 1.4em; }
+ /* The list's own top margin sat under the label as well, so
+ references opened with a 14px band where notes and tags had 4-5.
+ The label supplies the gap for all three now. */
+ .citations ol { padding-left: 1.4em; margin-top: 0; }
.citations li { margin-bottom: .5em; }
.fn-handle, .fn-text { display: table-cell; }
.fn-handle { padding-right: 1ch; }
@@ -659,9 +666,13 @@ cat << _EOF_
:has(a) because the div is emitted whether or not the post has tags;
without it every untagged post grew a heading over nothing. */
.tags { margin-top: 2.5em; padding-top: 1.5em; font-size: .9em; border-top: 2px solid var(--border-lighter); }
+ /* No bottom margin: notes and references set 1em because each sits
+ above a list with its own leading, and a row of inline links needs
+ none of that -- it left roughly 22px of empty band under the word.
+ The label's own line box is the gap. */
.tags:has(a)::before { content: "Tags"; display: block; font-size: 1em;
font-weight: normal; text-transform: uppercase;
- color: var(--text-primary); margin: 0 0 1em; }
+ color: var(--text-primary); }
/* MMD metadata pairs are preserved in the output rather than
stripped, so nothing the author wrote is lost. The default theme
hides them: the title comes from the heading and tags render
diff --git a/share/jenny/layout/post.sh b/share/jenny/layout/post.sh
index fdf9d21..46bd819 100755
--- a/share/jenny/layout/post.sh
+++ b/share/jenny/layout/post.sh
@@ -399,17 +399,24 @@ cat << _EOF_
them with classes and leaves naming to the theme, which keeps
English out of the parser and lets a theme relabel or hide either
by overriding one rule. Styled to match an h5. */
+ /* A quarter of the old 1em. These labels sit above lists that bring
+ their own leading, so a full line of margin on top of that left a
+ visible empty band under the word -- the same thing that made the
+ tag heading look detached from its links. */
ul.fn-list::before,
.citations::before { display: block; font-size: 1em; font-weight: normal;
text-transform: uppercase; color: var(--text-primary);
- margin: 0 0 1em; }
+ margin: 0 0 .25em; }
ul.fn-list { list-style: none; padding: 2em 0 0; margin-top: 2.5em; font-size: .9em; }
ul.fn-list::before { content: "Notes"; }
.citations { margin-top: 2.5em; padding-top: 2em; font-size: .9em; }
.citations::before { content: "References"; }
.citations hr { display: none; }
- .citations ol { padding-left: 1.4em; }
+ /* The list's own top margin sat under the label as well, so
+ references opened with a 14px band where notes and tags had 4-5.
+ The label supplies the gap for all three now. */
+ .citations ol { padding-left: 1.4em; margin-top: 0; }
.citations li { margin-bottom: .5em; }
.fn-handle, .fn-text { display: table-cell; }
.fn-handle { padding-right: 1ch; }
@@ -423,9 +430,13 @@ cat << _EOF_
:has(a) because the div is emitted whether or not the post has tags;
without it every untagged post grew a heading over nothing. */
.tags { margin-top: 2.5em; padding-top: 1.5em; font-size: .9em; border-top: 2px solid var(--border-lighter); }
+ /* No bottom margin: notes and references set 1em because each sits
+ above a list with its own leading, and a row of inline links needs
+ none of that -- it left roughly 22px of empty band under the word.
+ The label's own line box is the gap. */
.tags:has(a)::before { content: "Tags"; display: block; font-size: 1em;
font-weight: normal; text-transform: uppercase;
- color: var(--text-primary); margin: 0 0 1em; }
+ color: var(--text-primary); }
/* MMD metadata pairs are preserved in the output rather than
stripped, so nothing the author wrote is lost. The default theme
hides them: the title comes from the heading and tags render
diff --git a/test/regressions.sh b/test/regressions.sh
index 668f21f..f154f68 100755
--- a/test/regressions.sh
+++ b/test/regressions.sh
@@ -893,6 +893,23 @@ assert_file_contains "$tl_post" ':has(a)::before'
it "pages carry the same rule"
assert_file_contains "$tl/.dist/plain.html" '.tags:has(a)::before { content: "Tags";'
+it "a section heading sits close to what it labels"
+# 1em of margin on top of a list's own leading left a visible empty band under
+# the word -- about 22px under the tag row. The three headings now open their
+# content at 4-5px apiece.
+assert_file_contains "$tl_post" 'margin: 0 0 .25em; }'
+
+it "the tag label leans on its own line box for the gap"
+# A row of inline links has no list leading to account for, so it needs no
+# bottom margin at all.
+tag_rule=$("$SED" -n '/\.tags:has(a)::before/,/}/p' "$tl_post")
+assert_not_contains "$tag_rule" 'margin'
+
+it "the references list adds no second gap"
+# The <ol> brought its own top margin, so references opened 14px below its
+# heading where notes and tags opened at 4.
+assert_file_contains "$tl_post" '.citations ol { padding-left: 1.4em; margin-top: 0; }'
+
it "the build is clean"
assert_eq "$stderr_output" ""