Commit ·
e04e7ca
1
Parent(s): c4a5bb3
css: fix mobile-stack selector (Gradio 5.x has no gradio-container / .gr-column)
Browse filesThe previous mobile media query used [class*="gradio-container"] .gr-column
selectors, but Gradio 5.x renders the row as .row.layout-gap with .column
children and no gradio-container ancestor — so the rule matched nothing and
the columns never stacked. Use plain .layout-gap / .column selectors.
app.py
CHANGED
|
@@ -1195,17 +1195,21 @@ footer { display: none !important; }
|
|
| 1195 |
side; below ~900px they get squished — and because an earlier rule forces
|
| 1196 |
`min-width: 0` on them, they squeeze instead of wrapping, collapsing text
|
| 1197 |
to one character per line. Forcing the row to flex-direction:column makes
|
| 1198 |
-
each column take the full width and stack cleanly.
|
|
|
|
|
|
|
|
|
|
| 1199 |
@media (max-width: 900px) {
|
| 1200 |
-
|
|
|
|
| 1201 |
flex-direction: column !important;
|
| 1202 |
flex-wrap: wrap !important;
|
| 1203 |
}
|
| 1204 |
-
|
| 1205 |
-
|
| 1206 |
width: 100% !important;
|
| 1207 |
max-width: 100% !important;
|
| 1208 |
-
flex: 1 1
|
| 1209 |
}
|
| 1210 |
}
|
| 1211 |
"""
|
|
|
|
| 1195 |
side; below ~900px they get squished — and because an earlier rule forces
|
| 1196 |
`min-width: 0` on them, they squeeze instead of wrapping, collapsing text
|
| 1197 |
to one character per line. Forcing the row to flex-direction:column makes
|
| 1198 |
+
each column take the full width and stack cleanly.
|
| 1199 |
+
NOTE: Gradio 5.x renders the row as `.row.layout-gap` and the columns as
|
| 1200 |
+
`.column` (no `gradio-container` ancestor, no `.gr-column`), so the
|
| 1201 |
+
selectors must be plain. */
|
| 1202 |
@media (max-width: 900px) {
|
| 1203 |
+
.layout-gap,
|
| 1204 |
+
.row.layout-gap {
|
| 1205 |
flex-direction: column !important;
|
| 1206 |
flex-wrap: wrap !important;
|
| 1207 |
}
|
| 1208 |
+
.layout-gap > .column,
|
| 1209 |
+
.layout-gap > div {
|
| 1210 |
width: 100% !important;
|
| 1211 |
max-width: 100% !important;
|
| 1212 |
+
flex: 1 1 auto !important;
|
| 1213 |
}
|
| 1214 |
}
|
| 1215 |
"""
|