HuggingJady commited on
Commit
c17841a
·
verified ·
1 Parent(s): 3598a5c

Keep text dark when the browser is in dark mode

Browse files
Files changed (1) hide show
  1. app.py +48 -0
app.py CHANGED
@@ -247,7 +247,38 @@ DIAL_CSS = """
247
  .gradio-container, .gradio-container * {
248
  font-family: "Source Sans 3", "Segoe UI", sans-serif !important;
249
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  .gradio-container { background: #faf9f5 !important; color: #141413 !important; }
 
 
 
 
 
 
251
  #layout { flex-wrap: nowrap !important; align-items: flex-start !important; gap: 22px !important; }
252
  #chat-col { min-width: 0 !important; flex: 1 1 auto !important; }
253
  #dial-col { flex: 0 0 340px !important; width: 340px !important; position: sticky; top: 8px; }
@@ -389,11 +420,28 @@ def build_demo():
389
  block_border_color="#e8e6dc",
390
  block_label_text_color="#6b6560",
391
  input_background_fill="#ffffff",
 
 
 
 
 
 
 
 
 
 
 
 
392
  button_primary_background_fill="#c96442",
 
393
  button_primary_background_fill_hover="#b55638",
 
394
  button_primary_text_color="#ffffff",
 
395
  button_secondary_background_fill="#f0eee6",
 
396
  button_secondary_text_color="#141413",
 
397
  )
398
  with gr.Blocks(title="Analogy Vector", theme=theme, css=DIAL_CSS, js=DIAL_JS) as demo:
399
  gr.Markdown(
 
247
  .gradio-container, .gradio-container * {
248
  font-family: "Source Sans 3", "Segoe UI", sans-serif !important;
249
  }
250
+ .gradio-container, .gradio-container.dark, .dark {
251
+ color-scheme: light !important;
252
+ --body-background-fill: #faf9f5;
253
+ --body-text-color: #141413;
254
+ --body-text-color-subdued: #6b6560;
255
+ --background-fill-primary: #faf9f5;
256
+ --background-fill-secondary: #f7f6f2;
257
+ --block-background-fill: #ffffff;
258
+ --block-border-color: #e8e6dc;
259
+ --block-label-text-color: #6b6560;
260
+ --block-title-text-color: #141413;
261
+ --input-background-fill: #ffffff;
262
+ --input-border-color: #e8e6dc;
263
+ --input-placeholder-color: #8a847c;
264
+ --button-secondary-background-fill: #f0eee6;
265
+ --button-secondary-text-color: #141413;
266
+ --button-primary-text-color: #ffffff;
267
+ --neutral-50: #faf9f5;
268
+ --neutral-100: #f0eee6;
269
+ --neutral-200: #e8e6dc;
270
+ --neutral-400: #8a847c;
271
+ --neutral-600: #6b6560;
272
+ --neutral-800: #141413;
273
+ --neutral-950: #141413;
274
+ }
275
  .gradio-container { background: #faf9f5 !important; color: #141413 !important; }
276
+ textarea, input, select, .prose, .prose p, .prose span, label, .cmp-body, .cmp-body b, .user-bubble, .guide, .guide p, .guide b {
277
+ color: #141413 !important;
278
+ }
279
+ .guide-kicker, .cmp.steered .cmp-label { color: #c96442 !important; }
280
+ textarea, input[type="text"], input[type="number"] { background: #ffffff !important; }
281
+ button.primary, button.primary * { color: #ffffff !important; }
282
  #layout { flex-wrap: nowrap !important; align-items: flex-start !important; gap: 22px !important; }
283
  #chat-col { min-width: 0 !important; flex: 1 1 auto !important; }
284
  #dial-col { flex: 0 0 340px !important; width: 340px !important; position: sticky; top: 8px; }
 
420
  block_border_color="#e8e6dc",
421
  block_label_text_color="#6b6560",
422
  input_background_fill="#ffffff",
423
+ input_background_fill_dark="#ffffff",
424
+ body_background_fill_dark="#faf9f5",
425
+ body_text_color_dark="#141413",
426
+ body_text_color_subdued="#6b6560",
427
+ body_text_color_subdued_dark="#6b6560",
428
+ block_background_fill_dark="#ffffff",
429
+ block_border_color_dark="#e8e6dc",
430
+ block_label_text_color_dark="#6b6560",
431
+ block_title_text_color="#141413",
432
+ block_title_text_color_dark="#141413",
433
+ input_placeholder_color="#8a847c",
434
+ input_placeholder_color_dark="#8a847c",
435
  button_primary_background_fill="#c96442",
436
+ button_primary_background_fill_dark="#c96442",
437
  button_primary_background_fill_hover="#b55638",
438
+ button_primary_background_fill_hover_dark="#b55638",
439
  button_primary_text_color="#ffffff",
440
+ button_primary_text_color_dark="#ffffff",
441
  button_secondary_background_fill="#f0eee6",
442
+ button_secondary_background_fill_dark="#f0eee6",
443
  button_secondary_text_color="#141413",
444
+ button_secondary_text_color_dark="#141413",
445
  )
446
  with gr.Blocks(title="Analogy Vector", theme=theme, css=DIAL_CSS, js=DIAL_JS) as demo:
447
  gr.Markdown(