//! Components: buttons, form controls, cards, alerts, tables, badges, the empty state, the 404 page //! and the "server restarting" bar. Each is one class (or one element) with its states. // --- Buttons ----------------------------------------------------------------------------------- .button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 2.25rem; padding: var(--space-2) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; text-decoration: none; cursor: pointer; box-shadow: var(--shadow); transition: background-color 120ms ease, border-color 120ms ease; } .button:hover { background: var(--surface-2); color: var(--text); } .button:disabled, .button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; } .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); } .button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); } .button.danger { color: var(--danger); border-color: var(--danger); } .button.ghost { background: transparent; box-shadow: none; border-color: transparent; } // --- Form controls ---------------------------------------------------------------------------- label { display: block; font-weight: 550; font-size: var(--text-sm); margin-bottom: var(--space-1); } input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; min-height: 2.25rem; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; } textarea { min-height: 6rem; resize: vertical; } input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; } input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; } .field { display: grid; gap: var(--space-1); } .field + .field { margin-top: var(--space-4); } .field-hint { color: var(--muted); font-size: var(--text-sm); } // --- Cards and text --------------------------------------------------------------------------- .card { padding: var(--space-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); } .card > :last-child { margin-bottom: 0; } .card-title { margin-bottom: var(--space-2); } .muted { color: var(--muted); } .kicker { margin-bottom: var(--space-2); color: var(--muted); font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; } // --- Alerts ----------------------------------------------------------------------------------- .alert, .notice, .warning { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); border: 1px solid transparent; } .alert { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); } // A condition the admin should look at, not a failure of the request. .warning { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); } .notice { background: var(--accent-soft); color: var(--text); border-color: var(--accent-soft); } // --- Tables and badges ------------------------------------------------------------------------ .table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); } .table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); } .table th, .table td { padding: var(--space-2) var(--space-3); text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; } .table th { color: var(--muted); font-weight: 600; background: var(--surface-2); } .table tr:last-child td { border-bottom: 0; } .badge { display: inline-block; padding: 0.1rem var(--space-2); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.8rem; font-weight: 600; white-space: nowrap; } .badge.accent { background: var(--accent-soft); color: var(--accent-strong); } // --- Empty state and the 404 page ------------------------------------------------------------- .empty-state { display: grid; justify-items: center; gap: var(--space-3); padding: var(--space-8) var(--space-6); text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); } .empty-state h2 { margin: 0; color: var(--text); } .empty-state p { margin: 0; max-width: 34rem; } .not-found { text-align: center; padding-block: var(--space-8); } .not-found-code { margin: 0; font-size: 3.5rem; font-weight: 700; letter-spacing: -0.03em; color: var(--accent); line-height: 1; } // --- Server restarting bar -------------------------------------------------------------------- // Pinned to the bottom edge. nav.js creates it only while the server is unreachable, so a page // that never loses the server never shows it. .restart-bar { position: fixed; left: 50%; bottom: var(--space-4); z-index: 50; transform: translateX(-50%); display: flex; align-items: center; gap: var(--space-3); max-width: calc(100vw - 2 * var(--space-4)); padding: var(--space-2) var(--space-4); border-radius: 999px; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); box-shadow: var(--shadow-lift); font-size: var(--text-sm); font-weight: 550; animation: restart-in 180ms ease-out; } .restart-bar::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: currentColor; animation: restart-pulse 1.2s ease-in-out infinite; } @keyframes restart-in { from { opacity: 0; transform: translate(-50%, 0.5rem); } } @keyframes restart-pulse { 50% { opacity: 0.25; } } // While the page is loading a soft navigation or a refresh, its content dims a little. .is-loading main { opacity: 0.6; transition: opacity 120ms ease; } @media (prefers-reduced-motion: reduce) { .restart-bar, .restart-bar::before { animation: none; } .is-loading main, .button { transition: none; } } // Admin pages: tables of projects, columns and members; name and value lists; inline forms; the colour swatch. .admin-table { width: 100%; border-collapse: collapse; td, th { padding: 0.4rem 0.5rem; vertical-align: middle; text-align: start; } } .inline { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; } .facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; dt { color: var(--muted); } dd { margin: 0; } } .tone-dot { display: inline-block; width: 0.75em; height: 0.75em; border-radius: 50%; background: var(--muted); &[data-colour="c0"] { background: #c2d0ff; } &[data-colour="c1"] { background: #9fe0b4; } &[data-colour="c2"] { background: #f2c265; } &[data-colour="c3"] { background: #f5a3a3; } &[data-colour="c4"] { background: #a8d8f0; } &[data-colour="c5"] { background: #d7b3f0; } &[data-colour="c6"] { background: #ffd1a6; } &[data-colour="c7"] { background: #c9d6c2; } }