Skip to content

Commit

Permalink
style: use a monospace font that loads faster
Browse files Browse the repository at this point in the history
Iosevka is beautiful, but it’s too heavy.
JB Mono has a 10x smaller footprint.
  • Loading branch information
roman-kashitsyn committed Aug 18, 2024
1 parent 827d4e7 commit 6e7d420
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions css/tufte.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,38 +102,39 @@
}

@font-face {
font-family: "Iosevka";
font-family: "JetBrains Mono";
font-style: normal;
font-weight: normal;
src: local(Iosevka),
url("/fonts/Iosevka-Regular.woff2") format("woff2");
src: local(JetBrains Mono),
url("/fonts/JetBrainsMono-Regular.woff2") format("woff2");
font-display: swap;
}

@font-face {
font-family: "Iosevka";
font-style: italic;
font-weight: normal;
src: local(Iosevka),
url("/fonts/Iosevka-Italic.woff2") format("woff2");
font-family: "JetBrains Mono";
font-style: normal;
font-weight: bold;
src: local(JetBrains Mono),
url("/fonts/JetBrainsMono-Bold.woff2") format("woff2");
font-display: swap;
}

@font-face {
font-family: "Iosevka";
font-style: normal;
font-weight: bold;
src: local(Iosevka),
url("/fonts/Iosevka-Bold.woff2") format("woff2");
font-family: "JetBrains Mono";
font-style: italic;
font-weight: normal;
src: local(JetBrains Mono),
url("/fonts/JetBrainsMono-Italic.woff2") format("woff2");
font-display: swap;
}


@font-face {
font-family: "Iosevka";
font-family: "JetBrains Mono";
font-style: italic;
font-weight: bold;
src: local(Iosevka),
url("/fonts/Iosevka-BoldItalic.woff2") format("woff2");
src: local(JetBrains Mono),
url("/fonts/JetBrainsMono-SemiBoldItalic.woff2") format("woff2");
font-display: swap;
}

Expand Down Expand Up @@ -808,16 +809,17 @@ tr.border-bot {

code,
pre>code {
font-family: 'Iosevka', monospace;
font-size: 0.83em;
font-family: 'JetBrains Mono', monospace;
font-feature-settings: 'ss02', 'zero';
font-size: 0.75em;
line-height: 1.42;
font-variant-numeric: normal;
-webkit-text-size-adjust: 100%;
/* Prevent adjustments of font size after orientation changes in iOS. See https://github.com/edwardtufte/tufte-css/issues/81#issuecomment-261953409 */
}

.sans>code {
font-size: 0.83em;
font-size: 0.75em;
}

.marginnote>code,
Expand Down
Binary file removed fonts/Iosevka-Bold.woff2
Binary file not shown.
Binary file removed fonts/Iosevka-BoldItalic.woff2
Binary file not shown.
Binary file removed fonts/Iosevka-Italic.woff2
Binary file not shown.
Binary file removed fonts/Iosevka-Regular.woff2
Binary file not shown.
Binary file added fonts/JetBrainsMono-Bold.woff2
Binary file not shown.
Binary file added fonts/JetBrainsMono-Italic.woff2
Binary file not shown.
Binary file added fonts/JetBrainsMono-Regular.woff2
Binary file not shown.
Binary file added fonts/JetBrainsMono-SemiBoldItalic.woff2
Binary file not shown.

0 comments on commit 6e7d420

Please sign in to comment.