Lzy01241010 commited on
Commit
c4a5bb3
·
1 Parent(s): 8e87d9c

css: stack the two-column layout on mobile/tablet (fix broken phone layout)

Browse files

The "Ask the agent" / "Open release" gr.Row stayed side-by-side on phones,
squeezing each column to ~180px so every label wrapped one character per
line. An earlier rule forces min-width:0 on the columns, which defeats
Gradio s natural wrap-on-min-width behaviour. Add a max-width:900px media
query that flips .layout-gap to flex-direction:column and makes each column
full-width, so the layout cleanly stacks on phones and narrow tablets.

Files changed (1) hide show
  1. app.py +18 -0
app.py CHANGED
@@ -1190,6 +1190,24 @@ footer { display: none !important; }
1190
  [class*="gradio-container"] { padding: 16px !important; }
1191
  .quest-footer { flex-direction: column; align-items: flex-start; }
1192
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1193
  """
1194
 
1195
 
 
1190
  [class*="gradio-container"] { padding: 16px !important; }
1191
  .quest-footer { flex-direction: column; align-items: flex-start; }
1192
  }
1193
+ /* Mobile / tablet: stack the two-column (Ask the agent | Open release)
1194
+ layout vertically. The columns are designed for ~420px + ~340px side by
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
+ [class*="gradio-container"] .layout-gap {
1201
+ flex-direction: column !important;
1202
+ flex-wrap: wrap !important;
1203
+ }
1204
+ [class*="gradio-container"] .layout-gap > .gr-column,
1205
+ [class*="gradio-container"] .layout-gap > div {
1206
+ width: 100% !important;
1207
+ max-width: 100% !important;
1208
+ flex: 1 1 100% !important;
1209
+ }
1210
+ }
1211
  """
1212
 
1213