AppleSwing commited on
Commit
8610f75
·
verified ·
1 Parent(s): 8bdf0fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +81 -59
app.py CHANGED
@@ -402,111 +402,133 @@ def parse_and_generate_plot(df_data: list, indices_str: str):
402
  def build_app() -> gr.Blocks:
403
  row_css = """
404
  /* ============================================================ */
405
- /* 1. CLEAN WHITE THEME (No Grey Backgrounds) */
406
  /* ============================================================ */
407
 
408
- /* Force main page to be white */
409
  body, .gradio-container {
410
- background-color: #ffffff !important;
411
- color: #000000 !important;
412
  }
413
 
414
- /* ============================================================ */
415
- /* 2. FIX THE DARK BLOCKS IN SCREENSHOT (Checkboxes & Inputs) */
416
- /* ============================================================ */
417
-
418
- /* Force all input labels (the checkboxes) to be white */
419
  .gradio-container label,
420
- .gradio-container .wrap,
421
- .gradio-container .block,
422
- .gradio-container fieldset {
423
- background-color: #ffffff !important;
424
- background: #ffffff !important;
425
- color: #000000 !important;
426
- }
427
-
428
- /* Force the text inside checkboxes to be black */
429
- .gradio-container label span {
430
- color: #000000 !important;
431
- background-color: transparent !important;
432
  }
433
 
434
- /* Force search bar and text inputs to be white */
435
  .gradio-container input,
436
- .gradio-container textarea {
 
437
  background-color: #ffffff !important;
438
- color: #000000 !important;
439
- border: 1px solid #e5e7eb !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  }
441
 
442
  /* ============================================================ */
443
- /* 3. LAYOUT & BORDERS */
444
  /* ============================================================ */
445
 
446
- /* Add light borders so white boxes are still visible against white bg */
447
- .search-box, .filter-section, .accordion, .table-container {
448
- border: 1px solid #e5e7eb !important;
449
- border-radius: 8px !important;
450
- padding: 15px !important;
451
- margin-bottom: 15px !important;
452
- box-shadow: none !important; /* Removed shadow for cleaner look */
453
  }
454
 
455
- /* Headings */
456
- .gradio-container h1, .gradio-container h2, .gradio-container h3 {
457
- color: #000000 !important;
 
 
 
458
  }
459
-
460
- /* Accordion Button (About Tasks) */
461
  .gradio-container .accordion button,
462
  .gradio-container .accordion span {
463
- color: #000000 !important;
464
- background-color: #ffffff !important;
465
  }
466
  .gradio-container .accordion svg {
467
- fill: #000000 !important;
468
  }
 
 
 
469
 
470
- /* Links */
471
- .gradio-container a { color: #2563eb !important; text-decoration: none; }
 
 
 
472
  .gradio-container a:hover { text-decoration: underline; }
473
 
 
 
 
474
  /* ============================================================ */
475
- /* 4. TABLE STYLING */
476
  /* ============================================================ */
477
 
478
  .table-container {
479
  overflow-x: auto; overflow-y: auto; max-height: 75vh;
 
 
480
  }
481
 
482
  .gradio-container table.metrics-table {
483
- width: 100%; border-collapse: collapse;
484
  }
485
 
486
  .gradio-container table.metrics-table th,
487
  .gradio-container table.metrics-table td {
488
- padding: 10px;
489
- border: 1px solid #e5e7eb;
490
- color: #000000 !important;
491
- background-color: #ffffff !important;
492
- font-size: 13px;
 
 
493
  }
494
 
495
- /* Header row - subtle grey just to distinguish headers */
496
  .gradio-container table.metrics-table th {
497
- background-color: #f9fafb !important;
498
- font-weight: bold;
499
- position: sticky; top: 0; z-index: 10;
500
  }
501
 
502
  /* Row Number Column */
503
  .metrics-table th:first-child, .metrics-table td:first-child {
504
- width: 50px; text-align: center;
505
- background-color: #f9fafb !important;
506
- font-weight: bold;
507
  }
508
-
509
- /* Plot container */
510
  .gradio-container .plot-container { width: 100% !important; }
511
  """
512
 
 
402
  def build_app() -> gr.Blocks:
403
  row_css = """
404
  /* ============================================================ */
405
+ /* GLOBAL RESET: Force Light Mode Colors Everywhere */
406
  /* ============================================================ */
407
 
408
+ /* 1. Main Backgrounds */
409
  body, .gradio-container {
410
+ background-color: #f5f7fa !important;
 
411
  }
412
 
413
+ /* 2. Force ALL Text to be Dark (overrides Dark Mode white text) */
414
+ .gradio-container,
415
+ .gradio-container p,
416
+ .gradio-container h1, .gradio-container h2, .gradio-container h3,
417
+ .gradio-container span,
418
  .gradio-container label,
419
+ .gradio-container div,
420
+ .gradio-container .prose,
421
+ .gradio-container .prose * {
422
+ color: #24292e !important;
 
 
 
 
 
 
 
 
423
  }
424
 
425
+ /* 3. Force Inputs (Search box) to be White with Dark Text */
426
  .gradio-container input,
427
+ .gradio-container textarea,
428
+ .gradio-container select {
429
  background-color: #ffffff !important;
430
+ color: #24292e !important;
431
+ border-color: #e1e4e8 !important;
432
+ }
433
+
434
+ /* 4. Fix Checkbox Groups (The dark rectangles in your screenshot) */
435
+ .gradio-container .wrap.default,
436
+ .gradio-container .block {
437
+ background-color: transparent !important; /* Removes blocky grey backgrounds */
438
+ }
439
+
440
+ /* The individual checkboxes */
441
+ .gradio-container label.svelte-1b8605,
442
+ .gradio-container label {
443
+ background-color: white !important;
444
+ border-color: #e1e4e8 !important;
445
+ }
446
+
447
+ /* Force checkbox text to be visible */
448
+ .gradio-container label span {
449
+ color: #24292e !important;
450
  }
451
 
452
  /* ============================================================ */
453
+ /* COMPONENT SPECIFIC STYLING */
454
  /* ============================================================ */
455
 
456
+ /* Search Box Container */
457
+ .search-box {
458
+ background: white !important; padding: 16px !important;
459
+ border-radius: 6px; border: 2px solid #e1e4e8 !important;
460
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); margin-bottom: 16px;
 
 
461
  }
462
 
463
+ /* Filter Section & Accordion Container */
464
+ .filter-section, .gradio-container .accordion {
465
+ background: white !important;
466
+ border: 2px solid #e1e4e8 !important;
467
+ border-radius: 6px !important;
468
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
469
  }
470
+
471
+ /* Accordion Header - Fix for Day/Night button colors */
472
  .gradio-container .accordion button,
473
  .gradio-container .accordion span {
474
+ background-color: white !important;
475
+ color: #24292e !important;
476
  }
477
  .gradio-container .accordion svg {
478
+ fill: #24292e !important; /* Arrows */
479
  }
480
+
481
+ /* Info Section (The invisible text area) */
482
+ .info-section { padding: 16px; background: white !important; }
483
 
484
+ /* Links should remain Blue */
485
+ .gradio-container a, .gradio-container .prose a {
486
+ color: #0366d6 !important;
487
+ text-decoration: none;
488
+ }
489
  .gradio-container a:hover { text-decoration: underline; }
490
 
491
+ /* Checkbox Accent Color */
492
+ .gradio-container input[type="checkbox"] { accent-color: #0366d6 !important; }
493
+
494
  /* ============================================================ */
495
+ /* TABLE STYLING */
496
  /* ============================================================ */
497
 
498
  .table-container {
499
  overflow-x: auto; overflow-y: auto; max-height: 75vh;
500
+ border: 2px solid #e1e4e8; border-radius: 6px;
501
+ background: white; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
502
  }
503
 
504
  .gradio-container table.metrics-table {
505
+ border-collapse: collapse; width: 100%; background: white !important;
506
  }
507
 
508
  .gradio-container table.metrics-table th,
509
  .gradio-container table.metrics-table td {
510
+ padding: 10px 14px;
511
+ border: 1.5px solid #e1e4e8;
512
+ white-space: nowrap;
513
+ font-size: 13px;
514
+ text-align: left;
515
+ background-color: white !important;
516
+ color: #24292e !important;
517
  }
518
 
 
519
  .gradio-container table.metrics-table th {
520
+ background: #f6f8fa !important; /* Light grey header */
521
+ font-weight: 600; position: sticky; top: 0; z-index: 10;
522
+ border-bottom: 2px solid #d1d5da;
523
  }
524
 
525
  /* Row Number Column */
526
  .metrics-table th:first-child, .metrics-table td:first-child {
527
+ width: 60px !important; text-align: center !important;
528
+ background-color: #f0f0f0 !important;
 
529
  }
530
+
531
+ /* Plot Container */
532
  .gradio-container .plot-container { width: 100% !important; }
533
  """
534