Improve mobile responsiveness and styling in ui_utils.py by adding new CSS rules for headers, buttons, and layout adjustments. Enhance table and component styling for better usability on small screens.
Browse files- ui_utils.py +89 -33
ui_utils.py
CHANGED
@@ -315,52 +315,108 @@ CLEAN_CSS = """
|
|
315 |
|
316 |
/* Horizontal scroll for tables on small screens */
|
317 |
@media screen and (max-width: 480px) {
|
318 |
-
.
|
319 |
-
|
|
|
|
|
320 |
}
|
321 |
-
|
322 |
-
|
323 |
-
|
|
|
|
|
324 |
font-size: 0.8rem !important;
|
325 |
}
|
326 |
-
|
327 |
-
.gr-dataframe th,
|
328 |
-
.gr-dataframe td {
|
329 |
padding: 0.4rem !important;
|
|
|
|
|
330 |
}
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
}
|
335 |
-
|
336 |
-
|
337 |
-
font-size: 0.9rem !important;
|
338 |
}
|
339 |
-
|
340 |
-
|
341 |
-
min-width: 100px !important;
|
342 |
font-size: 0.8rem !important;
|
343 |
-
|
|
|
344 |
}
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
padding: 0 5px !important;
|
349 |
}
|
350 |
-
|
351 |
-
|
352 |
-
padding: 1rem 0.75rem !important;
|
353 |
}
|
354 |
-
|
355 |
-
|
356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
font-size: 0.8rem !important;
|
|
|
358 |
}
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
364 |
}
|
365 |
}
|
366 |
|
|
|
315 |
|
316 |
/* Horizontal scroll for tables on small screens */
|
317 |
@media screen and (max-width: 480px) {
|
318 |
+
.main-header {
|
319 |
+
padding: 0.75rem 0.5rem !important;
|
320 |
+
border-radius: 6px !important;
|
321 |
+
margin-bottom: 0.75rem !important;
|
322 |
}
|
323 |
+
.main-header h1 {
|
324 |
+
font-size: 1.2rem !important;
|
325 |
+
margin-bottom: 0.25rem !important;
|
326 |
+
}
|
327 |
+
.main-header p {
|
328 |
font-size: 0.8rem !important;
|
329 |
}
|
330 |
+
.status-info {
|
|
|
|
|
331 |
padding: 0.4rem !important;
|
332 |
+
font-size: 0.75rem !important;
|
333 |
+
border-radius: 4px !important;
|
334 |
}
|
335 |
+
.gradio-container {
|
336 |
+
padding: 0 2px !important;
|
337 |
+
max-width: 100vw !important;
|
338 |
}
|
339 |
+
.gradio-row, .gradio-column {
|
340 |
+
gap: 0.25rem !important;
|
|
|
341 |
}
|
342 |
+
.gradio-row .gr-button, .gradio-row button, .gr-button {
|
343 |
+
padding: 0.5rem !important;
|
|
|
344 |
font-size: 0.8rem !important;
|
345 |
+
min-width: 90px !important;
|
346 |
+
border-radius: 6px !important;
|
347 |
}
|
348 |
+
.gr-dropdown, .gr-textbox, .gr-slider {
|
349 |
+
width: 100% !important;
|
350 |
+
font-size: 0.85rem !important;
|
|
|
351 |
}
|
352 |
+
.gr-dropdown label, .gr-textbox label, .gr-slider label {
|
353 |
+
font-size: 0.8rem !important;
|
|
|
354 |
}
|
355 |
+
.gr-dataframe {
|
356 |
+
overflow-x: auto !important;
|
357 |
+
font-size: 0.75rem !important;
|
358 |
+
border-radius: 3px !important;
|
359 |
+
}
|
360 |
+
.gr-dataframe table {
|
361 |
+
min-width: 350px !important;
|
362 |
+
font-size: 0.75rem !important;
|
363 |
+
}
|
364 |
+
.gr-dataframe th, .gr-dataframe td {
|
365 |
+
padding: 0.3rem !important;
|
366 |
+
white-space: pre-line !important;
|
367 |
+
word-break: break-word !important;
|
368 |
+
}
|
369 |
+
.gradio-tabs .tab-nav button {
|
370 |
+
min-width: 80px !important;
|
371 |
+
font-size: 0.75rem !important;
|
372 |
+
padding: 0.3rem 0.5rem !important;
|
373 |
+
}
|
374 |
+
.gr-html, .gr-html * {
|
375 |
font-size: 0.8rem !important;
|
376 |
+
word-break: break-word !important;
|
377 |
}
|
378 |
+
.gr-html div[style*="padding: 20px"] {
|
379 |
+
padding: 8px !important;
|
380 |
+
}
|
381 |
+
.evaluation-card {
|
382 |
+
padding: 8px !important;
|
383 |
+
margin: 4px 0 !important;
|
384 |
+
border-radius: 5px !important;
|
385 |
+
}
|
386 |
+
.gr-checkbox-group label {
|
387 |
+
font-size: 0.75rem !important;
|
388 |
+
padding: 0.3rem !important;
|
389 |
+
}
|
390 |
+
.gr-slider {
|
391 |
+
margin: 0.2rem 0 !important;
|
392 |
+
}
|
393 |
+
.gradio-row .gr-button, .gradio-row button {
|
394 |
+
width: 100% !important;
|
395 |
+
margin: 0.15rem 0 !important;
|
396 |
+
}
|
397 |
+
.gradio-tabs .tab-nav {
|
398 |
+
flex-wrap: nowrap !important;
|
399 |
+
overflow-x: auto !important;
|
400 |
+
scrollbar-width: thin !important;
|
401 |
+
}
|
402 |
+
.gradio-tabs {
|
403 |
+
overflow-x: auto !important;
|
404 |
+
}
|
405 |
+
.gr-html div[style*="grid-template-columns"] {
|
406 |
+
display: block !important;
|
407 |
+
}
|
408 |
+
.gr-html div[style*="grid-template-columns"] > div {
|
409 |
+
margin-bottom: 0.5rem !important;
|
410 |
+
}
|
411 |
+
.gr-html div[style*="color: green"],
|
412 |
+
.gr-html div[style*="color: red"],
|
413 |
+
.gr-html div[style*="color: orange"] {
|
414 |
+
margin: 0.25rem 0 !important;
|
415 |
+
border-radius: 4px !important;
|
416 |
+
}
|
417 |
+
.gradio-container > div:last-child {
|
418 |
+
font-size: 0.7rem !important;
|
419 |
+
padding: 8px !important;
|
420 |
}
|
421 |
}
|
422 |
|