Skip to content

Commit 68d5b1b

Browse files
committed
perf: self-host fonts and fix accent color contrast
Self-host Inter and JetBrains Mono (woff2) to eliminate 750ms render-blocking Google Fonts request. Swap accent color from #ea580c (orange, 3.55:1 contrast) to #1355FF (SuperDoc Blue, 4.62:1 contrast) fixing all WCAG AA contrast failures sitewide.
1 parent bd7509f commit 68d5b1b

File tree

5 files changed

+53
-11
lines changed

5 files changed

+53
-11
lines changed

apps/web/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
1313
<link rel="manifest" href="/site.webmanifest" />
1414

15-
<!-- Fonts -->
16-
<link rel="preconnect" href="https://fonts.googleapis.com" />
17-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
18-
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
15+
<!-- Fonts (self-hosted) -->
16+
<link rel="preload" href="/fonts/inter.woff2" as="font" type="font/woff2" crossorigin />
17+
<link rel="preload" href="/fonts/jetbrains-mono.woff2" as="font" type="font/woff2" crossorigin />
18+
<link rel="stylesheet" href="/fonts/fonts.css" />
1919

2020
<!-- Google Analytics -->
2121
<script async src="https://www.googletagmanager.com/gtag/js?id=G-JFTMJ85VCW"></script>

apps/web/public/fonts/fonts.css

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@font-face {
2+
font-family: 'Inter';
3+
font-style: normal;
4+
font-weight: 400;
5+
font-display: swap;
6+
src: url(/fonts/inter.woff2) format('woff2');
7+
}
8+
@font-face {
9+
font-family: 'Inter';
10+
font-style: normal;
11+
font-weight: 500;
12+
font-display: swap;
13+
src: url(/fonts/inter.woff2) format('woff2');
14+
}
15+
@font-face {
16+
font-family: 'Inter';
17+
font-style: normal;
18+
font-weight: 600;
19+
font-display: swap;
20+
src: url(/fonts/inter.woff2) format('woff2');
21+
}
22+
@font-face {
23+
font-family: 'Inter';
24+
font-style: normal;
25+
font-weight: 700;
26+
font-display: swap;
27+
src: url(/fonts/inter.woff2) format('woff2');
28+
}
29+
@font-face {
30+
font-family: 'JetBrains Mono';
31+
font-style: normal;
32+
font-weight: 400;
33+
font-display: swap;
34+
src: url(/fonts/jetbrains-mono.woff2) format('woff2');
35+
}
36+
@font-face {
37+
font-family: 'JetBrains Mono';
38+
font-style: normal;
39+
font-weight: 500;
40+
font-display: swap;
41+
src: url(/fonts/jetbrains-mono.woff2) format('woff2');
42+
}

apps/web/public/fonts/inter.woff2

225 KB
Binary file not shown.
54.4 KB
Binary file not shown.

apps/web/src/index.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@import "tailwindcss";
22

3-
/* ooxml.dev theme - Coral Light */
3+
/* ooxml.dev theme - Blue */
44
:root {
5-
/* Coral accent */
6-
--color-accent: #ea580c;
7-
--color-accent-hover: #c2410c;
8-
--color-accent-light: #fff7ed;
5+
/* SuperDoc Blue accent */
6+
--color-accent: #1355FF;
7+
--color-accent-hover: #0F44CC;
8+
--color-accent-light: #EFF4FF;
99

1010
/* Backgrounds */
1111
--color-bg-primary: #ffffff;
@@ -63,8 +63,8 @@ body {
6363
}
6464

6565
.note-info {
66-
background-color: #fff7ed;
67-
border-color: #fed7aa;
66+
background-color: #eff4ff;
67+
border-color: #bfdbfe;
6868
}
6969

7070
.note-tip {

0 commit comments

Comments
 (0)