From c7b228863006b739c1a0b4c2de7d85351d32a0d5 Mon Sep 17 00:00:00 2001 From: Tom O'Dwyer Date: Tue, 6 Aug 2024 10:53:03 +0100 Subject: [PATCH] Install variable font with fontsource --- assets/src/scripts/main.js | 1 + package-lock.json | 9 +++++++++ package.json | 3 +++ tailwind.config.js | 2 +- vite.config.js | 3 +++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/assets/src/scripts/main.js b/assets/src/scripts/main.js index 05dc6e7b..8808c5f8 100644 --- a/assets/src/scripts/main.js +++ b/assets/src/scripts/main.js @@ -1,2 +1,3 @@ import "vite/modulepreload-polyfill"; +import "@fontsource-variable/public-sans"; import "../styles/main.css"; diff --git a/package-lock.json b/package-lock.json index c1925af8..590ec7d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,9 @@ "": { "name": "airlock", "version": "1.0.0", + "dependencies": { + "@fontsource-variable/public-sans": "^5.0.19" + }, "devDependencies": { "@tailwindcss/forms": "^0.5.7", "@tailwindcss/typography": "^0.5.13", @@ -420,6 +423,12 @@ "node": ">=12" } }, + "node_modules/@fontsource-variable/public-sans": { + "version": "5.0.19", + "resolved": "https://registry.npmjs.org/@fontsource-variable/public-sans/-/public-sans-5.0.19.tgz", + "integrity": "sha512-Tc1V139visg0xUgSe2vQy86OwHEGb0dO57vcrD6Cw2vDRf42sZ4fD7nTuY0Q0AjVNemT7RicmkR9qnB/MfJ6ug==", + "license": "OFL-1.1" + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", diff --git a/package.json b/package.json index bfcc70cb..6bffb7bc 100644 --- a/package.json +++ b/package.json @@ -14,5 +14,8 @@ "postcss": "^8.4.40", "tailwindcss": "^3.4.7", "vite": "^5.3.5" + }, + "dependencies": { + "@fontsource-variable/public-sans": "^5.0.19" } } diff --git a/tailwind.config.js b/tailwind.config.js index d9bd7a42..2929a144 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -12,7 +12,7 @@ export default { theme: { extend: { fontFamily: { - sans: ["Public Sans", ...fontFamily.sans], + sans: ["Public Sans Variable", ...fontFamily.sans], }, colors: { oxford: { diff --git a/vite.config.js b/vite.config.js index ec1e4957..3a7bf03e 100644 --- a/vite.config.js +++ b/vite.config.js @@ -12,4 +12,7 @@ export default defineConfig({ }, }, }, + server: { + origin: "http://localhost:5173", + }, });