willwim commited on
Commit
2841d28
Β·
verified Β·
1 Parent(s): 664b8d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +69 -24
app.py CHANGED
@@ -375,13 +375,20 @@ def adr_predict(x):
375
 
376
  # ── UI ─────────────────────────────────────────────────────────────────────────
377
  custom_css = """
378
- /* ── Global background ── */
379
  body,
380
  .gradio-container,
381
  .main,
382
- .contain {
383
- background: #f4f6f9 !important;
 
384
  font-family: 'Inter', system-ui, sans-serif !important;
 
 
 
 
 
 
385
  }
386
 
387
  /* ── Uniform white card ── */
@@ -390,72 +397,110 @@ body,
390
  border: 1px solid #e2e6ea !important;
391
  border-radius: 12px !important;
392
  padding: 20px !important;
393
- box-shadow: 0 1px 4px rgba(0,0,0,0.07) !important;
394
- color: #111 !important;
395
  margin-bottom: 12px !important;
396
  }
397
 
398
- /* Header card centred */
 
 
 
 
 
 
 
 
 
 
 
 
399
  .header-card {
400
  text-align: center !important;
401
  margin-bottom: 18px !important;
402
  }
403
 
404
- /* ── Card section label ── */
405
  .card-label {
406
  font-size: 0.72em !important;
407
  font-weight: 700 !important;
408
  letter-spacing: 0.1em !important;
409
  text-transform: uppercase !important;
410
- color: #888 !important;
411
  margin: 0 0 10px 0 !important;
412
  padding: 0 !important;
 
413
  }
414
 
415
- /* Strip inner Gradio borders inside cards */
416
  .card > .form,
 
 
417
  .card [data-testid="label"],
418
  .card .label-container,
419
  .card .label-wrap,
420
- .card .prose {
 
421
  background: transparent !important;
422
  border: none !important;
423
  box-shadow: none !important;
424
  padding: 0 !important;
425
- color: #111 !important;
426
  }
427
 
428
- /* Label bar text */
429
- .card .label-wrap span,
430
- .card .label-wrap p,
431
- .card .label-wrap div {
432
- color: #111 !important;
 
433
  }
434
 
435
- /* Textbox */
436
  .card textarea,
437
- .card input[type="text"] {
 
438
  background: #fafafa !important;
439
- color: #111 !important;
440
  border: 1px solid #dde1e7 !important;
441
  border-radius: 8px !important;
442
  }
 
 
 
 
 
 
 
 
 
 
 
443
 
444
- /* Examples table */
 
445
  .card .examples table,
446
  .card .examples td,
447
- .card .examples th {
 
448
  background: #ffffff !important;
449
- color: #111 !important;
450
  border-color: #e2e6ea !important;
451
  }
452
 
453
- /* Run button full width */
454
  .run-btn {
455
  width: 100% !important;
456
  margin-top: 10px !important;
457
  }
458
 
 
 
 
 
 
 
 
 
459
  footer { visibility: hidden; }
460
  """
461
 
@@ -535,4 +580,4 @@ with gr.Blocks(title="ADR Detector") as demo:
535
  outputs=[label, severity_out, shap_out, htext_out],
536
  )
537
 
538
- demo.launch(theme=gr.themes.Base(), css=custom_css)
 
375
 
376
  # ── UI ─────────────────────────────────────────────────────────────────────────
377
  custom_css = """
378
+ /* ── Global: light grey page background, dark text everywhere ── */
379
  body,
380
  .gradio-container,
381
  .main,
382
+ .contain,
383
+ .gap {
384
+ background-color: #f4f6f9 !important;
385
  font-family: 'Inter', system-ui, sans-serif !important;
386
+ color: #111111 !important;
387
+ }
388
+
389
+ /* Force ALL text dark by default */
390
+ *, *::before, *::after {
391
+ color: inherit;
392
  }
393
 
394
  /* ── Uniform white card ── */
 
397
  border: 1px solid #e2e6ea !important;
398
  border-radius: 12px !important;
399
  padding: 20px !important;
400
+ box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
401
+ color: #111111 !important;
402
  margin-bottom: 12px !important;
403
  }
404
 
405
+ /* Every text node inside a card */
406
+ .card *,
407
+ .card p,
408
+ .card span,
409
+ .card div,
410
+ .card label,
411
+ .card h1, .card h2, .card h3,
412
+ .card td, .card th,
413
+ .card button:not(.primary) {
414
+ color: #111111 !important;
415
+ }
416
+
417
+ /* Header card */
418
  .header-card {
419
  text-align: center !important;
420
  margin-bottom: 18px !important;
421
  }
422
 
423
+ /* ── Card section label (uppercase caption) ── */
424
  .card-label {
425
  font-size: 0.72em !important;
426
  font-weight: 700 !important;
427
  letter-spacing: 0.1em !important;
428
  text-transform: uppercase !important;
429
+ color: #777777 !important;
430
  margin: 0 0 10px 0 !important;
431
  padding: 0 !important;
432
+ display: block !important;
433
  }
434
 
435
+ /* Strip double borders / backgrounds from inner Gradio wrappers */
436
  .card > .form,
437
+ .card > .block,
438
+ .card .wrap,
439
  .card [data-testid="label"],
440
  .card .label-container,
441
  .card .label-wrap,
442
+ .card .prose,
443
+ .card .md {
444
  background: transparent !important;
445
  border: none !important;
446
  box-shadow: none !important;
447
  padding: 0 !important;
 
448
  }
449
 
450
+ /* ── Gradio Label (probability bar) ── */
451
+ .card .label-wrap,
452
+ .card .label-wrap *,
453
+ .card [data-testid="label"] * {
454
+ background: transparent !important;
455
+ color: #111111 !important;
456
  }
457
 
458
+ /* ── Textbox ── */
459
  .card textarea,
460
+ .card input[type="text"],
461
+ .card input {
462
  background: #fafafa !important;
463
+ color: #111111 !important;
464
  border: 1px solid #dde1e7 !important;
465
  border-radius: 8px !important;
466
  }
467
+ .card textarea::placeholder,
468
+ .card input::placeholder {
469
+ color: #999999 !important;
470
+ }
471
+
472
+ /* ── Textbox label text ── */
473
+ .card .svelte-1f354aw,
474
+ .card label > span {
475
+ color: #333333 !important;
476
+ font-weight: 600 !important;
477
+ }
478
 
479
+ /* ── Examples table ── */
480
+ .card .examples,
481
  .card .examples table,
482
  .card .examples td,
483
+ .card .examples th,
484
+ .card .examples button {
485
  background: #ffffff !important;
486
+ color: #111111 !important;
487
  border-color: #e2e6ea !important;
488
  }
489
 
490
+ /* ── Run button ── */
491
  .run-btn {
492
  width: 100% !important;
493
  margin-top: 10px !important;
494
  }
495
 
496
+ /* ── Processing spinner area ── */
497
+ .card .generating,
498
+ .card .eta-bar,
499
+ .card .progress-bar {
500
+ background: #f0f0f0 !important;
501
+ color: #555555 !important;
502
+ }
503
+
504
  footer { visibility: hidden; }
505
  """
506
 
 
580
  outputs=[label, severity_out, shap_out, htext_out],
581
  )
582
 
583
+ demo.launch(theme=gr.themes.Default(), css=custom_css)