Skip to content

Commit

Permalink
load optimized Inter fonts (closes #709) (#710)
Browse files Browse the repository at this point in the history
* style: overwrite Inter fonts with optimized woff2 files

* style: dont ignore inter fonts (?)

* chore: remove unnecessary css for this overwrite

* chore: use .woff2 files for Inter, converted from unsubsetted .otf
  • Loading branch information
evvvritt authored Oct 17, 2023
1 parent 941ae61 commit ffb35be
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ node_modules
static/fonts/*
!static/fonts/.gitkeep
!static/fonts/redaction
!static/fonts/inter*
static/twemoji/*
!static/twemoji/.gitkeep
/coverage
Expand Down
2 changes: 1 addition & 1 deletion src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<meta charset="utf-8" />
<link rel="manifest" href="/manifest.webmanifest">
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<link rel="preload" href="/fonts/Inter-Regular.otf" as="font" type="font/otf" crossorigin>
<link rel="preload" href="/fonts/Inter-Regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/fonts/redaction/Redaction_50-Italic.woff2" as="font" type="font/woff2" crossorigin>
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
Expand Down
1 change: 1 addition & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import 'radicle-design-system/static/colors.css';
import 'radicle-design-system/static/elevation.css';
import 'radicle-design-system/static/typography.css';
import '../styles/fonts.css'; /* must be after radicle-design-system/.../typography.css !! */
import '../styles/app.css';
import '$lib/stores/theme/theme.store';
Expand Down
16 changes: 16 additions & 0 deletions src/styles/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* cloned from radicle-design-system so we can swap in optimized fonts */

@font-face {
font-family: 'Inter Bold';
src: url('/fonts/Inter-Bold.woff2');
}

@font-face {
font-family: 'Inter SemiBold';
src: url('/fonts/Inter-Semibold.woff2');
}

@font-face {
font-family: 'Inter Regular';
src: url('/fonts/Inter-Regular.woff2');
}
Binary file added static/fonts/Inter-Bold.woff2
Binary file not shown.
Binary file added static/fonts/Inter-Regular.woff2
Binary file not shown.
Binary file added static/fonts/Inter-SemiBold.woff2
Binary file not shown.

0 comments on commit ffb35be

Please sign in to comment.