Skip to content

Commit

Permalink
Display sidenote numbers outside the sidenote box.
Browse files Browse the repository at this point in the history
This way the sidenote text will not be indented by the number.

I think the correct term for this typographical sytle is "hanging
punctuation" (https://en.wikipedia.org/wiki/Hanging_punctuation).
  • Loading branch information
benjamn committed Aug 5, 2015
1 parent e2ec9aa commit ff56656
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tufte.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,20 @@ sup, sub { vertical-align: baseline;

sub { top: 0.4rem; }

sup.sidenote-number { font-size: 0.9rem;
color: #f00000; }
sup.sidenote-number {
font-size: 0.9rem;
color: #f00000;
}

.sidenote sup.sidenote-number {
position: absolute;
/* 100% refers to the computed width of the number, so this transform
* shifts the number just outside the left edge of the sidenote box,
* with a buffer of 0.25em, no matter how many digits the number has. */
-webkit-transform: translateX(-100%) translateX(-0.25rem);
-ms-transform: translateX(-100%) translateX(-0.25rem);
transform: translateX(-100%) translateX(-0.25rem);
}

p, footer, pre.code { width: 55%; }

Expand Down

0 comments on commit ff56656

Please sign in to comment.