Tonykip commited on
Commit
aeab81a
·
verified ·
1 Parent(s): ac2830d

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -192,8 +192,20 @@ footer { display:none !important; }
192
  .footnote b { color:var(--ink); font-weight:600; }
193
  """
194
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  with gr.Blocks(title="Say It Back in Kalenjin", theme=gr.themes.Soft(primary_hue="orange"),
196
- css=CSS, head=HEAD) as demo:
197
  gr.HTML(
198
  "<div class='hero'>"
199
  "<div class='eyebrow'>[ English → Kalenjin · spoken ]</div>"
 
192
  .footnote b { color:var(--ink); font-weight:600; }
193
  """
194
 
195
+ # Force light mode regardless of the device's system theme (the custom design is
196
+ # built for light; dark mode made it look broken). Reload once into ?__theme=light.
197
+ FORCE_LIGHT = """
198
+ () => {
199
+ const u = new URL(window.location.href);
200
+ if (u.searchParams.get('__theme') !== 'light') {
201
+ u.searchParams.set('__theme', 'light');
202
+ window.location.replace(u.href);
203
+ }
204
+ }
205
+ """
206
+
207
  with gr.Blocks(title="Say It Back in Kalenjin", theme=gr.themes.Soft(primary_hue="orange"),
208
+ css=CSS, head=HEAD, js=FORCE_LIGHT) as demo:
209
  gr.HTML(
210
  "<div class='hero'>"
211
  "<div class='eyebrow'>[ English → Kalenjin · spoken ]</div>"