Nischal Subedi commited on
Commit
2669b75
·
1 Parent(s): 203af54
Files changed (1) hide show
  1. app.py +23 -6
app.py CHANGED
@@ -299,7 +299,15 @@ Answer:"""
299
  /* Import legible fonts from Google Fonts */
300
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@600;700;800&display=swap');
301
 
302
- /* Define our custom light theme variables */
 
 
 
 
 
 
 
 
303
  :root {{
304
  --custom-primary-color: #FF8C00;
305
  --custom-primary-hover: #E07B00;
@@ -317,8 +325,8 @@ Answer:"""
317
  --custom-error-text: #E05C00; /* Orange-red error text */
318
  }}
319
 
320
- /* CRITICAL: FORCE GRADIO'S INTERNAL VARIABLES TO OUR CUSTOM LIGHT THEME VALUES */
321
- :root, html.dark, body.dark, .dark {{
322
  /* General backgrounds */
323
  --background-fill-primary: var(--custom-background-primary) !important;
324
  --background-fill-secondary: var(--custom-background-secondary) !important;
@@ -379,7 +387,7 @@ Answer:"""
379
  --color-error-background: var(--custom-error-bg) !important;
380
  --color-error-border: var(--custom-error-border) !important;
381
 
382
- /* Specific overrides for common Gradio components */
383
  --block-border-color: var(--custom-border-color) !important;
384
  --input-border-color: var(--custom-border-color) !important;
385
  --input-label-color: var(--custom-text-primary) !important;
@@ -391,6 +399,15 @@ Answer:"""
391
  --scrollbar-track-color: var(--custom-background-secondary) !important;
392
  }}
393
 
 
 
 
 
 
 
 
 
 
394
  /* Base styles for html and body */
395
  body, html {{
396
  background-color: var(--custom-background-secondary) !important;
@@ -503,7 +520,7 @@ Answer:"""
503
  .examples-section .gr-samples-table th {{
504
  background-color: var(--custom-background-secondary) !important;
505
  color: var(--custom-text-primary) !important;
506
- text-align: center !important; /* Center table headers */
507
  }}
508
  .examples-section .gr-samples-table td {{
509
  background-color: var(--custom-background-primary) !important;
@@ -711,7 +728,7 @@ Answer:"""
711
  <style>
712
  .custom-link {{
713
  font-weight: bold !important;
714
- color: var(--custom-primary-color) !important;
715
  text-decoration: underline;
716
  }}
717
  .app-footer p {{
 
299
  /* Import legible fonts from Google Fonts */
300
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@600;700;800&display=swap');
301
 
302
+ /* Force light theme globally */
303
+ :root, html, body, .gradio-app, .dark, html.dark, body.dark {{
304
+ color-scheme: light only !important; /* Prevent dark mode */
305
+ background-color: var(--custom-background-secondary) !important;
306
+ color: var(--custom-text-primary) !important;
307
+ transition: none !important; /* Prevent theme transition flickering */
308
+ }}
309
+
310
+ /* Define custom light theme variables */
311
  :root {{
312
  --custom-primary-color: #FF8C00;
313
  --custom-primary-hover: #E07B00;
 
325
  --custom-error-text: #E05C00; /* Orange-red error text */
326
  }}
327
 
328
+ /* Override dark mode for all Gradio components */
329
+ :root, html.dark, body.dark, .dark, .gradio-container, .gradio-app {{
330
  /* General backgrounds */
331
  --background-fill-primary: var(--custom-background-primary) !important;
332
  --background-fill-secondary: var(--custom-background-secondary) !important;
 
387
  --color-error-background: var(--custom-error-bg) !important;
388
  --color-error-border: var(--custom-error-border) !important;
389
 
390
+ /* Specific overrides */
391
  --block-border-color: var(--custom-border-color) !important;
392
  --input-border-color: var(--custom-border-color) !important;
393
  --input-label-color: var(--custom-text-primary) !important;
 
399
  --scrollbar-track-color: var(--custom-background-secondary) !important;
400
  }}
401
 
402
+ /* Override dark mode media query */
403
+ @media (prefers-color-scheme: dark) {{
404
+ :root, html, body, .gradio-app, .dark, .gradio-container {{
405
+ color-scheme: light only !important;
406
+ background-color: var(--custom-background-secondary) !important;
407
+ color: var(--custom-text-primary) !important;
408
+ }}
409
+ }}
410
+
411
  /* Base styles for html and body */
412
  body, html {{
413
  background-color: var(--custom-background-secondary) !important;
 
520
  .examples-section .gr-samples-table th {{
521
  background-color: var(--custom-background-secondary) !important;
522
  color: var(--custom-text-primary) !important;
523
+ text-align: center !important;
524
  }}
525
  .examples-section .gr-samples-table td {{
526
  background-color: var(--custom-background-primary) !important;
 
728
  <style>
729
  .custom-link {{
730
  font-weight: bold !important;
731
+ color: var(--custom-primary-color) ! includes;
732
  text-decoration: underline;
733
  }}
734
  .app-footer p {{