Skip to content

Commit a3626cd

Browse files
Thomas StrombergThomas Stromberg
authored andcommitted
self-host fonts
1 parent 9891f49 commit a3626cd

File tree

8 files changed

+30
-3
lines changed

8 files changed

+30
-3
lines changed

src/_layouts/base.njk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
<!-- Favicon -->
1616
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='0.9em' font-size='90'>🎸</text></svg>">
1717

18+
<!-- Preload fonts for better performance -->
19+
<link rel="preload" href="/assets/fonts/PassionOne-Bold.woff2" as="font" type="font/woff2" crossorigin>
20+
1821
<link rel="stylesheet" href="/assets/css/style.css">
19-
<link rel="preconnect" href="https://fonts.googleapis.com">
20-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
2122
</head>
2223
<body>
2324
<a href="#main-content" class="skip-link">Skip to main content</a>

src/assets/css/style.css

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1-
@import url("https://fonts.googleapis.com/css2?family=Passion+One:wght@700&display=swap");
1+
/* Passion One Font - Self-hosted */
2+
@font-face {
3+
font-family: "Passion One";
4+
src: url("/assets/fonts/PassionOne-Regular.woff2") format("woff2"),
5+
url("/assets/fonts/PassionOne-Regular.ttf") format("truetype");
6+
font-weight: 400;
7+
font-style: normal;
8+
font-display: swap;
9+
}
10+
11+
@font-face {
12+
font-family: "Passion One";
13+
src: url("/assets/fonts/PassionOne-Bold.woff2") format("woff2"),
14+
url("/assets/fonts/PassionOne-Bold.ttf") format("truetype");
15+
font-weight: 700;
16+
font-style: normal;
17+
font-display: swap;
18+
}
19+
20+
@font-face {
21+
font-family: "Passion One";
22+
src: url("/assets/fonts/PassionOne-Black.woff2") format("woff2"),
23+
url("/assets/fonts/PassionOne-Black.ttf") format("truetype");
24+
font-weight: 900;
25+
font-style: normal;
26+
font-display: swap;
27+
}
228

329
:root {
430
--yellow: #ffe838;
21.9 KB
Binary file not shown.
8.84 KB
Binary file not shown.
22.3 KB
Binary file not shown.
9.03 KB
Binary file not shown.
22.5 KB
Binary file not shown.
9.17 KB
Binary file not shown.

0 commit comments

Comments
 (0)