Skip to content

Commit

Permalink
Local font loading
Browse files Browse the repository at this point in the history
  • Loading branch information
tillvit committed Oct 13, 2023
1 parent e32b04a commit fdae6e3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions app/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@font-face {
font-family: "Assistant";
src: url("assets/font/Assistant.ttf") format("ttf");
}

* {
box-sizing: border-box;
font-family: Assistant, Helvetica, sans-serif;
Expand Down
5 changes: 3 additions & 2 deletions app/src/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,9 @@ document.querySelector("body")!.innerHTML = `<div id="popups"></div>
`

WebFont.load({
google: {
families: ["Assistant:200,300,400,500,600,700,800&display=swap"],
custom: {
families: ["Assistant"],
urls: ["index.css"],
},
active: init,
inactive: init,
Expand Down
Binary file added public/assets/font/Assistant.ttf
Binary file not shown.
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default defineConfig({
]
},
workbox: {
globPatterns: ['**/*.{js,css,html}', 'assets/*'],
globPatterns: ['**/*.{js,css,html}', 'assets/**/*'],
}

})
Expand Down

0 comments on commit fdae6e3

Please sign in to comment.