UBCHelper / web /static /gradio.css
DevSchretl's picture
Improved UI: Shows each run as four connected stages: Plan, Search, Rank, Answer
f341754
Raw History Blame Contribute Delete
3.2 kB
/* Layout for the Gradio Space only. app.py appends this to panels.css; the FastAPI and static
builds use styles.css instead. Selectors use the elem_ids set in app.py, so nothing here
reaches Gradio's own widgets elsewhere on the page. */
/* On a phone the intro keeps its first sentence, so the question box comes up sooner. */
@media (max-width: 759px) {
#intro .intro-more { display: none; }
}
/* The examples: one row of short labels that scrolls sideways. stages.js adds the arrow
buttons and the edge fades. */
#examples { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 6px; }
#examples > .label { grid-column: 1 / -1; }
#examples > .gallery {
--fade-left: 0px; --fade-right: 0px;
display: flex; grid-row: 2; grid-column: 2; flex-wrap: nowrap; gap: 8px; padding: 2px 0;
overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain;
-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-left), #000 calc(100% - var(--fade-right)), transparent 100%);
mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-left), #000 calc(100% - var(--fade-right)), transparent 100%);
}
#examples > .gallery::-webkit-scrollbar { display: none; }
#examples.fade-left > .gallery { --fade-left: 32px; }
#examples.fade-right > .gallery { --fade-right: 32px; }
#examples .gallery-item { flex: none; scroll-snap-align: start; }
#examples .gallery-item > .gallery { white-space: nowrap !important; }
#examples > .ex-arrow {
display: grid; grid-row: 2; place-items: center; width: 36px; height: 36px; padding: 0;
border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer;
}
#examples > .ex-prev { grid-column: 1; }
#examples > .ex-next { grid-column: 3; }
#examples > .ex-arrow:disabled { opacity: 0.35; cursor: default; }
#examples > .ex-arrow:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 759px), (hover: none) {
#examples > .ex-arrow { display: none; }
#examples > .gallery { grid-column: 1 / -1; }
}
/* The pipeline section: one card around the stage cards and the open panel. No gap between
them, so the selected card's pointer lands on the panel. */
#pipe {
gap: 0 !important; padding: 18px 20px 20px;
border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
/* Gradio pads the inside of every HTML block; the panels set their own padding. */
#pipe .html-container { padding: 0; }
#pipe #panel-answer { gap: 14px; }
#pipe #answer-md {
padding: 16px 18px !important; border: 1px solid var(--border) !important;
border-radius: 12px; background: var(--surface);
}
#pipe #answer-md .prose { font-size: 15.5px; line-height: 1.65; }
/* Until there is an answer, the answer row has nothing to show. */
#pipe #answer-row:not(:has(.sp-answer-side)) { display: none; }
@media (max-width: 759px) {
#pipe { padding: 14px 12px 16px; }
}
/* Small print: today's usage and the footer. */
#usage, #footer { color: var(--ink-faint); font-size: 12.5px; }
#usage p, #footer p { margin: 0; }