Skip to content

Commit

Permalink
Merge pull request edwardtufte#165 from mailtokamalnayan/dark-mode
Browse files Browse the repository at this point in the history
Add basic dark mode
  • Loading branch information
daveliepmann authored Aug 2, 2021
2 parents e225f3a + d10bf6a commit 56492a3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tufte.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ body {
counter-reset: sidenote-counter;
}

/* Adds dark mode */
@media (prefers-color-scheme: dark) {
body {
background-color: #151515;
color: #ddd;
}
}

h1 {
font-weight: 400;
margin-top: 4rem;
Expand Down Expand Up @@ -248,6 +256,13 @@ a:link, .tufte-underline, .hover-tufte-underline:hover {
}
}

/* Adds dark mode */
@media (prefers-color-scheme: dark) {
a:link, .tufte-underline, .hover-tufte-underline:hover {
text-shadow: 0.03em 0 #151515, -0.03em 0 #151515, 0 0.03em #151515, 0 -0.03em #151515, 0.06em 0 #151515, -0.06em 0 #151515, 0.09em 0 #151515, -0.09em 0 #151515, 0.12em 0 #151515, -0.12em 0 #151515, 0.15em 0 #151515, -0.15em 0 #151515;
}
}

a:link::selection,
a:link::-moz-selection {
text-shadow: 0.03em 0 #b4d5fe, -0.03em 0 #b4d5fe, 0 0.03em #b4d5fe, 0 -0.03em #b4d5fe, 0.06em 0 #b4d5fe, -0.06em 0 #b4d5fe, 0.09em 0 #b4d5fe, -0.09em 0 #b4d5fe, 0.12em 0 #b4d5fe, -0.12em 0 #b4d5fe, 0.15em 0 #b4d5fe, -0.15em 0 #b4d5fe;
Expand Down

0 comments on commit 56492a3

Please sign in to comment.