Umesh1608 commited on
Commit
12a8aeb
·
verified ·
1 Parent(s): 45b84c7

Switch to dark theme — dark boxes with light text

Browse files
Files changed (1) hide show
  1. app.py +33 -26
app.py CHANGED
@@ -153,15 +153,15 @@ def predict(sequence, inhibitor_choice, inhibitor_custom, inh_type, substrate_sm
153
  # ----------------------------------------------------------------------
154
 
155
  CSS = """
156
- /* Force a consistent LIGHT theme regardless of system dark-mode preference.
157
- We set BOTH backgrounds and text together so contrast is always guaranteed. */
158
 
159
  html, body, .gradio-container, .gradio-container .main {
160
- background: #ffffff !important;
161
- color: #111827 !important;
162
  }
163
 
164
- /* All Gradio block-level containers — force white/light backgrounds */
165
  .gradio-container .block,
166
  .gradio-container .form,
167
  .gradio-container .panel,
@@ -179,24 +179,29 @@ html, body, .gradio-container, .gradio-container .main {
179
  .gradio-container .prose,
180
  .gradio-container .markdown,
181
  .gradio-container .markdown-body {
182
- background-color: #ffffff !important;
183
- color: #111827 !important;
 
184
  }
185
 
186
- /* Inputs use a subtle gray */
187
  .gradio-container input,
188
  .gradio-container textarea,
189
  .gradio-container select,
190
  .gradio-container .gr-input,
191
  .gradio-container .gr-textarea {
192
- background-color: #f9fafb !important;
193
- color: #111827 !important;
194
- border-color: #d1d5db !important;
 
 
 
 
195
  }
196
 
197
  /* All text */
198
  .gradio-container, .gradio-container * {
199
- color: #111827 !important;
200
  }
201
  .gradio-container h1,
202
  .gradio-container h2,
@@ -206,38 +211,40 @@ html, body, .gradio-container, .gradio-container .main {
206
  .gradio-container h6,
207
  .gradio-container strong,
208
  .gradio-container b {
209
- color: #0f172a !important;
210
  }
211
 
212
  /* Tables */
213
  .gradio-container table {
214
- background-color: #ffffff !important;
215
- border-color: #e5e7eb !important;
216
  }
217
  .gradio-container table th,
218
  .gradio-container table td {
219
- color: #1f2937 !important;
220
- background-color: #ffffff !important;
221
- border-color: #e5e7eb !important;
222
  }
223
  .gradio-container table th {
224
- background-color: #f3f4f6 !important;
 
225
  }
226
 
227
- /* Links and inline code */
228
- .gradio-container a { color: #2563eb !important; }
229
  .gradio-container code {
230
- background-color: #f3f4f6 !important;
231
- color: #be185d !important;
232
  }
233
 
234
- /* Primary buttons keep dark-blue background with white text */
235
  .gradio-container button.primary,
236
  .gradio-container button.lg.primary,
237
  .gradio-container .primary,
238
  .gradio-container .primary * {
239
  background: #2563eb !important;
240
  color: #ffffff !important;
 
241
  }
242
 
243
  /* Title block layout */
@@ -245,8 +252,8 @@ html, body, .gradio-container, .gradio-container .main {
245
 
246
  /* Ki result card */
247
  .ki-card {
248
- background: #ffffff !important;
249
- border: 1px solid #d1d5db !important;
250
  border-radius: 8px !important;
251
  padding: 1em 1.5em !important;
252
  }
 
153
  # ----------------------------------------------------------------------
154
 
155
  CSS = """
156
+ /* Force a consistent DARK theme regardless of system preference.
157
+ Dark backgrounds with light text — both set together so contrast is guaranteed. */
158
 
159
  html, body, .gradio-container, .gradio-container .main {
160
+ background: #0b1220 !important;
161
+ color: #f3f4f6 !important;
162
  }
163
 
164
+ /* All Gradio block-level containers — force dark backgrounds */
165
  .gradio-container .block,
166
  .gradio-container .form,
167
  .gradio-container .panel,
 
179
  .gradio-container .prose,
180
  .gradio-container .markdown,
181
  .gradio-container .markdown-body {
182
+ background-color: #111827 !important;
183
+ color: #f3f4f6 !important;
184
+ border-color: #374151 !important;
185
  }
186
 
187
+ /* Inputs slightly lighter slate so they stand out from the page */
188
  .gradio-container input,
189
  .gradio-container textarea,
190
  .gradio-container select,
191
  .gradio-container .gr-input,
192
  .gradio-container .gr-textarea {
193
+ background-color: #1f2937 !important;
194
+ color: #f9fafb !important;
195
+ border-color: #374151 !important;
196
+ }
197
+ .gradio-container input::placeholder,
198
+ .gradio-container textarea::placeholder {
199
+ color: #9ca3af !important;
200
  }
201
 
202
  /* All text */
203
  .gradio-container, .gradio-container * {
204
+ color: #f3f4f6 !important;
205
  }
206
  .gradio-container h1,
207
  .gradio-container h2,
 
211
  .gradio-container h6,
212
  .gradio-container strong,
213
  .gradio-container b {
214
+ color: #ffffff !important;
215
  }
216
 
217
  /* Tables */
218
  .gradio-container table {
219
+ background-color: #111827 !important;
220
+ border-color: #374151 !important;
221
  }
222
  .gradio-container table th,
223
  .gradio-container table td {
224
+ color: #e5e7eb !important;
225
+ background-color: #111827 !important;
226
+ border-color: #374151 !important;
227
  }
228
  .gradio-container table th {
229
+ background-color: #1f2937 !important;
230
+ color: #ffffff !important;
231
  }
232
 
233
+ /* Links and inline code — bright accent colors that pop on dark */
234
+ .gradio-container a { color: #93c5fd !important; }
235
  .gradio-container code {
236
+ background-color: #1f2937 !important;
237
+ color: #fbcfe8 !important;
238
  }
239
 
240
+ /* Primary buttons keep vivid blue with white text */
241
  .gradio-container button.primary,
242
  .gradio-container button.lg.primary,
243
  .gradio-container .primary,
244
  .gradio-container .primary * {
245
  background: #2563eb !important;
246
  color: #ffffff !important;
247
+ border-color: #1d4ed8 !important;
248
  }
249
 
250
  /* Title block layout */
 
252
 
253
  /* Ki result card */
254
  .ki-card {
255
+ background: #111827 !important;
256
+ border: 1px solid #374151 !important;
257
  border-radius: 8px !important;
258
  padding: 1em 1.5em !important;
259
  }