From 193ed93ee850e5bf2548987d15f2ede31237d4df Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Wed, 9 Aug 2023 09:36:50 -0400 Subject: [PATCH] chore(style.css): update font paths to use a variable for the fonts directory chore(vite.config.ts): import the resolve function from the path module --- client/src/style.css | 26 +++++++++++++------------- client/vite.config.ts | 3 ++- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/client/src/style.css b/client/src/style.css index 23526be2d4..ff5d089cbd 100644 --- a/client/src/style.css +++ b/client/src/style.css @@ -13,7 +13,7 @@ font-family: Signifier; font-style: normal; font-weight: 400; - src: url("../fonts/signifier-light.woff2") format("woff2") + src: url("$fonts/signifier-light.woff2") format("woff2") } @font-face { @@ -21,7 +21,7 @@ font-family: Signifier; font-style: italic; font-weight: 400; - src: url("../fonts/signifier-light-italic.woff2") format("woff2") + src: url("$fonts/signifier-light-italic.woff2") format("woff2") } @font-face { @@ -29,7 +29,7 @@ font-family: Signifier; font-style: normal; font-weight: 700; - src: url("../fonts/signifier-bold.woff2") format("woff2") + src: url("$fonts/signifier-bold.woff2") format("woff2") } @font-face { @@ -37,7 +37,7 @@ font-family: Signifier; font-style: italic; font-weight: 700; - src: url("../fonts/signifier-bold-italic.woff2") format("woff2") + src: url("$fonts/signifier-bold-italic.woff2") format("woff2") } @font-face { @@ -45,7 +45,7 @@ font-family: Söhne; font-style: normal; font-weight: 400; - src: url("../fonts/soehne-buch.woff2") format("woff2") + src: url("$fonts/soehne-buch.woff2") format("woff2") } @font-face { @@ -53,7 +53,7 @@ font-family: Söhne; font-style: italic; font-weight: 400; - src: url("../fonts/soehne-buch-kursiv.woff2") format("woff2") + src: url("$fonts/soehne-buch-kursiv.woff2") format("woff2") } @font-face { @@ -61,7 +61,7 @@ font-family: Söhne; font-style: normal; font-weight: 500; - src: url("../fonts/soehne-kraftig.woff2") format("woff2") + src: url("$fonts/soehne-kraftig.woff2") format("woff2") } @font-face { @@ -69,7 +69,7 @@ font-family: Söhne; font-style: italic; font-weight: 500; - src: url("../fonts/soehne-kraftig-kursiv.woff2") format("woff2") + src: url("$fonts/soehne-kraftig-kursiv.woff2") format("woff2") } @font-face { @@ -77,7 +77,7 @@ font-family: Söhne; font-style: normal; font-weight: 600; - src: url("../fonts/soehne-halbfett.woff2") format("woff2") + src: url("$fonts/soehne-halbfett.woff2") format("woff2") } @font-face { @@ -85,7 +85,7 @@ font-family: Söhne; font-style: italic; font-weight: 600; - src: url("../fonts/soehne-halbfett-kursiv.woff2") format("woff2") + src: url("$fonts/soehne-halbfett-kursiv.woff2") format("woff2") } @font-face { @@ -93,7 +93,7 @@ font-family: Söhne Mono; font-style: normal; font-weight: 400; - src: url("../fonts/soehne-mono-buch.woff2") format("woff2") + src: url("$fonts/soehne-mono-buch.woff2") format("woff2") } @font-face { @@ -101,7 +101,7 @@ font-family: Söhne Mono; font-style: normal; font-weight: 700; - src: url("../fonts/soehne-mono-halbfett.woff2") format("woff2") + src: url("$fonts/soehne-mono-halbfett.woff2") format("woff2") } @font-face { @@ -109,7 +109,7 @@ font-family: Söhne Mono; font-style: italic; font-weight: 400; - src: url("../fonts/soehne-mono-buch-kursiv.woff2") format("woff2") + src: url("$fonts/soehne-mono-buch-kursiv.woff2") format("woff2") } /* * { diff --git a/client/vite.config.ts b/client/vite.config.ts index f757b6a264..5ca55a2458 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -1,6 +1,6 @@ import { defineConfig, loadEnv } from 'vite'; import react from '@vitejs/plugin-react'; -import path from 'path'; +import path, { resolve } from 'path'; import type { Plugin } from 'vite'; // https://vitejs.dev/config/ @@ -42,6 +42,7 @@ export default defineConfig({ resolve: { alias: { '~': path.join(__dirname, 'src/'), + $fonts: resolve('public/fonts'), }, }, });