jmontp commited on
Commit
5c8e33a
·
1 Parent(s): a6fc515

Fix text visibility issues with explicit color declarations

Browse files
Files changed (1) hide show
  1. shared_styling.py +115 -17
shared_styling.py CHANGED
@@ -42,6 +42,7 @@ def get_base_css():
42
  /* Main background styling */
43
  .stApp {{
44
  background: linear-gradient(135deg, {COLORS['background']} 0%, {COLORS['figure_background']} 100%);
 
45
  }}
46
 
47
  .main .block-container {{
@@ -51,6 +52,38 @@ def get_base_css():
51
  border-radius: 15px;
52
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
53
  margin-top: 1rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }}
55
 
56
  /* Sidebar styling */
@@ -67,16 +100,23 @@ def get_base_css():
67
  section[data-testid="stSidebar"] {{
68
  background: linear-gradient(135deg, {COLORS['sidebar_bg_start']} 0%, {COLORS['sidebar_bg_end']} 100%);
69
  border-right: 2px solid {COLORS['border_light']};
 
70
  }}
71
 
72
  section[data-testid="stSidebar"] > div {{
73
  background: linear-gradient(135deg, {COLORS['sidebar_bg_start']} 0%, {COLORS['sidebar_bg_end']} 100%);
74
  padding-top: 2rem;
 
 
 
 
 
 
75
  }}
76
 
77
  /* Sidebar title styling */
78
  section[data-testid="stSidebar"] h1 {{
79
- color: {COLORS['text_primary']};
80
  border-bottom: 2px solid {COLORS['border_medium']};
81
  padding-bottom: 0.5rem;
82
  margin-bottom: 1rem;
@@ -88,7 +128,7 @@ def get_base_css():
88
  margin-top: 1rem;
89
  margin-bottom: 1rem;
90
  background: linear-gradient(45deg, {COLORS['button_bg_start']}, {COLORS['button_bg_end']});
91
- color: white;
92
  border: none;
93
  border-radius: 10px;
94
  padding: 0.75rem 1rem;
@@ -101,6 +141,7 @@ def get_base_css():
101
  background: linear-gradient(45deg, {COLORS['button_hover_start']}, {COLORS['button_hover_end']});
102
  transform: translateY(-2px);
103
  box-shadow: 0 4px 15px rgba(107, 107, 107, 0.3);
 
104
  }}
105
 
106
  /* Input styling */
@@ -108,12 +149,13 @@ def get_base_css():
108
  background-color: {COLORS['background']};
109
  border: 2px solid {COLORS['border_light']};
110
  border-radius: 8px;
111
- color: {COLORS['text_primary']};
112
  }}
113
 
114
  .stTextInput>div>div>input:focus {{
115
  border-color: {COLORS['button_bg_start']};
116
  box-shadow: 0 0 0 2px rgba(107, 107, 107, 0.1);
 
117
  }}
118
 
119
  /* Selectbox and multiselect styling */
@@ -121,12 +163,14 @@ def get_base_css():
121
  background-color: {COLORS['background']};
122
  border: 2px solid {COLORS['border_light']};
123
  border-radius: 8px;
 
124
  }}
125
 
126
  .stMultiSelect>div>div>div {{
127
  background-color: {COLORS['background']};
128
  border: 2px solid {COLORS['border_light']};
129
  border-radius: 8px;
 
130
  }}
131
 
132
  /* Radio button styling */
@@ -134,12 +178,18 @@ def get_base_css():
134
  background-color: {COLORS['background']};
135
  border-radius: 8px;
136
  padding: 10px;
 
 
 
 
 
137
  }}
138
 
139
  /* Sidebar content styling */
140
  .sidebar .sidebar-content {{
141
  padding-top: 1rem;
142
  background-color: {COLORS['sidebar_bg_start']};
 
143
  }}
144
 
145
  hr {{
@@ -150,27 +200,32 @@ def get_base_css():
150
  h1 {{
151
  padding-bottom: 1rem;
152
  border-bottom: 3px solid {COLORS['border_medium']};
153
- color: {COLORS['text_primary']};
154
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
155
  }}
156
 
157
  h2 {{
158
  margin-top: 2rem;
159
  padding-bottom: 0.5rem;
160
- color: {COLORS['text_secondary']};
161
  font-weight: 600;
162
  }}
163
 
164
  h3 {{
165
  margin-top: 1.5rem;
166
- color: {COLORS['text_tertiary']};
167
  font-weight: 600;
168
  }}
169
 
 
 
 
 
 
170
  /* Alert box styling */
171
  .auth-alert {{
172
  background: linear-gradient(135deg, {COLORS['alert_error_bg']} 0%, #FFCCCC 100%);
173
- color: {COLORS['alert_error_text']};
174
  padding: 15px;
175
  border-radius: 10px;
176
  margin: 15px 0;
@@ -180,7 +235,7 @@ def get_base_css():
180
 
181
  .auth-info {{
182
  background: linear-gradient(135deg, {COLORS['alert_info_bg']} 0%, #CCE7FF 100%);
183
- color: {COLORS['alert_info_text']};
184
  padding: 15px;
185
  border-radius: 10px;
186
  margin: 15px 0;
@@ -193,6 +248,7 @@ def get_base_css():
193
  background: linear-gradient(135deg, {COLORS['alert_info_bg']} 0%, #CCE7FF 100%);
194
  border: 1px solid {COLORS['text_secondary']};
195
  border-radius: 8px;
 
196
  }}
197
 
198
  .info-box {{
@@ -202,6 +258,7 @@ def get_base_css():
202
  border-radius: 10px;
203
  margin: 20px 0;
204
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
 
205
  }}
206
 
207
  .warning-box {{
@@ -211,6 +268,7 @@ def get_base_css():
211
  border-radius: 10px;
212
  margin: 20px 0;
213
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
 
214
  }}
215
 
216
  .success-box {{
@@ -220,6 +278,7 @@ def get_base_css():
220
  border-radius: 10px;
221
  margin: 20px 0;
222
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
 
223
  }}
224
 
225
  .centered {{
@@ -233,7 +292,7 @@ def get_base_css():
233
  .footer {{
234
  text-align: center;
235
  font-size: 0.8rem;
236
- color: {COLORS['text_light']};
237
  margin-top: 2rem;
238
  padding-top: 1rem;
239
  border-top: 1px solid {COLORS['border_light']};
@@ -255,6 +314,7 @@ def get_home_page_css():
255
  background: linear-gradient(135deg, {COLORS['background']} 0%, {COLORS['figure_background']} 100%);
256
  transition: all 0.3s ease;
257
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
 
258
  }}
259
 
260
  .nav-button:hover {{
@@ -262,13 +322,18 @@ def get_home_page_css():
262
  transform: translateY(-3px);
263
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
264
  border-color: {COLORS['text_secondary']};
 
265
  }}
266
 
267
  .nav-button h3 {{
268
- color: {COLORS['text_secondary']};
269
  margin-bottom: 0.5rem;
270
  }}
271
 
 
 
 
 
272
  /* Description boxes */
273
  .description-box {{
274
  text-align: center;
@@ -278,13 +343,18 @@ def get_home_page_css():
278
  margin-top: -10px;
279
  background: linear-gradient(135deg, {COLORS['background']} 0%, {COLORS['figure_background']} 100%);
280
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
 
281
  }}
282
 
283
  .description-box p {{
284
- color: {COLORS['text_secondary']};
285
  margin: 0;
286
  font-weight: 500;
287
  }}
 
 
 
 
288
  </style>
289
  """
290
 
@@ -299,11 +369,16 @@ def get_documentation_page_css():
299
  margin-bottom: 20px;
300
  border: 2px solid {COLORS['border_medium']};
301
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
 
 
 
 
 
302
  }}
303
 
304
  .caption {{
305
  font-size: 0.85rem;
306
- color: {COLORS['text_light']};
307
  text-align: center;
308
  margin-top: 5px;
309
  font-style: italic;
@@ -316,11 +391,16 @@ def get_documentation_page_css():
316
  border: 2px solid {COLORS['border_medium']};
317
  margin: 10px 0;
318
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
 
 
 
 
 
319
  }}
320
 
321
  .step-number {{
322
  background: linear-gradient(45deg, {COLORS['button_bg_start']}, {COLORS['button_bg_end']});
323
- color: white;
324
  border-radius: 50%;
325
  width: 30px;
326
  height: 30px;
@@ -340,12 +420,17 @@ def get_documentation_page_css():
340
  border-left: 4px solid {COLORS['text_secondary']};
341
  margin: 10px 0;
342
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
 
 
 
 
 
343
  }}
344
 
345
  .term-title {{
346
  font-size: 1.2rem;
347
  font-weight: bold;
348
- color: {COLORS['text_secondary']};
349
  margin-bottom: 8px;
350
  }}
351
 
@@ -356,6 +441,11 @@ def get_documentation_page_css():
356
  margin: 20px 0;
357
  border-left: 4px solid {COLORS['text_tertiary']};
358
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
 
 
 
 
 
359
  }}
360
 
361
  .formula {{
@@ -365,7 +455,7 @@ def get_documentation_page_css():
365
  font-family: monospace;
366
  margin: 5px 0;
367
  border: 1px solid {COLORS['border_light']};
368
- color: {COLORS['text_primary']};
369
  }}
370
  </style>
371
  """
@@ -379,7 +469,7 @@ def get_tool_page_css():
379
  background-color: {COLORS['figure_background']};
380
  border: 2px solid {COLORS['border_medium']};
381
  border-radius: 8px;
382
- color: {COLORS['text_primary']};
383
  font-weight: 600;
384
  }}
385
 
@@ -387,6 +477,11 @@ def get_tool_page_css():
387
  background-color: {COLORS['background']};
388
  border: 1px solid {COLORS['border_light']};
389
  border-radius: 0 0 8px 8px;
 
 
 
 
 
390
  }}
391
 
392
  /* Tooltip styles */
@@ -394,12 +489,13 @@ def get_tool_page_css():
394
  position: relative;
395
  display: inline-block;
396
  width: 100%;
 
397
  }}
398
 
399
  .tooltip-content {{
400
  visibility: hidden;
401
  background-color: {COLORS['background']};
402
- color: {COLORS['text_primary']};
403
  text-align: left;
404
  padding: 10px;
405
  border-radius: 8px;
@@ -421,6 +517,7 @@ def get_tool_page_css():
421
  display: flex;
422
  align-items: center;
423
  margin: 5px 0;
 
424
  }}
425
 
426
  .color-box {{
@@ -446,6 +543,7 @@ def get_tool_page_css():
446
  background: linear-gradient(45deg, {COLORS['generate_button_hover']}, #7CFC00) !important;
447
  transform: translateY(-3px) !important;
448
  box-shadow: 0 5px 20px rgba(34, 139, 34, 0.4) !important;
 
449
  }}
450
  </style>
451
  """
 
42
  /* Main background styling */
43
  .stApp {{
44
  background: linear-gradient(135deg, {COLORS['background']} 0%, {COLORS['figure_background']} 100%);
45
+ color: {COLORS['text_primary']} !important;
46
  }}
47
 
48
  .main .block-container {{
 
52
  border-radius: 15px;
53
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
54
  margin-top: 1rem;
55
+ color: {COLORS['text_primary']} !important;
56
+ }}
57
+
58
+ /* Explicit text color styling for all elements */
59
+ .stApp, .stApp * {{
60
+ color: {COLORS['text_primary']} !important;
61
+ }}
62
+
63
+ /* Main content text */
64
+ .main .block-container p {{
65
+ color: {COLORS['text_primary']} !important;
66
+ }}
67
+
68
+ .main .block-container div {{
69
+ color: {COLORS['text_primary']} !important;
70
+ }}
71
+
72
+ .main .block-container span {{
73
+ color: {COLORS['text_primary']} !important;
74
+ }}
75
+
76
+ /* Streamlit markdown text */
77
+ .stMarkdown {{
78
+ color: {COLORS['text_primary']} !important;
79
+ }}
80
+
81
+ .stMarkdown p {{
82
+ color: {COLORS['text_primary']} !important;
83
+ }}
84
+
85
+ .stMarkdown div {{
86
+ color: {COLORS['text_primary']} !important;
87
  }}
88
 
89
  /* Sidebar styling */
 
100
  section[data-testid="stSidebar"] {{
101
  background: linear-gradient(135deg, {COLORS['sidebar_bg_start']} 0%, {COLORS['sidebar_bg_end']} 100%);
102
  border-right: 2px solid {COLORS['border_light']};
103
+ color: {COLORS['text_primary']} !important;
104
  }}
105
 
106
  section[data-testid="stSidebar"] > div {{
107
  background: linear-gradient(135deg, {COLORS['sidebar_bg_start']} 0%, {COLORS['sidebar_bg_end']} 100%);
108
  padding-top: 2rem;
109
+ color: {COLORS['text_primary']} !important;
110
+ }}
111
+
112
+ /* Sidebar text elements */
113
+ section[data-testid="stSidebar"] * {{
114
+ color: {COLORS['text_primary']} !important;
115
  }}
116
 
117
  /* Sidebar title styling */
118
  section[data-testid="stSidebar"] h1 {{
119
+ color: {COLORS['text_primary']} !important;
120
  border-bottom: 2px solid {COLORS['border_medium']};
121
  padding-bottom: 0.5rem;
122
  margin-bottom: 1rem;
 
128
  margin-top: 1rem;
129
  margin-bottom: 1rem;
130
  background: linear-gradient(45deg, {COLORS['button_bg_start']}, {COLORS['button_bg_end']});
131
+ color: white !important;
132
  border: none;
133
  border-radius: 10px;
134
  padding: 0.75rem 1rem;
 
141
  background: linear-gradient(45deg, {COLORS['button_hover_start']}, {COLORS['button_hover_end']});
142
  transform: translateY(-2px);
143
  box-shadow: 0 4px 15px rgba(107, 107, 107, 0.3);
144
+ color: white !important;
145
  }}
146
 
147
  /* Input styling */
 
149
  background-color: {COLORS['background']};
150
  border: 2px solid {COLORS['border_light']};
151
  border-radius: 8px;
152
+ color: {COLORS['text_primary']} !important;
153
  }}
154
 
155
  .stTextInput>div>div>input:focus {{
156
  border-color: {COLORS['button_bg_start']};
157
  box-shadow: 0 0 0 2px rgba(107, 107, 107, 0.1);
158
+ color: {COLORS['text_primary']} !important;
159
  }}
160
 
161
  /* Selectbox and multiselect styling */
 
163
  background-color: {COLORS['background']};
164
  border: 2px solid {COLORS['border_light']};
165
  border-radius: 8px;
166
+ color: {COLORS['text_primary']} !important;
167
  }}
168
 
169
  .stMultiSelect>div>div>div {{
170
  background-color: {COLORS['background']};
171
  border: 2px solid {COLORS['border_light']};
172
  border-radius: 8px;
173
+ color: {COLORS['text_primary']} !important;
174
  }}
175
 
176
  /* Radio button styling */
 
178
  background-color: {COLORS['background']};
179
  border-radius: 8px;
180
  padding: 10px;
181
+ color: {COLORS['text_primary']} !important;
182
+ }}
183
+
184
+ .stRadio label {{
185
+ color: {COLORS['text_primary']} !important;
186
  }}
187
 
188
  /* Sidebar content styling */
189
  .sidebar .sidebar-content {{
190
  padding-top: 1rem;
191
  background-color: {COLORS['sidebar_bg_start']};
192
+ color: {COLORS['text_primary']} !important;
193
  }}
194
 
195
  hr {{
 
200
  h1 {{
201
  padding-bottom: 1rem;
202
  border-bottom: 3px solid {COLORS['border_medium']};
203
+ color: {COLORS['text_primary']} !important;
204
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
205
  }}
206
 
207
  h2 {{
208
  margin-top: 2rem;
209
  padding-bottom: 0.5rem;
210
+ color: {COLORS['text_secondary']} !important;
211
  font-weight: 600;
212
  }}
213
 
214
  h3 {{
215
  margin-top: 1.5rem;
216
+ color: {COLORS['text_tertiary']} !important;
217
  font-weight: 600;
218
  }}
219
 
220
+ /* Ensure all text elements have proper color */
221
+ p, span, div, label, li, td, th {{
222
+ color: {COLORS['text_primary']} !important;
223
+ }}
224
+
225
  /* Alert box styling */
226
  .auth-alert {{
227
  background: linear-gradient(135deg, {COLORS['alert_error_bg']} 0%, #FFCCCC 100%);
228
+ color: {COLORS['alert_error_text']} !important;
229
  padding: 15px;
230
  border-radius: 10px;
231
  margin: 15px 0;
 
235
 
236
  .auth-info {{
237
  background: linear-gradient(135deg, {COLORS['alert_info_bg']} 0%, #CCE7FF 100%);
238
+ color: {COLORS['alert_info_text']} !important;
239
  padding: 15px;
240
  border-radius: 10px;
241
  margin: 15px 0;
 
248
  background: linear-gradient(135deg, {COLORS['alert_info_bg']} 0%, #CCE7FF 100%);
249
  border: 1px solid {COLORS['text_secondary']};
250
  border-radius: 8px;
251
+ color: {COLORS['text_primary']} !important;
252
  }}
253
 
254
  .info-box {{
 
258
  border-radius: 10px;
259
  margin: 20px 0;
260
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
261
+ color: {COLORS['text_primary']} !important;
262
  }}
263
 
264
  .warning-box {{
 
268
  border-radius: 10px;
269
  margin: 20px 0;
270
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
271
+ color: {COLORS['text_primary']} !important;
272
  }}
273
 
274
  .success-box {{
 
278
  border-radius: 10px;
279
  margin: 20px 0;
280
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
281
+ color: {COLORS['text_primary']} !important;
282
  }}
283
 
284
  .centered {{
 
292
  .footer {{
293
  text-align: center;
294
  font-size: 0.8rem;
295
+ color: {COLORS['text_light']} !important;
296
  margin-top: 2rem;
297
  padding-top: 1rem;
298
  border-top: 1px solid {COLORS['border_light']};
 
314
  background: linear-gradient(135deg, {COLORS['background']} 0%, {COLORS['figure_background']} 100%);
315
  transition: all 0.3s ease;
316
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
317
+ color: {COLORS['text_primary']} !important;
318
  }}
319
 
320
  .nav-button:hover {{
 
322
  transform: translateY(-3px);
323
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
324
  border-color: {COLORS['text_secondary']};
325
+ color: {COLORS['text_primary']} !important;
326
  }}
327
 
328
  .nav-button h3 {{
329
+ color: {COLORS['text_secondary']} !important;
330
  margin-bottom: 0.5rem;
331
  }}
332
 
333
+ .nav-button * {{
334
+ color: {COLORS['text_primary']} !important;
335
+ }}
336
+
337
  /* Description boxes */
338
  .description-box {{
339
  text-align: center;
 
343
  margin-top: -10px;
344
  background: linear-gradient(135deg, {COLORS['background']} 0%, {COLORS['figure_background']} 100%);
345
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
346
+ color: {COLORS['text_primary']} !important;
347
  }}
348
 
349
  .description-box p {{
350
+ color: {COLORS['text_secondary']} !important;
351
  margin: 0;
352
  font-weight: 500;
353
  }}
354
+
355
+ .description-box * {{
356
+ color: {COLORS['text_secondary']} !important;
357
+ }}
358
  </style>
359
  """
360
 
 
369
  margin-bottom: 20px;
370
  border: 2px solid {COLORS['border_medium']};
371
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
372
+ color: {COLORS['text_primary']} !important;
373
+ }}
374
+
375
+ .gaussian-explanation-container * {{
376
+ color: {COLORS['text_primary']} !important;
377
  }}
378
 
379
  .caption {{
380
  font-size: 0.85rem;
381
+ color: {COLORS['text_light']} !important;
382
  text-align: center;
383
  margin-top: 5px;
384
  font-style: italic;
 
391
  border: 2px solid {COLORS['border_medium']};
392
  margin: 10px 0;
393
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
394
+ color: {COLORS['text_primary']} !important;
395
+ }}
396
+
397
+ .metric-card * {{
398
+ color: {COLORS['text_primary']} !important;
399
  }}
400
 
401
  .step-number {{
402
  background: linear-gradient(45deg, {COLORS['button_bg_start']}, {COLORS['button_bg_end']});
403
+ color: white !important;
404
  border-radius: 50%;
405
  width: 30px;
406
  height: 30px;
 
420
  border-left: 4px solid {COLORS['text_secondary']};
421
  margin: 10px 0;
422
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
423
+ color: {COLORS['text_primary']} !important;
424
+ }}
425
+
426
+ .glossary-term * {{
427
+ color: {COLORS['text_primary']} !important;
428
  }}
429
 
430
  .term-title {{
431
  font-size: 1.2rem;
432
  font-weight: bold;
433
+ color: {COLORS['text_secondary']} !important;
434
  margin-bottom: 8px;
435
  }}
436
 
 
441
  margin: 20px 0;
442
  border-left: 4px solid {COLORS['text_tertiary']};
443
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
444
+ color: {COLORS['text_primary']} !important;
445
+ }}
446
+
447
+ .term-category * {{
448
+ color: {COLORS['text_primary']} !important;
449
  }}
450
 
451
  .formula {{
 
455
  font-family: monospace;
456
  margin: 5px 0;
457
  border: 1px solid {COLORS['border_light']};
458
+ color: {COLORS['text_primary']} !important;
459
  }}
460
  </style>
461
  """
 
469
  background-color: {COLORS['figure_background']};
470
  border: 2px solid {COLORS['border_medium']};
471
  border-radius: 8px;
472
+ color: {COLORS['text_primary']} !important;
473
  font-weight: 600;
474
  }}
475
 
 
477
  background-color: {COLORS['background']};
478
  border: 1px solid {COLORS['border_light']};
479
  border-radius: 0 0 8px 8px;
480
+ color: {COLORS['text_primary']} !important;
481
+ }}
482
+
483
+ .streamlit-expanderContent * {{
484
+ color: {COLORS['text_primary']} !important;
485
  }}
486
 
487
  /* Tooltip styles */
 
489
  position: relative;
490
  display: inline-block;
491
  width: 100%;
492
+ color: {COLORS['text_primary']} !important;
493
  }}
494
 
495
  .tooltip-content {{
496
  visibility: hidden;
497
  background-color: {COLORS['background']};
498
+ color: {COLORS['text_primary']} !important;
499
  text-align: left;
500
  padding: 10px;
501
  border-radius: 8px;
 
517
  display: flex;
518
  align-items: center;
519
  margin: 5px 0;
520
+ color: {COLORS['text_primary']} !important;
521
  }}
522
 
523
  .color-box {{
 
543
  background: linear-gradient(45deg, {COLORS['generate_button_hover']}, #7CFC00) !important;
544
  transform: translateY(-3px) !important;
545
  box-shadow: 0 5px 20px rgba(34, 139, 34, 0.4) !important;
546
+ color: white !important;
547
  }}
548
  </style>
549
  """