Skip to content

Fix sidenote alignment in lists.#171

Open
WesleyAC wants to merge 1 commit intoedwardtufte:gh-pagesfrom
WesleyAC:fix-sidenote-list-alignment
Open

Fix sidenote alignment in lists.#171
WesleyAC wants to merge 1 commit intoedwardtufte:gh-pagesfrom
WesleyAC:fix-sidenote-list-alignment

Conversation

@WesleyAC
Copy link
Copy Markdown
Contributor

The 5% difference is due to the difference in the width of the p
elements and the ul/ol elements: 55% and 50%, respectively.

Fixes #170.

The 5% difference is due to the difference in the width of the p
elements and the ul/ol elements: 55% and 50%, respectively.

Fixes edwardtufte#170.
@msyds
Copy link
Copy Markdown

msyds commented Oct 12, 2025

This only works at a very specific window size, since the widths of normal paragraphs still grow at a different rate than the widths of li paragraphs. While less portable, the following heuristic had much better results for me:

diff --git a/tufte.css b/tufte.css
index c9b2528..d052517 100644
--- a/tufte.css
+++ b/tufte.css
@@ -190,7 +190,7 @@ section > table {
 section > dl,
 section > ol,
 section > ul {
-    width: 50%;
+    width: calc(55% - 40px);
     -webkit-padding-start: 5%;
 }

@@ -449,3 +449,9 @@ label.margin-toggle:not(.sidenote-number) {
         width: 100%;
     }
 }
+
+li .sidenote,
+li .margin-note {
+    /* it's so close lol */
+    transform: translateX(4px)
+}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sidenotes on list items are misaligned

2 participants