Update app.py
Browse files
app.py
CHANGED
|
@@ -9,28 +9,38 @@ from components.food_suggestions import render_food_guide
|
|
| 9 |
from components.doctor_info import render_doctor_list
|
| 10 |
from components.how_to_use import render_how_to_use_guide
|
| 11 |
|
| 12 |
-
# --- Style and Theme with
|
| 13 |
css = """
|
| 14 |
/* General container style for all screens */
|
| 15 |
.gradio-container { max-width: 1000px !important; margin: auto !important; }
|
| 16 |
.centered-text { text-align: center; }
|
| 17 |
|
| 18 |
/* --- CRITICAL FIX FOR BUTTON TEXT IN DARK MODE --- */
|
| 19 |
-
/* Force the text color of primary and secondary buttons to be white */
|
| 20 |
.gradio-button.primary, .gradio-button.secondary {
|
| 21 |
color: white !important;
|
| 22 |
}
|
| 23 |
|
| 24 |
/* --- ENHANCED MOBILE-RESPONSIVE RULES --- */
|
| 25 |
-
/* This rule applies ONLY when the screen width is 768px or less */
|
| 26 |
@media (max-width: 768px) {
|
| 27 |
/* Find all rows inside the Gradio app */
|
| 28 |
.gradio-row {
|
| 29 |
/* Change the layout from horizontal to vertical */
|
| 30 |
flex-direction: column !important;
|
| 31 |
-
/* Add a small gap between the stacked elements
|
| 32 |
gap: 1rem !important;
|
| 33 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
}
|
| 35 |
"""
|
| 36 |
with gr.Blocks(title="DiaSpark: Your Health Management Platform", css=css) as demo:
|
|
|
|
| 9 |
from components.doctor_info import render_doctor_list
|
| 10 |
from components.how_to_use import render_how_to_use_guide
|
| 11 |
|
| 12 |
+
# --- Style and Theme with NEW, MORE AGGRESSIVE Mobile-Responsive CSS ---
|
| 13 |
css = """
|
| 14 |
/* General container style for all screens */
|
| 15 |
.gradio-container { max-width: 1000px !important; margin: auto !important; }
|
| 16 |
.centered-text { text-align: center; }
|
| 17 |
|
| 18 |
/* --- CRITICAL FIX FOR BUTTON TEXT IN DARK MODE --- */
|
|
|
|
| 19 |
.gradio-button.primary, .gradio-button.secondary {
|
| 20 |
color: white !important;
|
| 21 |
}
|
| 22 |
|
| 23 |
/* --- ENHANCED MOBILE-RESPONSIVE RULES --- */
|
| 24 |
+
/* This rule applies ONLY when the screen width is 768px or less (tablets and phones) */
|
| 25 |
@media (max-width: 768px) {
|
| 26 |
/* Find all rows inside the Gradio app */
|
| 27 |
.gradio-row {
|
| 28 |
/* Change the layout from horizontal to vertical */
|
| 29 |
flex-direction: column !important;
|
| 30 |
+
/* Add a small gap between the stacked elements */
|
| 31 |
gap: 1rem !important;
|
| 32 |
}
|
| 33 |
+
|
| 34 |
+
/* --- NEW AND MOST IMPORTANT RULE --- */
|
| 35 |
+
/* This rule targets every direct child (column) inside a row */
|
| 36 |
+
.gradio-row > * {
|
| 37 |
+
/* Force the column to take up the full width of the screen */
|
| 38 |
+
width: 100% !important;
|
| 39 |
+
/* Remove any strange minimum width settings Gradio might apply */
|
| 40 |
+
min-width: unset !important;
|
| 41 |
+
/* Ensure there's no leftover margin that could cause issues */
|
| 42 |
+
margin: 0 !important;
|
| 43 |
+
}
|
| 44 |
}
|
| 45 |
"""
|
| 46 |
with gr.Blocks(title="DiaSpark: Your Health Management Platform", css=css) as demo:
|