From 3fb14d184a84cb892c751338c9aea625f5767a47 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 4 Oct 2024 16:28:05 -0500 Subject: [PATCH] Move font-face defs into HTML for CDN (#5612) --- bskyweb/templates/base.html | 14 ++++++++++++++ src/alf/fonts.ts | 2 ++ src/style.css | 15 --------------- web/index.html | 14 ++++++++++++++ 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/bskyweb/templates/base.html b/bskyweb/templates/base.html index 885d13d2a7..dd2474c824 100644 --- a/bskyweb/templates/base.html +++ b/bskyweb/templates/base.html @@ -24,6 +24,20 @@ * * THIS NEEDS TO BE DUPLICATED IN `bskyweb/templates/base.html` */ + @font-face { + font-family: 'InterVariable'; + src: url(/static/media/InterVariable.c9f788f6e7ebaec75d7c.ttf) format('truetype'); + font-weight: 300 1000; + font-style: normal; + font-display: swap; + } + @font-face { + font-family: 'InterVariableItalic'; + src: url(/static/media/InterVariable-Italic.55d6a3f35e9b605ba6f4.ttf) format('truetype'); + font-weight: 300 1000; + font-style: italic; + font-display: swap; + } html { background-color: white; scrollbar-gutter: stable both-edges; diff --git a/src/alf/fonts.ts b/src/alf/fonts.ts index 54fe7a34e0..b46faed1cc 100644 --- a/src/alf/fonts.ts +++ b/src/alf/fonts.ts @@ -70,6 +70,8 @@ export function applyFonts( * IMPORTANT: This is unused. Expo statically extracts these fonts. * * All used fonts MUST be configured here. Unused fonts can be commented out. + * + * This is used for both web fonts and native fonts. */ export function DO_NOT_USE() { return useFonts({ diff --git a/src/style.css b/src/style.css index 72e1ce2a2b..a4c501cc14 100644 --- a/src/style.css +++ b/src/style.css @@ -6,21 +6,6 @@ * may need to touch all three. Ask Eric if you aren't sure. */ -@font-face { - font-family: 'InterVariable'; - src: url(/assets/fonts/inter/InterVariable.ttf) format('truetype'); - font-weight: 300 1000; - font-style: normal; - font-display: swap; -} -@font-face { - font-family: 'InterVariableItalic'; - src: url(/assets/fonts/inter/InterVariable-Italic.ttf) format('truetype'); - font-weight: 300 1000; - font-style: italic; - font-display: swap; -} - /** * BEGIN STYLES * diff --git a/web/index.html b/web/index.html index 8efc2cb68f..2a406429c7 100644 --- a/web/index.html +++ b/web/index.html @@ -29,6 +29,20 @@ * * THIS NEEDS TO BE DUPLICATED IN `bskyweb/templates/base.html` */ + @font-face { + font-family: 'InterVariable'; + src: url(/static/media/InterVariable.c9f788f6e7ebaec75d7c.ttf) format('truetype'); + font-weight: 300 1000; + font-style: normal; + font-display: swap; + } + @font-face { + font-family: 'InterVariableItalic'; + src: url(/static/media/InterVariable-Italic.55d6a3f35e9b605ba6f4.ttf) format('truetype'); + font-weight: 300 1000; + font-style: italic; + font-display: swap; + } html { background-color: white; scrollbar-gutter: stable both-edges;