TomLii commited on
Commit
bd702a2
·
1 Parent(s): 704ce6a

Keep gr.Row horizontal in cards; fit icon grid to column; allow popups to overflow

Browse files
Files changed (1) hide show
  1. app.py +32 -15
app.py CHANGED
@@ -229,21 +229,22 @@ gradio-app, gradio-app > .gradio-container, gradio-app > div {
229
  grid-template-columns: repeat(2, minmax(0, 1fr));
230
  gap: 12px;
231
  width: 100%;
232
- max-width: 360px;
233
- margin: 0 auto;
234
  }
235
  .icon-link {
236
  display: flex;
237
  align-items: center;
238
  justify-content: center;
239
  gap: 8px;
240
- padding: 16px 14px;
241
  border-radius: 16px;
242
  text-decoration: none !important;
243
  color: #1d4ed8 !important;
244
  background: #ffffff;
245
  font-weight: 600;
246
- font-size: 16px;
 
247
  border: 1px solid rgba(191,219,254,0.7);
248
  box-shadow: 0 1px 2px rgba(15,39,68,0.03), 0 10px 28px rgba(37,99,235,0.07);
249
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
@@ -308,6 +309,8 @@ gradio-app, gradio-app > .gradio-container, gradio-app > div {
308
  --panel-background-fill: transparent;
309
  --panel-border-width: 0px;
310
  --background-fill-secondary: transparent;
 
 
311
  }
312
  .section-card .block,
313
  .section-card .form,
@@ -319,22 +322,36 @@ gradio-app, gradio-app > .gradio-container, gradio-app > div {
319
  .section-card .gradio-slider,
320
  .section-card .gradio-textbox,
321
  .section-card .gradio-markdown,
322
- .section-card .gradio-code,
323
- .section-card > div > div,
324
- .section-card > div > div > div {
325
  background: transparent !important;
326
  border: none !important;
327
  box-shadow: none !important;
328
- padding: 0 !important;
329
  }
330
- /* Re-add tasteful spacing inside a card (we just stripped padding above). */
 
331
  .section-card .form,
332
- .section-card .gr-form,
333
- .section-card > div > div {
334
- display: flex;
335
- flex-direction: column;
336
- gap: 14px;
337
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
 
339
  /* Direct children of a card get vertical rhythm without extra chrome. */
340
  .section-card > * + * { margin-top: 14px; }
 
229
  grid-template-columns: repeat(2, minmax(0, 1fr));
230
  gap: 12px;
231
  width: 100%;
232
+ margin: 0;
233
+ box-sizing: border-box;
234
  }
235
  .icon-link {
236
  display: flex;
237
  align-items: center;
238
  justify-content: center;
239
  gap: 8px;
240
+ padding: 14px 10px;
241
  border-radius: 16px;
242
  text-decoration: none !important;
243
  color: #1d4ed8 !important;
244
  background: #ffffff;
245
  font-weight: 600;
246
+ font-size: 15px;
247
+ white-space: nowrap;
248
  border: 1px solid rgba(191,219,254,0.7);
249
  box-shadow: 0 1px 2px rgba(15,39,68,0.03), 0 10px 28px rgba(37,99,235,0.07);
250
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
 
309
  --panel-background-fill: transparent;
310
  --panel-border-width: 0px;
311
  --background-fill-secondary: transparent;
312
+ /* Allow dropdown popups / overflowing content to escape the card. */
313
+ overflow: visible !important;
314
  }
315
  .section-card .block,
316
  .section-card .form,
 
322
  .section-card .gradio-slider,
323
  .section-card .gradio-textbox,
324
  .section-card .gradio-markdown,
325
+ .section-card .gradio-code {
 
 
326
  background: transparent !important;
327
  border: none !important;
328
  box-shadow: none !important;
329
+ overflow: visible !important;
330
  }
331
+
332
+ /* Auto-form (consecutive form components) needs to lay its kids out vertically. */
333
  .section-card .form,
334
+ .section-card .gr-form {
335
+ display: flex !important;
336
+ flex-direction: column !important;
337
+ gap: 14px !important;
338
+ }
339
+
340
+ /* gr.Row must STAY horizontal even inside a section-card (Run / Stop / Clear). */
341
+ [class*="gradio-container"] .section-card .row,
342
+ [class*="gradio-container"] .section-card [class*="row"] {
343
+ display: flex !important;
344
+ flex-direction: row !important;
345
+ flex-wrap: wrap !important;
346
+ gap: 10px !important;
347
+ }
348
+ .action-row {
349
+ display: flex !important;
350
+ flex-direction: row !important;
351
+ gap: 10px !important;
352
+ margin-top: 12px;
353
+ }
354
+ .action-row > * { flex: 1 1 0; min-width: 0; }
355
 
356
  /* Direct children of a card get vertical rhythm without extra chrome. */
357
  .section-card > * + * { margin-top: 14px; }