about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-10-04 16:28:05 -0500
committerGitHub <noreply@github.com>2024-10-04 16:28:05 -0500
commit3fb14d184a84cb892c751338c9aea625f5767a47 (patch)
treef0096e4064af614e92cc46866f539f0e56d85cbd
parent1cedd4a3c4980dd2120c287497b6bd3098fdf751 (diff)
downloadvoidsky-3fb14d184a84cb892c751338c9aea625f5767a47.tar.zst
Move font-face defs into HTML for CDN (#5612)
-rw-r--r--bskyweb/templates/base.html14
-rw-r--r--src/alf/fonts.ts2
-rw-r--r--src/style.css15
-rw-r--r--web/index.html14
4 files changed, 30 insertions, 15 deletions
diff --git a/bskyweb/templates/base.html b/bskyweb/templates/base.html
index 885d13d2a..dd2474c82 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 54fe7a34e..b46faed1c 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 72e1ce2a2..a4c501cc1 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 8efc2cb68..2a406429c 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;