ckg-small-model-demo / custom.css
danyarm's picture
design kit: dark NVIDIA theme + D3 subgraph (custom.css)
026221c verified
Raw
History Blame Contribute Delete
6.19 kB
/* ════════════════════════════════════════════════════════════════════
CKG Demo β€” dark developer theme for Gradio 5
Palette: bg #111111 Β· panels #161616 Β· accent #76b900 Β· text #f2f2f2
Load: gr.Blocks(css_paths=["custom.css"], js=ckg_ui.FORCE_DARK_JS)
Class hooks (set via elem_classes / elem_id β€” wiring in ckg_ui.py):
.ckg-stats .stat-card .hero stat card row (one gr.HTML)
#compare-row gr.Row holding the two panels
.answer-panel .without .with the two gr.Columns
.panel-head .panel-f1 headers / F1 lines (gr.HTML)
.mono-box Textbox/Markdown showing model output
.section-head section header row (gr.HTML)
.subgraph-frame iframe from ckg_ui.subgraph_html()
════════════════════════════════════════════════════════════════════ */
/* ---- Theme variables (set on light + dark so both resolve dark) ---- */
:root, .dark, body.dark {
--font: "Helvetica Neue", Helvetica, -apple-system, "Segoe UI", Arial, sans-serif;
--font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
--body-background-fill: #111111;
--background-fill-primary: #161616;
--background-fill-secondary: #1d1d1d;
--block-background-fill: #161616;
--panel-background-fill: #141414;
--body-text-color: #f2f2f2;
--body-text-color-subdued: #9b9b9b;
--block-title-text-color: #9b9b9b;
--block-label-text-color: #8a8a8a;
--block-info-text-color: #8a8a8a;
--border-color-primary: #2a2a2a;
--block-border-color: #2a2a2a;
--input-background-fill: #0d0d0d;
--input-background-fill-focus: #0d0d0d;
--input-border-color: #2e2e2e;
--input-border-color-focus: #76b900;
--input-placeholder-color: #5f5f5f;
--color-accent: #76b900;
--color-accent-soft: rgba(118, 185, 0, 0.15);
--link-text-color: #9ed934;
--link-text-color-hover: #c3f53c;
--link-text-color-active: #9ed934;
--link-text-color-visited: #9ed934;
--button-primary-background-fill: #76b900;
--button-primary-background-fill-hover: #8ad000;
--button-primary-border-color: #76b900;
--button-primary-text-color: #081000;
--button-secondary-background-fill: #1f1f1f;
--button-secondary-background-fill-hover: #282828;
--button-secondary-border-color: #333333;
--button-secondary-text-color: #f2f2f2;
--loader-color: #76b900;
--slider-color: #76b900;
--checkbox-background-color-selected: #76b900;
--checkbox-border-color-selected: #76b900;
--table-even-background-fill: #151515;
--table-odd-background-fill: #191919;
--block-shadow: none;
--block-radius: 8px;
--block-label-radius: 8px;
}
body, .gradio-container {
background: #111111 !important;
color: var(--body-text-color);
}
.gradio-container { max-width: 1240px !important; margin: 0 auto !important; }
/* β€œBuilt with Gradio” footer */
footer { display: none !important; }
::selection { background: rgba(118, 185, 0, 0.35); }
* { scrollbar-color: #2e2e2e #111111; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: #111111; }
*::-webkit-scrollbar-thumb { background: #2e2e2e; border-radius: 5px; }
*::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }
/* ---- Stat cards ---- */
.ckg-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 2px 0 6px; }
.stat-card { background: #161616; border: 1px solid #2a2a2a; border-radius: 8px; padding: 16px 18px; }
.stat-card .num { font-family: var(--font-mono); font-size: 30px; font-weight: 700; color: #76b900; line-height: 1.1; letter-spacing: -0.5px; }
.stat-card .lbl { margin-top: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #8a8a8a; }
.stat-card.hero {
border-color: #76b900;
box-shadow: 0 0 0 1px rgba(118, 185, 0, 0.35), 0 0 24px rgba(118, 185, 0, 0.22), inset 0 0 20px rgba(118, 185, 0, 0.05);
}
/* ---- Answer panels ---- */
.answer-panel { background: #161616 !important; border: 1px solid #2a2a2a !important; border-radius: 8px !important; padding: 14px 16px !important; gap: 10px !important; }
.answer-panel.without { border-left: 3px solid #e5484d !important; }
.answer-panel.with { border-left: 3px solid #76b900 !important; }
.answer-panel .block, .answer-panel .form { background: transparent !important; border: none !important; box-shadow: none !important; }
.panel-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; }
.panel-head .mark { font-size: 15px; }
.panel-head.bad { color: #ff6b6b; }
.panel-head.good { color: #8fd400; }
.panel-f1 { font-family: var(--font-mono); font-size: 12px; color: #8a8a8a; }
.panel-f1 b { color: #f2f2f2; font-weight: 600; }
/* model output boxes */
.mono-box textarea, .mono-box input, .mono-box .prose, .mono-box pre, .mono-box code {
font-family: var(--font-mono) !important;
font-size: 13px !important;
line-height: 1.6 !important;
background: #0d0d0d !important;
color: #d6d6d6 !important;
}
/* ---- Section headers + subgraph ---- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #8a8a8a; }
.section-head .meta { font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; color: #6f6f6f; }
.subgraph-frame { display: block; width: 100%; border: 1px solid #2a2a2a; border-radius: 8px; background: #0d0d0d; }
/* ---- Mobile: panels stack, stats 2-up ---- */
@media (max-width: 860px) {
.ckg-stats { grid-template-columns: 1fr 1fr; }
#compare-row { flex-direction: column !important; }
#compare-row > .column, #compare-row > div { width: 100% !important; min-width: 100% !important; }
.stat-card .num { font-size: 24px; }
}