From 036eecd1564465ba1f5dfaa33553fcbfb92c043f Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Sun, 4 Sep 2022 21:43:15 +0200 Subject: refactor(frontend): Inter font Use a variable font to reduce the number of files to be deployed --- subprojects/frontend/index.html | 267 +---------------------- subprojects/frontend/package.json | 2 +- subprojects/frontend/src/theme/ThemeProvider.tsx | 3 + subprojects/frontend/vite.config.ts | 4 +- 4 files changed, 7 insertions(+), 269 deletions(-) (limited to 'subprojects') diff --git a/subprojects/frontend/index.html b/subprojects/frontend/index.html index f9e87485..8b6814eb 100644 --- a/subprojects/frontend/index.html +++ b/subprojects/frontend/index.html @@ -13,274 +13,9 @@ diff --git a/subprojects/frontend/package.json b/subprojects/frontend/package.json index 9202542b..08522d35 100644 --- a/subprojects/frontend/package.json +++ b/subprojects/frontend/package.json @@ -32,8 +32,8 @@ "@codemirror/view": "^6.2.2", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", + "@fontsource/inter": "^4.5.12", "@fontsource/jetbrains-mono": "^4.5.10", - "@fontsource/roboto": "^4.5.8", "@lezer/common": "^1.0.1", "@lezer/highlight": "^1.0.0", "@lezer/lr": "^1.2.3", diff --git a/subprojects/frontend/src/theme/ThemeProvider.tsx b/subprojects/frontend/src/theme/ThemeProvider.tsx index 6f9a712e..ffb18a06 100644 --- a/subprojects/frontend/src/theme/ThemeProvider.tsx +++ b/subprojects/frontend/src/theme/ThemeProvider.tsx @@ -67,6 +67,9 @@ declare module '@mui/material/styles' { } const typography: TypographyVariantsOptions = { + fontFamily: + '"InterVariable", "Inter", "Roboto", "Helvetica", "Arial", sans-serif', + fontWeightMedium: 600, fontWeightEditorNormal: 450, fontWeightEditorBold: 650, editor: { diff --git a/subprojects/frontend/vite.config.ts b/subprojects/frontend/vite.config.ts index 0c13f133..7cea4642 100644 --- a/subprojects/frontend/vite.config.ts +++ b/subprojects/frontend/vite.config.ts @@ -73,7 +73,7 @@ export default defineConfig({ files: [ { match: - /(?:jetbrains-mono-latin-variable-wghtOnly-(?:italic|normal)|roboto-latin-(?:400|500)-normal).+\.woff2$/, + /(?:inter-latin-variable-wghtOnly-normal|jetbrains-mono-latin-variable-wghtOnly-(?:italic|normal)).+\.woff2$/, attributes: { type: 'font/woff2', as: 'font', @@ -96,7 +96,7 @@ export default defineConfig({ workbox: { globPatterns: [ '**/*.{css,html,js}', - 'roboto-latin-{300,400,500,700}-normal.*.woff2', + 'inter-latin-variable-wghtOnly-normal.*.woff2', 'jetbrains-mono-latin-variable-wghtOnly-{normal,italic}.*.woff2', ], dontCacheBustURLsMatching: /\.(?:css|js|woff2?)$/, -- cgit v1.2.3-54-g00ecf