| name | panel-grid-layout |
| description | CSS grid layout system for a responsive panel dashboard with dark theme. Uses CSS custom properties, auto-fill grid, and monospace font aesthetic inspired by worldmonitor. |
Panel Grid Layout & Dark Theme
CSS Variables (Dark Theme)
Create src/styles/main.css with these CSS custom properties:
:root {
--bg: #0a0a0a;
--bg-secondary: #111;
--surface: #141414;
--surface-hover: #1e1e1e;
--border: #2a2a2a;
--border-strong: #444;
--border-subtle: #1a1a1a;
--text: #e8e8e8;
--text-secondary: #ccc;
--text-dim: #888;
--text-muted: #666;
--text-faint: #555;
--accent: #fff;
--overlay-subtle: rgba(255, 255, 255, 0.03);
--overlay-light: rgba(255, 255, 255, 0.05);
--green: #44ff88;
--red: #ff4444;
--yellow: #ffaa00;
--semantic-critical: #ff4444;
--semantic-high: #ff8800;
--semantic-positive: #44ff88;
--semantic-info: #3b82f6;
--status-live: #44ff88;
--status-cached: #ffaa00;
--status-unavailable: #ff4444;
--font-mono: 'SF Mono', 'Monaco', 'Cascadia Code', 'Fira Code', monospace;
--font-body: var(--font-mono);
}
Base Styles
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
height: 100%;
background: var(--bg);
color: var(--text);
font-family: var(--font-body);
font-size: 13px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }
Grid Layout
.panels-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
grid-auto-flow: row dense;
grid-auto-rows: minmax(200px, 380px);
gap: 4px;
padding: 4px;
align-content: start;
align-items: stretch;
min-height: 0;
}
Panel Base Styles
.panel {
background: var(--surface);
border: 1px solid var(--border);
display: flex;
flex-direction: column;
overflow: hidden;
height: 100%;
min-height: 200px;
min-width: 0;
transition: transform 0.15s, box-shadow 0.15s;
position: relative;
}
.panel.hidden { display: none; }
.panel-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 6px 10px;
background: var(--overlay-subtle);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.panel-header-left {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
}
.panel-title {
font-size: 11px;
font-weight: 700;
color: var(--accent);
: uppercase;
: ;
: nowrap;
: hidden;
: ellipsis;
}
{
: ;
: (--overlay-light);
: (--text-dim);
: ;
: ;
: tabular-nums;
}
{
: ;
: auto;
: ;
: ;
}
::-webkit-scrollbar { : ; }
::-webkit-scrollbar-track { : transparent; }
::-webkit-scrollbar-thumb { : (--border); : ; }
Loading & Error States
.panel-loading {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 32px 16px;
min-height: 120px;
}
.panel-loading-spinner {
width: 32px;
height: 32px;
border: 2px solid var(--border);
border-top-color: var(--green);
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 12px;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.panel-loading-text {
font-size: 12px;
color: var(--accent);
letter-spacing: 0.5px;
}
.panel-error-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8px;
padding: 1.5rem 1rem;
min-height: 120px;
}
{
: (--text-dim);
: ;
}
{
: transparent;
: solid (--border);
: (--text-dim);
: ;
: ;
: pointer;
: ;
}
{
: (--accent);
: (--accent);
}
Row/Item Patterns (reusable across panels)
.item-row {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 8px;
border-bottom: 1px solid var(--border-subtle);
transition: background 0.1s;
}
.item-row:hover { background: var(--surface-hover); }
.item-row:last-child { border-bottom: none; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.badge {
font-size: 9px;
font-weight: 700;
padding: 2px 6px;
border-radius: 3px;
letter-spacing: 0.5px;
}
.badge-live { background: rgba(68, 255, 136, 0.15); color: var(--green); }
.badge-warn { : (, , , ); : (--yellow); }
{ : (, , , ); : (--red); }
{ : tabular-nums; }
Responsive Breakpoints
@media (max-width: 768px) {
.panels-grid {
grid-template-columns: 1fr;
grid-auto-rows: minmax(180px, auto);
}
}
@media (min-width: 1600px) {
.panels-grid {
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
}
App Layout
#app {
display: flex;
flex-direction: column;
height: 100vh;
}
.app-header {
display: flex;
align-items: center;
padding: 8px 12px;
background: var(--surface);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.app-header h1 {
font-size: 14px;
font-weight: 700;
color: var(--green);
letter-spacing: 1px;
text-transform: uppercase;
}
.main-content {
flex: 1;
overflow-y: auto;
}