Skip to content

Commit 4f71c03

Browse files
committed
Switch monospaced font to Cascadia Code
Remove local Roboto Mono TTF and preload the remote woff2 from Google Fonts. Update @font-face to use woff2 with font-display: swap and a 200–700 weight range, remove legacy variable-fallback rules, and replace font stacks to prefer the new monospaced font.
1 parent f039f7d commit 4f71c03

4 files changed

Lines changed: 16 additions & 56 deletions

File tree

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333

3434
<link
3535
rel="preload"
36-
href="/fonts/RobotoMono-VariableFont_wght.ttf"
36+
href="https://fonts.gstatic.com/s/cascadiacode/v5/qWcsB6-zq5zxD57cT5s916v3aDvbtxsis4I.woff2"
3737
as="font"
38-
type="font/ttf"
38+
type="font/woff2"
3939
crossorigin
4040
/>
4141
</head>
-177 KB
Binary file not shown.

src/fonts.css

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,13 @@
1+
/* Cascadia Code - latin */
12
@font-face {
2-
font-family: "Roboto Mono";
3+
font-family: "Cascadia Code";
34
font-style: normal;
4-
font-weight: 100 900;
5-
font-display: block;
6-
src: url("/fonts/RobotoMono-VariableFont_wght.ttf")
7-
format("truetype-variations");
5+
font-weight: 200 700;
6+
font-display: swap;
7+
src: url(https://fonts.gstatic.com/s/cascadiacode/v5/qWcsB6-zq5zxD57cT5s916v3aDvbtxsis4I.woff2)
8+
format("woff2");
89
unicode-range:
910
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
10-
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
11-
U+FFFD;
12-
}
13-
14-
/* Fallback for older browsers that don't support variable fonts */
15-
@supports not (font-variation-settings: normal) {
16-
@font-face {
17-
font-family: "Roboto Mono";
18-
font-style: normal;
19-
font-weight: 400;
20-
font-display: block;
21-
src: url("/fonts/RobotoMono-VariableFont_wght.ttf") format("truetype");
22-
}
23-
24-
@font-face {
25-
font-family: "Roboto Mono";
26-
font-style: normal;
27-
font-weight: 500;
28-
font-display: block;
29-
src: url("/fonts/RobotoMono-VariableFont_wght.ttf") format("truetype");
30-
}
31-
32-
@font-face {
33-
font-family: "Roboto Mono";
34-
font-style: normal;
35-
font-weight: 700;
36-
font-display: block;
37-
src: url("/fonts/RobotoMono-VariableFont_wght.ttf") format("truetype");
38-
}
39-
40-
@font-face {
41-
font-family: "Roboto Mono";
42-
font-style: normal;
43-
font-weight: 800;
44-
font-display: block;
45-
src: url("/fonts/RobotoMono-VariableFont_wght.ttf") format("truetype");
46-
}
11+
U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
12+
U+2215, U+FEFF, U+FFFD;
4713
}

src/index.css

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,11 @@ body::-webkit-scrollbar {
121121
--sidebar-border: oklch(0.922 0 0);
122122
--sidebar-ring: oklch(0.708 0 0);
123123
--font-sans:
124-
"Roboto Mono", "SF Mono", Monaco, "Cascadia Code", Consolas, "Courier New",
125-
monospace;
124+
"Cascadia Code", "SF Mono", Monaco, Consolas, "Courier New", monospace;
126125
--font-serif:
127-
"Roboto Mono", "SF Mono", Monaco, "Cascadia Code", Consolas, "Courier New",
128-
monospace;
126+
"Cascadia Code", "SF Mono", Monaco, Consolas, "Courier New", monospace;
129127
--font-mono:
130-
"Roboto Mono", "SF Mono", Monaco, "Cascadia Code", Consolas, "Courier New",
131-
monospace;
128+
"Cascadia Code", "SF Mono", Monaco, Consolas, "Courier New", monospace;
132129
--radius: 0.625rem;
133130
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
134131
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
@@ -182,14 +179,11 @@ body::-webkit-scrollbar {
182179
--sidebar-border: oklch(0.275 0 0);
183180
--sidebar-ring: oklch(0.439 0 0);
184181
--font-sans:
185-
"Roboto Mono", "SF Mono", Monaco, "Cascadia Code", Consolas, "Courier New",
186-
monospace;
182+
"Cascadia Code", "SF Mono", Monaco, Consolas, "Courier New", monospace;
187183
--font-serif:
188-
"Roboto Mono", "SF Mono", Monaco, "Cascadia Code", Consolas, "Courier New",
189-
monospace;
184+
"Cascadia Code", "SF Mono", Monaco, Consolas, "Courier New", monospace;
190185
--font-mono:
191-
"Roboto Mono", "SF Mono", Monaco, "Cascadia Code", Consolas, "Courier New",
192-
monospace;
186+
"Cascadia Code", "SF Mono", Monaco, Consolas, "Courier New", monospace;
193187
--radius: 0.625rem;
194188
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
195189
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);

0 commit comments

Comments
 (0)