From 339af8d7abf0207d30b2b3ee945a44c2123a5564 Mon Sep 17 00:00:00 2001 From: Jamil Date: Wed, 4 Jun 2025 14:43:23 -0700 Subject: [PATCH] refactor(gui-client): embed fonts directly (#9398) This will prevent the fonts from failing to load if the user has no internet connection. Tested. --- rust/gui-client/index.html | 3 --- rust/gui-client/package.json | 1 + rust/gui-client/pnpm-lock.yaml | 8 ++++++++ rust/gui-client/src-frontend/main.css | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/rust/gui-client/index.html b/rust/gui-client/index.html index 3029a6790..50b7b0cea 100644 --- a/rust/gui-client/index.html +++ b/rust/gui-client/index.html @@ -6,9 +6,6 @@ - Firezone diff --git a/rust/gui-client/package.json b/rust/gui-client/package.json index fccdea9db..28d04e40d 100644 --- a/rust/gui-client/package.json +++ b/rust/gui-client/package.json @@ -16,6 +16,7 @@ "postinstall": "flowbite-react patch" }, "dependencies": { + "@fontsource-variable/source-sans-3": "^5.2.8", "@heroicons/react": "^2.2.0", "@sentry/core": "^9.24.0", "@sentry/react": "^9.24.0", diff --git a/rust/gui-client/pnpm-lock.yaml b/rust/gui-client/pnpm-lock.yaml index c93a288ed..c5c3d31b4 100644 --- a/rust/gui-client/pnpm-lock.yaml +++ b/rust/gui-client/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@fontsource-variable/source-sans-3': + specifier: ^5.2.8 + version: 5.2.8 '@heroicons/react': specifier: ^2.2.0 version: 2.2.0(react@19.1.0) @@ -334,6 +337,9 @@ packages: '@floating-ui/utils@0.2.9': resolution: {integrity: sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg==} + '@fontsource-variable/source-sans-3@5.2.8': + resolution: {integrity: sha512-iRQD4k06Wxm1668+AbPBoVo+CbgRsOz2E0/XibDJ7kAm9UhdhmNmsMTvs9KEl/mQxUj/487tr9w47NoM/TMhZQ==} + '@heroicons/react@2.2.0': resolution: {integrity: sha512-LMcepvRaS9LYHJGsF0zzmgKCUim/X3N/DQKc4jepAXJ7l8QxJ1PmxJzqplF2Z3FE4PqBAIGyJAQ/w4B5dsqbtQ==} peerDependencies: @@ -1623,6 +1629,8 @@ snapshots: '@floating-ui/utils@0.2.9': {} + '@fontsource-variable/source-sans-3@5.2.8': {} + '@heroicons/react@2.2.0(react@19.1.0)': dependencies: react: 19.1.0 diff --git a/rust/gui-client/src-frontend/main.css b/rust/gui-client/src-frontend/main.css index 4ca6549a9..e105f1c1c 100644 --- a/rust/gui-client/src-frontend/main.css +++ b/rust/gui-client/src-frontend/main.css @@ -1,4 +1,5 @@ @import "tailwindcss"; +@import "@fontsource-variable/source-sans-3"; @plugin "flowbite-react/plugin/tailwindcss"; @plugin 'flowbite/plugin'; @@ -43,7 +44,7 @@ --color-neutral-800: #4c3e33; --color-neutral-900: #1b140e; - --default-font-family: "Source Sans 3"; + --default-font-family: "Source Sans 3 Variable", sans-serif; } /*