Quazim0t0 commited on
Commit
c73c631
·
verified ·
1 Parent(s): 4c5c1ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +43 -38
app.py CHANGED
@@ -50,21 +50,22 @@ if not benchmarks or len(benchmarks) == 0:
50
  else:
51
  print(f"Found {len(benchmarks)} existing benchmarks.")
52
 
53
- # Custom CSS with fixes for text visibility
54
  css = """
55
- /* Fix for text visibility */
56
- .gradio-container {
57
- color: #333333 !important;
58
- }
59
-
60
- /* Fix for info boxes */
61
  .info-text {
62
- background-color: #f0f7ff;
63
  padding: 12px;
64
  border-radius: 8px;
65
  border-left: 4px solid #3498db;
66
  margin: 12px 0;
67
- color: #222222 !important;
 
 
 
 
 
 
68
  }
69
 
70
  /* Container styling */
@@ -77,7 +78,8 @@ css = """
77
  .header {
78
  text-align: center;
79
  margin-bottom: 20px;
80
- color: #222222 !important;
 
81
  }
82
 
83
  /* Footer styling */
@@ -85,49 +87,52 @@ css = """
85
  text-align: center;
86
  margin-top: 40px;
87
  padding: 20px;
88
- border-top: 1px solid #eee;
89
- color: #222222 !important;
90
  }
91
 
92
- /* Fix for tab content */
93
- .tab-content {
94
- color: #222222 !important;
 
95
  }
96
 
97
- /* Fix for highlighted text areas */
98
- .highlight-text {
99
- background-color: #f0f7ff;
100
- color: #333333;
101
  }
102
 
103
- /* Fix for dataframes */
104
- table.dataframe {
105
- color: #333333 !important;
 
106
  }
107
 
108
- /* Fix for dropdown text */
109
- select, option {
110
- color: #333333 !important;
111
  }
112
 
113
- /* Fix for button text */
114
- button {
115
- color: #ffffff !important;
116
  }
117
 
118
- /* Fix for input fields */
119
- input, textarea {
120
- color: #333333 !important;
121
  }
122
 
123
- /* General text fix */
124
- p, h1, h2, h3, h4, h5, h6, span, div {
125
- color: #333333 !important;
126
  }
127
 
128
- /* Ensure markdown is visible */
129
- .markdown-text {
130
- color: #333333 !important;
 
 
131
  }
132
  """
133
 
@@ -142,7 +147,7 @@ def start_queue_worker():
142
  print(f"Error starting queue worker: {e}")
143
 
144
  # Create Gradio app
145
- with gr.Blocks(css=css, title="Dynamic Highscores") as app:
146
  gr.Markdown("# 🏆 Dynamic Highscores", elem_classes=["header"])
147
  gr.Markdown("""
148
  Welcome to Dynamic Highscores - a community benchmark platform for evaluating and comparing language models.
 
50
  else:
51
  print(f"Found {len(benchmarks)} existing benchmarks.")
52
 
53
+ # Custom CSS with better theme compatibility
54
  css = """
55
+ /* Theme-adaptive colored info box */
 
 
 
 
 
56
  .info-text {
57
+ background-color: rgba(53, 130, 220, 0.1);
58
  padding: 12px;
59
  border-radius: 8px;
60
  border-left: 4px solid #3498db;
61
  margin: 12px 0;
62
+ }
63
+
64
+ /* High-contrast text for elements - works in light and dark themes */
65
+ .info-text, .header, .footer, .tab-content,
66
+ button, input, textarea, select, option,
67
+ .gradio-container *, .markdown-text {
68
+ color: var(--text-color, inherit) !important;
69
  }
70
 
71
  /* Container styling */
 
78
  .header {
79
  text-align: center;
80
  margin-bottom: 20px;
81
+ font-weight: bold;
82
+ font-size: 24px;
83
  }
84
 
85
  /* Footer styling */
 
87
  text-align: center;
88
  margin-top: 40px;
89
  padding: 20px;
90
+ border-top: 1px solid var(--border-color-primary, #eee);
 
91
  }
92
 
93
+ /* Force high contrast on specific input areas */
94
+ input[type="text"], input[type="password"], textarea {
95
+ background-color: var(--background-fill-primary) !important;
96
+ color: var(--body-text-color) !important;
97
  }
98
 
99
+ /* Force text visibility in multiple contexts */
100
+ .gradio-markdown p, .gradio-markdown h1, .gradio-markdown h2,
101
+ .gradio-markdown h3, .gradio-markdown h4, .gradio-markdown li {
102
+ color: var(--body-text-color) !important;
103
  }
104
 
105
+ /* Make Textbox placeholders more visible */
106
+ ::placeholder {
107
+ color: var(--body-text-color-subdued) !important;
108
+ opacity: 0.7 !important;
109
  }
110
 
111
+ /* Make tab labels more visible */
112
+ .tab-nav button {
113
+ color: var(--body-text-color) !important;
114
  }
115
 
116
+ /* Improve contrast in dataframes */
117
+ table.dataframe th, table.dataframe td {
118
+ color: var(--body-text-color) !important;
119
  }
120
 
121
+ /* Ensure buttons have visible text */
122
+ button.primary {
123
+ color: white !important;
124
  }
125
 
126
+ /* Force high contrast for dropdown/select options */
127
+ .select-option {
128
+ color: var(--body-text-color) !important;
129
  }
130
 
131
+ /* Improve visibility in dark mode specifically */
132
+ @media (prefers-color-scheme: dark) {
133
+ .info-text {
134
+ background-color: rgba(53, 130, 220, 0.2);
135
+ }
136
  }
137
  """
138
 
 
147
  print(f"Error starting queue worker: {e}")
148
 
149
  # Create Gradio app
150
+ with gr.Blocks(css=css, title="Dynamic Highscores", theme=gr.themes.Default()) as app:
151
  gr.Markdown("# 🏆 Dynamic Highscores", elem_classes=["header"])
152
  gr.Markdown("""
153
  Welcome to Dynamic Highscores - a community benchmark platform for evaluating and comparing language models.