ha251 commited on
Commit
33f2af5
·
verified ·
1 Parent(s): 18d30a1

Update miniapp_leaderboard.py

Browse files
Files changed (1) hide show
  1. miniapp_leaderboard.py +27 -26
miniapp_leaderboard.py CHANGED
@@ -382,7 +382,6 @@ def submit(
382
  return "Submitted successfully.", render_lb(search_text, sort_col, sort_dir)
383
 
384
 
385
- # ✅ 强制覆盖成浅灰线:用 !important,避免被主题样式覆盖成黑线
386
  CSS = r"""
387
  .gradio-container { max-width: 100% !important; }
388
  #page { padding: 16px; }
@@ -400,7 +399,7 @@ CSS = r"""
400
  }
401
  #searchbox textarea::placeholder, #searchbox input::placeholder { color: #9ca3af; }
402
 
403
- /* table container */
404
  .table-wrap{
405
  width: 100%;
406
  border: 1px solid #e5e7eb !important;
@@ -408,49 +407,50 @@ CSS = r"""
408
  background: #fff;
409
  }
410
  .table-scroll{ width: 100%; overflow-x: auto; }
411
- table.table{
412
- width: 100%;
413
- border-collapse: separate;
414
- border-spacing: 0;
415
  min-width: 1100px;
 
 
 
 
 
 
 
416
  }
417
 
418
- /* header */
419
- th.th{
420
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial !important;
421
  font-weight: 600;
422
  font-size: 13px;
423
  color: #111827;
424
  padding: 10px 12px;
425
  text-align: center;
426
- background: #f9fafb;
427
- border-bottom: 1px solid #e5e7eb !important;
428
- border-right: 1px solid #e5e7eb !important;
429
  white-space: nowrap;
430
  }
431
- thead tr.r3 th.th { background: #ffffff; }
432
- th.th.left{ text-align:left; }
433
- th.group{ color:#374151; font-weight:600; }
434
- th.th:last-child{ border-right: none !important; }
435
 
436
  /* body */
437
- td.td{
438
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial !important;
439
  font-size: 13px;
440
  color: #111827;
441
  padding: 10px 12px;
442
- border-bottom: 1px solid #f0f1f3 !important;
443
- border-right: 1px solid #f0f1f3 !important;
444
- background: #fff;
445
  }
446
- td.td:last-child{ border-right: none !important; }
447
- td.num{ text-align:right; }
448
- td.model{ text-align:left; min-width: 280px; }
449
- tr.tr:hover td.td{ background: #fafafa; }
450
 
451
- /* clickable sort */
452
- th.clickable{ cursor:pointer; user-select:none; }
453
- th.clickable:hover{ background:#f3f4f6; }
454
 
455
  /* submit */
456
  #submit_card{
@@ -468,6 +468,7 @@ th.clickable:hover{ background:#f3f4f6; }
468
  }
469
  """
470
 
 
471
  with gr.Blocks(title=f"{APP_NAME} leaderboard") as demo:
472
  with gr.Column(elem_id="page"):
473
  with gr.Row(elem_id="topbar"):
 
382
  return "Submitted successfully.", render_lb(search_text, sort_col, sort_dir)
383
 
384
 
 
385
  CSS = r"""
386
  .gradio-container { max-width: 100% !important; }
387
  #page { padding: 16px; }
 
399
  }
400
  #searchbox textarea::placeholder, #searchbox input::placeholder { color: #9ca3af; }
401
 
402
+ /* 容器 */
403
  .table-wrap{
404
  width: 100%;
405
  border: 1px solid #e5e7eb !important;
 
407
  background: #fff;
408
  }
409
  .table-scroll{ width: 100%; overflow-x: auto; }
410
+
411
+ /* ===== 关键:把所有黑边框强制变浅灰 ===== */
412
+ #lb_table {
413
+ width: 100% !important;
414
  min-width: 1100px;
415
+ border-collapse: collapse !important;
416
+ border: 1px solid #e5e7eb !important;
417
+ }
418
+ #lb_table th,
419
+ #lb_table td{
420
+ border: 1px solid #e5e7eb !important; /* 覆盖所有黑线来源 */
421
+ border-color: #e5e7eb !important;
422
  }
423
 
424
+ /* 表头 */
425
+ #lb_table thead th.th{
426
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial !important;
427
  font-weight: 600;
428
  font-size: 13px;
429
  color: #111827;
430
  padding: 10px 12px;
431
  text-align: center;
432
+ background: #f9fafb !important;
 
 
433
  white-space: nowrap;
434
  }
435
+ #lb_table thead tr.r3 th.th { background: #ffffff !important; }
436
+ #lb_table th.left{ text-align:left !important; }
437
+ #lb_table th.group{ color:#374151 !important; font-weight:600 !important; }
 
438
 
439
  /* body */
440
+ #lb_table tbody td.td{
441
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial !important;
442
  font-size: 13px;
443
  color: #111827;
444
  padding: 10px 12px;
445
+ background: #fff !important;
 
 
446
  }
447
+ #lb_table td.num{ text-align:right !important; }
448
+ #lb_table td.model{ text-align:left !important; min-width: 280px; }
449
+ #lb_table tbody tr.tr:hover td.td{ background: #fafafa !important; }
 
450
 
451
+ /* 可点击排序 */
452
+ #lb_table th.clickable{ cursor:pointer; user-select:none; }
453
+ #lb_table th.clickable:hover{ background:#f3f4f6 !important; }
454
 
455
  /* submit */
456
  #submit_card{
 
468
  }
469
  """
470
 
471
+
472
  with gr.Blocks(title=f"{APP_NAME} leaderboard") as demo:
473
  with gr.Column(elem_id="page"):
474
  with gr.Row(elem_id="topbar"):