Siraja704
commited on
Commit
·
789ec36
1
Parent(s):
d1daad9
Implement simple blue theme for universal visibility
Browse files- Remove dark/light mode detection complexity
- Use blue color scheme that works in both themes:
- Main heading: Dark blue (#1565c0)
- Section headings: Medium blue (#1976d2)
- Regular text: Light blue (#2196f3)
- Icons and SVG: Light blue (#2196f3)
- Links: Dark blue (#1565c0)
- Add blue borders to sections for consistency
- Ensures text is visible in both light and dark backgrounds
- Simple, clean, and universally readable design
app.py
CHANGED
|
@@ -158,121 +158,87 @@ def get_medical_advice(image):
|
|
| 158 |
|
| 159 |
# Custom CSS for better styling with dark/light mode support
|
| 160 |
custom_css = """
|
| 161 |
-
/* Simple and
|
| 162 |
-
:root {
|
| 163 |
-
--heading-color-light: #1976d2;
|
| 164 |
-
--text-color-light: #000000;
|
| 165 |
-
--heading-color-dark: #64b5f6;
|
| 166 |
-
--text-color-dark: #ffffff;
|
| 167 |
-
}
|
| 168 |
-
|
| 169 |
-
/* Light mode - black text, blue headings */
|
| 170 |
.gradio-container {
|
| 171 |
font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
|
| 172 |
max-width: 1200px;
|
| 173 |
margin: 0 auto;
|
| 174 |
}
|
| 175 |
|
|
|
|
| 176 |
.gradio-container * {
|
| 177 |
-
color:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
}
|
| 179 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
.gradio-container h1,
|
| 181 |
.gradio-container h2,
|
| 182 |
.gradio-container h3,
|
| 183 |
.gradio-container h4,
|
| 184 |
.gradio-container h5,
|
| 185 |
-
.gradio-container h6
|
| 186 |
-
|
|
|
|
| 187 |
font-weight: 600 !important;
|
| 188 |
}
|
| 189 |
|
| 190 |
-
.gradio-container svg {
|
| 191 |
-
fill: var(--text-color-light) !important;
|
| 192 |
-
stroke: var(--text-color-light) !important;
|
| 193 |
-
}
|
| 194 |
-
|
| 195 |
-
/* Dark mode - white text, light blue headings */
|
| 196 |
-
@media (prefers-color-scheme: dark) {
|
| 197 |
-
.gradio-container * {
|
| 198 |
-
color: var(--text-color-dark) !important;
|
| 199 |
-
}
|
| 200 |
-
|
| 201 |
-
.gradio-container h1,
|
| 202 |
-
.gradio-container h2,
|
| 203 |
-
.gradio-container h3,
|
| 204 |
-
.gradio-container h4,
|
| 205 |
-
.gradio-container h5,
|
| 206 |
-
.gradio-container h6 {
|
| 207 |
-
color: var(--heading-color-dark) !important;
|
| 208 |
-
font-weight: 600 !important;
|
| 209 |
-
}
|
| 210 |
-
|
| 211 |
-
.gradio-container svg {
|
| 212 |
-
fill: var(--text-color-dark) !important;
|
| 213 |
-
stroke: var(--text-color-dark) !important;
|
| 214 |
-
}
|
| 215 |
-
}
|
| 216 |
-
|
| 217 |
-
/* Specific component fixes */
|
| 218 |
-
.gradio-container label,
|
| 219 |
-
.gradio-container .gr-label-text,
|
| 220 |
-
.gradio-container .gr-input-label,
|
| 221 |
-
.gradio-container .gr-markdown,
|
| 222 |
-
.gradio-container .gr-markdown *,
|
| 223 |
-
.gradio-container button,
|
| 224 |
-
.gradio-container span,
|
| 225 |
-
.gradio-container div,
|
| 226 |
-
.gradio-container p {
|
| 227 |
-
color: inherit !important;
|
| 228 |
-
}
|
| 229 |
-
|
| 230 |
-
/* Section headers get heading color */
|
| 231 |
.section-header {
|
| 232 |
-
color: var(--heading-color-light) !important;
|
| 233 |
font-size: 1.4rem !important;
|
| 234 |
-
font-weight: 600 !important;
|
| 235 |
margin-bottom: 15px !important;
|
| 236 |
}
|
| 237 |
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
}
|
| 243 |
|
| 244 |
-
/*
|
| 245 |
-
.
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
}
|
| 251 |
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
}
|
| 257 |
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
.main-title p {
|
| 264 |
-
color: var(--text-color-dark) !important;
|
| 265 |
-
}
|
| 266 |
}
|
| 267 |
|
| 268 |
-
/* Simple
|
| 269 |
.medical-disclaimer,
|
| 270 |
.info-box,
|
| 271 |
.about-section {
|
| 272 |
border-radius: 8px;
|
| 273 |
padding: 15px;
|
| 274 |
margin: 10px 0;
|
| 275 |
-
border: 1px solid
|
| 276 |
}
|
| 277 |
|
| 278 |
.conditions-grid {
|
|
@@ -285,7 +251,7 @@ custom_css = """
|
|
| 285 |
.condition-item {
|
| 286 |
padding: 15px;
|
| 287 |
border-radius: 8px;
|
| 288 |
-
border: 1px solid
|
| 289 |
}
|
| 290 |
"""
|
| 291 |
|
|
|
|
| 158 |
|
| 159 |
# Custom CSS for better styling with dark/light mode support
|
| 160 |
custom_css = """
|
| 161 |
+
/* Simple blue theme that works in both light and dark modes */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
.gradio-container {
|
| 163 |
font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
|
| 164 |
max-width: 1200px;
|
| 165 |
margin: 0 auto;
|
| 166 |
}
|
| 167 |
|
| 168 |
+
/* All text blue for universal visibility */
|
| 169 |
.gradio-container * {
|
| 170 |
+
color: #2196f3 !important;
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
/* Main heading - darker blue */
|
| 174 |
+
.main-title h1 {
|
| 175 |
+
color: #1565c0 !important;
|
| 176 |
+
font-size: 2.5rem !important;
|
| 177 |
+
font-weight: 700 !important;
|
| 178 |
+
text-align: center !important;
|
| 179 |
}
|
| 180 |
|
| 181 |
+
.main-title p {
|
| 182 |
+
color: #1976d2 !important;
|
| 183 |
+
font-size: 1.2rem !important;
|
| 184 |
+
text-align: center !important;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
/* Section headings - medium blue */
|
| 188 |
.gradio-container h1,
|
| 189 |
.gradio-container h2,
|
| 190 |
.gradio-container h3,
|
| 191 |
.gradio-container h4,
|
| 192 |
.gradio-container h5,
|
| 193 |
+
.gradio-container h6,
|
| 194 |
+
.section-header {
|
| 195 |
+
color: #1976d2 !important;
|
| 196 |
font-weight: 600 !important;
|
| 197 |
}
|
| 198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
.section-header {
|
|
|
|
| 200 |
font-size: 1.4rem !important;
|
|
|
|
| 201 |
margin-bottom: 15px !important;
|
| 202 |
}
|
| 203 |
|
| 204 |
+
/* Regular text - lighter blue */
|
| 205 |
+
.gradio-container p,
|
| 206 |
+
.gradio-container span,
|
| 207 |
+
.gradio-container div,
|
| 208 |
+
.gradio-container li,
|
| 209 |
+
.gradio-container label,
|
| 210 |
+
.gradio-container button {
|
| 211 |
+
color: #2196f3 !important;
|
| 212 |
}
|
| 213 |
|
| 214 |
+
/* Special components */
|
| 215 |
+
.gradio-container .gr-markdown,
|
| 216 |
+
.gradio-container .gr-markdown *,
|
| 217 |
+
.gradio-container .gr-label-text,
|
| 218 |
+
.gradio-container .gr-input-label {
|
| 219 |
+
color: #2196f3 !important;
|
| 220 |
}
|
| 221 |
|
| 222 |
+
/* Icons and SVG elements */
|
| 223 |
+
.gradio-container svg {
|
| 224 |
+
fill: #2196f3 !important;
|
| 225 |
+
stroke: #2196f3 !important;
|
| 226 |
}
|
| 227 |
|
| 228 |
+
/* Links */
|
| 229 |
+
.gradio-container a {
|
| 230 |
+
color: #1565c0 !important;
|
| 231 |
+
text-decoration: underline;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
}
|
| 233 |
|
| 234 |
+
/* Simple styling without backgrounds */
|
| 235 |
.medical-disclaimer,
|
| 236 |
.info-box,
|
| 237 |
.about-section {
|
| 238 |
border-radius: 8px;
|
| 239 |
padding: 15px;
|
| 240 |
margin: 10px 0;
|
| 241 |
+
border: 1px solid #2196f3;
|
| 242 |
}
|
| 243 |
|
| 244 |
.conditions-grid {
|
|
|
|
| 251 |
.condition-item {
|
| 252 |
padding: 15px;
|
| 253 |
border-radius: 8px;
|
| 254 |
+
border: 1px solid #2196f3;
|
| 255 |
}
|
| 256 |
"""
|
| 257 |
|