Skip to content

Commit

Permalink
Install Inter from Fontsource
Browse files Browse the repository at this point in the history
Rather than including the entire font statically in our repo, we install
it from Fontsource and import it in the Vue entrypoint.

We also switch to the variable-weight font, which offers a substantial
bandwidth savings (<50KB versus >800KB).

Issue #38: Install font from Fontsource
  • Loading branch information
reefdog committed Sep 6, 2024
1 parent 3af9f63 commit 5ba342e
Show file tree
Hide file tree
Showing 62 changed files with 9 additions and 217 deletions.
6 changes: 6 additions & 0 deletions front-end/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions front-end/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"format": "prettier --write src/"
},
"dependencies": {
"@fontsource-variable/inter": "^5.0.20",
"@heroicons/vue": "^2.1.4",
"@vue/eslint-config-airbnb-with-typescript": "^8.0.0",
"ajv": "^8.16.0",
Expand Down
7 changes: 1 addition & 6 deletions front-end/src/assets/base.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
@font-face {
font-family: 'Inter';
src: url('@/assets/fonts/Inter/Inter-VariableFont_opsz,wght.ttf') format('truetype');
}

:root {
--color-black: #363636;
--color-white: #ffffff;
Expand All @@ -24,6 +19,6 @@

body {
background-color: var(--color-white);
font-family: 'Inter', sans-serif;
font-family: 'Inter Variable', sans-serif;
font-size: var(--wac-font-size--med);
}
Binary file not shown.
Binary file not shown.
93 changes: 0 additions & 93 deletions front-end/src/assets/fonts/Inter/OFL.txt

This file was deleted.

118 changes: 0 additions & 118 deletions front-end/src/assets/fonts/Inter/README.txt

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions front-end/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '@fontsource-variable/inter';
import './assets/main.css';
import { createApp } from 'vue';
import { createPinia } from 'pinia';
Expand Down

0 comments on commit 5ba342e

Please sign in to comment.