Pabloler21 Claude Sonnet 4.6 commited on
Commit
1ea9131
·
1 Parent(s): 102bb71

fix(ui): load Google Fonts via <head> <link> so they load on the Space (@import was rejected)

Browse files
Files changed (2) hide show
  1. app.py +3 -0
  2. styles.css +3 -1
app.py CHANGED
@@ -285,6 +285,9 @@ _TICK_URI = f"data:audio/wav;base64,{base64.b64encode(type_tick_wav_bytes()).dec
285
  # nodes, driving the mute button, and (4) times the idle "speak-first"
286
  # client-side so ANY interaction resets it. Every horror effect stays CSS.
287
  _HEAD_JS = """
 
 
 
288
  <script>
289
  (function () {
290
  var KEY = 'hollowAudio';
 
285
  # nodes, driving the mute button, and (4) times the idle "speak-first"
286
  # client-side so ANY interaction resets it. Every horror effect stays CSS.
287
  _HEAD_JS = """
288
+ <link rel="preconnect" href="https://fonts.googleapis.com">
289
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
290
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Special+Elite&family=Crimson+Text:ital,wght@0,400;0,600;1,400;1,600&display=swap">
291
  <script>
292
  (function () {
293
  var KEY = 'hollowAudio';
styles.css CHANGED
@@ -6,7 +6,9 @@
6
  title flicker, Bond heartbeat).
7
  ───────────────────────────────────────────────── */
8
 
9
- @import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Crimson+Text:ital,wght@0,400;0,600;1,400;1,600&display=swap');
 
 
10
 
11
  /* ── 1. Theme variable overrides ──────────────── */
12
  :root {
 
6
  title flicker, Bond heartbeat).
7
  ───────────────────────────────────────────────── */
8
 
9
+ /* Fonts are loaded via a <link> in <head> (app.py _HEAD_JS): an @import here is
10
+ rejected on the Space ("@import rules are not allowed here") because Gradio
11
+ injects this stylesheet after its own, so @import isn't the first rule. */
12
 
13
  /* ── 1. Theme variable overrides ──────────────── */
14
  :root {