Commit e52fbc5 h
Changes: 3 files +48 -4
Changes (Side-by-Side)
share/jenny/layout/page.sh +16 -2
cat << _EOF_ | |||
| 923 | /* The passage a permalink pointed at, marked rather than animated: a |
923 | /* The passage a permalink pointed at, marked rather than animated: a |
| 924 | reader arriving mid-document needs to see which paragraph was meant, |
924 | reader arriving mid-document needs to see which paragraph was meant, |
| 925 | and a flash they might miss does not tell them. */ |
925 | and a flash they might miss does not tell them. */ |
| 926 | /* Padding rather than a spread shadow. The background paints the |
||
| 927 | box and the shadow painted beyond it, and where the two met they |
||
| 928 | antialiased against each other -- a faint darker seam along the |
||
| 929 | inside of the bottom edge. One padded box paints once and has no |
||
| 930 | seam. Negative margins keep the text where it was, so marking a |
||
| 931 | passage does not move it. */ |
||
| 926 | .target-flash { |
932 | .target-flash { |
| 927 | background-color: var(--bg-secondary); |
933 | background-color: var(--bg-secondary); |
| 928 | box-shadow: 0 0 0 .4em var(--bg-secondary); |
||
| 929 | border-radius: 2px; |
934 | border-radius: 2px; |
| 935 | padding: .4em .5em; |
||
| 936 | margin-left: -.5em; |
||
| 937 | margin-right: -.5em; |
||
| 930 | } |
938 | } |
| 931 | /* Every heading is body size, which keeps the page even but leaves a |
939 | /* Every heading is body size, which keeps the page even but leaves a |
| 932 | section heading reading as a stray line of capitals: uppercase alone |
940 | section heading reading as a stray line of capitals: uppercase alone |
cat << _EOF_ | |||
| 994 | .citations ol { padding-left: 1.4em; margin-top: 0; } |
1002 | .citations ol { padding-left: 1.4em; margin-top: 0; } |
| 995 | .citations li { margin-bottom: .5em; } |
1003 | .citations li { margin-bottom: .5em; } |
| 996 | .fn-handle, .fn-text { display: table-cell; } |
1004 | .fn-handle, .fn-text { display: table-cell; } |
| 997 | .fn-handle { padding-right: 1ch; } |
||
| 1005 | /* Each note is its own table, so the label column is only as wide as |
||
| 1006 | that note's own label: "1:" gave 20px and "code-commodity:" far |
||
| 1007 | more, and the text of every note started at a different place down |
||
| 1008 | the list. A minimum holds the column steady for the short labels -- |
||
| 1009 | which are most of them -- while a long one is still free to push |
||
| 1010 | past it rather than wrap. */ |
||
| 1011 | .fn-handle { padding-right: 1ch; min-width: 4ch; } |
||
| 998 | .fnref { line-height: 0 } |
1012 | .fnref { line-height: 0 } |
| 999 | /* Labelled the way notes and references are: a row of bare links under |
1013 | /* Labelled the way notes and references are: a row of bare links under |
| 1000 | a rule read as unexplained next to two sections that name |
1014 | a rule read as unexplained next to two sections that name |
share/jenny/layout/post.sh +16 -2
cat << _EOF_ | |||
| 744 | /* The passage a permalink pointed at, marked rather than animated: a |
744 | /* The passage a permalink pointed at, marked rather than animated: a |
| 745 | reader arriving mid-document needs to see which paragraph was meant, |
745 | reader arriving mid-document needs to see which paragraph was meant, |
| 746 | and a flash they might miss does not tell them. */ |
746 | and a flash they might miss does not tell them. */ |
| 747 | /* Padding rather than a spread shadow. The background paints the |
||
| 748 | box and the shadow painted beyond it, and where the two met they |
||
| 749 | antialiased against each other -- a faint darker seam along the |
||
| 750 | inside of the bottom edge. One padded box paints once and has no |
||
| 751 | seam. Negative margins keep the text where it was, so marking a |
||
| 752 | passage does not move it. */ |
||
| 747 | .target-flash { |
753 | .target-flash { |
| 748 | background-color: var(--bg-secondary); |
754 | background-color: var(--bg-secondary); |
| 749 | box-shadow: 0 0 0 .4em var(--bg-secondary); |
||
| 750 | border-radius: 2px; |
755 | border-radius: 2px; |
| 756 | padding: .4em .5em; |
||
| 757 | margin-left: -.5em; |
||
| 758 | margin-right: -.5em; |
||
| 751 | } |
759 | } |
| 752 | /* Every heading is body size, which keeps the page even but leaves a |
760 | /* Every heading is body size, which keeps the page even but leaves a |
| 753 | section heading reading as a stray line of capitals: uppercase alone |
761 | section heading reading as a stray line of capitals: uppercase alone |
cat << _EOF_ | |||
| 815 | .citations ol { padding-left: 1.4em; margin-top: 0; } |
823 | .citations ol { padding-left: 1.4em; margin-top: 0; } |
| 816 | .citations li { margin-bottom: .5em; } |
824 | .citations li { margin-bottom: .5em; } |
| 817 | .fn-handle, .fn-text { display: table-cell; } |
825 | .fn-handle, .fn-text { display: table-cell; } |
| 818 | .fn-handle { padding-right: 1ch; } |
||
| 826 | /* Each note is its own table, so the label column is only as wide as |
||
| 827 | that note's own label: "1:" gave 20px and "code-commodity:" far |
||
| 828 | more, and the text of every note started at a different place down |
||
| 829 | the list. A minimum holds the column steady for the short labels -- |
||
| 830 | which are most of them -- while a long one is still free to push |
||
| 831 | past it rather than wrap. */ |
||
| 832 | .fn-handle { padding-right: 1ch; min-width: 4ch; } |
||
| 819 | .fnref { line-height: 0 } |
833 | .fnref { line-height: 0 } |
| 820 | /* Labelled the way notes and references are: a row of bare links under |
834 | /* Labelled the way notes and references are: a row of bare links under |
| 821 | a rule read as unexplained next to two sections that name |
835 | a rule read as unexplained next to two sections that name |
test/regressions.sh +16 -0
it "the mark is hidden until the passage is hovered or the mark focused" | |||
| 1453 | assert_file_contains "$dg/.dist/chart.html" '.anchor-link:focus { opacity: 1; }' |
1453 | assert_file_contains "$dg/.dist/chart.html" '.anchor-link:focus { opacity: 1; }' |
| 1454 | assert_file_contains "$dg/.dist/chart.html" '@media (hover: none) { .anchor-link { display: none; } }' |
1454 | assert_file_contains "$dg/.dist/chart.html" '@media (hover: none) { .anchor-link { display: none; } }' |
| 1455 | |
1455 | |
| 1456 | it "the marked passage paints as one box" |
||
| 1457 | # A spread box-shadow in the same colour as the background painted a second |
||
| 1458 | # region abutting the first, and the two antialiased against each other -- a |
||
| 1459 | # faint darker seam along the inside of the bottom edge. Padding paints once. |
||
| 1460 | # Negative margins hold the text where it was, so marking does not move it. |
||
| 1461 | assert_file_contains "$dg/.dist/chart.html" 'padding: .4em .5em;' |
||
| 1462 | assert_file_not_contains "$dg/.dist/chart.html" 'box-shadow: 0 0 0 .4em var(--bg-secondary);' |
||
| 1463 | |
||
| 1464 | it "the note label column has a floor" |
||
| 1465 | # Each note is its own table, so the label column was only as wide as that |
||
| 1466 | # note's own label: "1:" measured 20px and a named note far more, and the text |
||
| 1467 | # of every note began at a different place down the list. The minimum steadies |
||
| 1468 | # the short labels, which are most of them; a long one still pushes past it |
||
| 1469 | # rather than wrapping. |
||
| 1470 | assert_file_contains "$dg/.dist/chart.html" '.fn-handle { padding-right: 1ch; min-width: 4ch; }' |
||
| 1471 | |
||
| 1456 | it "a linked passage is centred, not pinned to the top" |
1472 | it "a linked passage is centred, not pinned to the top" |
| 1457 | # A passage flush with the top edge has no text above it, so nothing shows |
1473 | # A passage flush with the top edge has no text above it, so nothing shows |
| 1458 | # what it follows from. Centred, it arrives with its own context either side. |
1474 | # what it follows from. Centred, it arrives with its own context either side. |
Raw
commit e52fbc547b53de64bff94f39122430a3e659b8bd
Author: Pat Ambrosio <cp.ambrosio@gmail.com>
Date: Tue Sep 1 14:20:03 2026 +0800
Fix a seam on the marked passage, and floor the note label column
The deep-link highlight painted its background on the box and a
box-shadow of the same colour spread beyond it. Two separately painted
regions meeting at the box edge antialias against each other, which read
as a faint darker line along the inside of the bottom edge. Padding
paints the same shape once and has no seam; negative margins keep the
text where it was, so marking a passage does not move it.
The note label column had no minimum. Each note is its own table, so the
column was only ever as wide as that note's own label -- "1:" measured
20px against far more for a named one -- and the text of every note began
at a different place down the list. A 4ch floor steadies the short
labels, which are most of them, while a long one still pushes past it
rather than wrapping. It cannot align long labels with short ones: that
would need the list to be one grid rather than a table per item.
diff --git a/share/jenny/layout/page.sh b/share/jenny/layout/page.sh
index 5a026f9..f3fb1b2 100755
--- a/share/jenny/layout/page.sh
+++ b/share/jenny/layout/page.sh
@@ -923,10 +923,18 @@ cat << _EOF_
/* The passage a permalink pointed at, marked rather than animated: a
reader arriving mid-document needs to see which paragraph was meant,
and a flash they might miss does not tell them. */
+ /* Padding rather than a spread shadow. The background paints the
+ box and the shadow painted beyond it, and where the two met they
+ antialiased against each other -- a faint darker seam along the
+ inside of the bottom edge. One padded box paints once and has no
+ seam. Negative margins keep the text where it was, so marking a
+ passage does not move it. */
.target-flash {
background-color: var(--bg-secondary);
- box-shadow: 0 0 0 .4em var(--bg-secondary);
border-radius: 2px;
+ padding: .4em .5em;
+ margin-left: -.5em;
+ margin-right: -.5em;
}
/* Every heading is body size, which keeps the page even but leaves a
section heading reading as a stray line of capitals: uppercase alone
@@ -994,7 +1002,13 @@ cat << _EOF_
.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; }
+ /* Each note is its own table, so the label column is only as wide as
+ that note's own label: "1:" gave 20px and "code-commodity:" far
+ more, and the text of every note started at a different place down
+ the list. A minimum holds the column steady for the short labels --
+ which are most of them -- while a long one is still free to push
+ past it rather than wrap. */
+ .fn-handle { padding-right: 1ch; min-width: 4ch; }
.fnref { line-height: 0 }
/* Labelled the way notes and references are: a row of bare links under
a rule read as unexplained next to two sections that name
diff --git a/share/jenny/layout/post.sh b/share/jenny/layout/post.sh
index 90b6d90..42d9f1e 100755
--- a/share/jenny/layout/post.sh
+++ b/share/jenny/layout/post.sh
@@ -744,10 +744,18 @@ cat << _EOF_
/* The passage a permalink pointed at, marked rather than animated: a
reader arriving mid-document needs to see which paragraph was meant,
and a flash they might miss does not tell them. */
+ /* Padding rather than a spread shadow. The background paints the
+ box and the shadow painted beyond it, and where the two met they
+ antialiased against each other -- a faint darker seam along the
+ inside of the bottom edge. One padded box paints once and has no
+ seam. Negative margins keep the text where it was, so marking a
+ passage does not move it. */
.target-flash {
background-color: var(--bg-secondary);
- box-shadow: 0 0 0 .4em var(--bg-secondary);
border-radius: 2px;
+ padding: .4em .5em;
+ margin-left: -.5em;
+ margin-right: -.5em;
}
/* Every heading is body size, which keeps the page even but leaves a
section heading reading as a stray line of capitals: uppercase alone
@@ -815,7 +823,13 @@ cat << _EOF_
.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; }
+ /* Each note is its own table, so the label column is only as wide as
+ that note's own label: "1:" gave 20px and "code-commodity:" far
+ more, and the text of every note started at a different place down
+ the list. A minimum holds the column steady for the short labels --
+ which are most of them -- while a long one is still free to push
+ past it rather than wrap. */
+ .fn-handle { padding-right: 1ch; min-width: 4ch; }
.fnref { line-height: 0 }
/* Labelled the way notes and references are: a row of bare links under
a rule read as unexplained next to two sections that name
diff --git a/test/regressions.sh b/test/regressions.sh
index 2648ca9..fc0eb81 100755
--- a/test/regressions.sh
+++ b/test/regressions.sh
@@ -1453,6 +1453,22 @@ it "the mark is hidden until the passage is hovered or the mark focused"
assert_file_contains "$dg/.dist/chart.html" '.anchor-link:focus { opacity: 1; }'
assert_file_contains "$dg/.dist/chart.html" '@media (hover: none) { .anchor-link { display: none; } }'
+it "the marked passage paints as one box"
+# A spread box-shadow in the same colour as the background painted a second
+# region abutting the first, and the two antialiased against each other -- a
+# faint darker seam along the inside of the bottom edge. Padding paints once.
+# Negative margins hold the text where it was, so marking does not move it.
+assert_file_contains "$dg/.dist/chart.html" 'padding: .4em .5em;'
+assert_file_not_contains "$dg/.dist/chart.html" 'box-shadow: 0 0 0 .4em var(--bg-secondary);'
+
+it "the note label column has a floor"
+# Each note is its own table, so the label column was only as wide as that
+# note's own label: "1:" measured 20px and a named note far more, and the text
+# of every note began at a different place down the list. The minimum steadies
+# the short labels, which are most of them; a long one still pushes past it
+# rather than wrapping.
+assert_file_contains "$dg/.dist/chart.html" '.fn-handle { padding-right: 1ch; min-width: 4ch; }'
+
it "a linked passage is centred, not pinned to the top"
# A passage flush with the top edge has no text above it, so nothing shows
# what it follows from. Centred, it arrives with its own context either side.