//! 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 { 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); } .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; } } // Account pages: the forms, the item lists of the sessions page, the security codes and the // account menu of the topbar. The views only use these class names; nothing here is inline. .stack { display: grid; gap: 0.9rem; } .narrow { max-width: 28rem; width: 100%; margin-inline: auto; } .hint { color: var(--muted); font-size: 0.875rem; margin: 0; } .warning { color: var(--warn); background: var(--warn-soft); border-radius: var(--radius); padding: 0.6rem 0.8rem; margin: 0; } .facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.2rem; margin: 0; dt { color: var(--muted); } dd { margin: 0; } } .links { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; } .qr { width: 240px; height: 240px; max-width: 100%; background: #fff; border-radius: var(--radius); padding: 0.5rem; } .secret, .codes-list code { font-family: var(--font-mono); overflow-wrap: anywhere; } .codes-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.4rem; code { display: block; background: var(--surface-2); border-radius: var(--radius); padding: 0.4rem 0.6rem; font-size: 1.05rem; } } .item-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; } .item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 1rem; } .item-main { display: grid; gap: 0.2rem; min-width: 0; } .item-action { margin: 0; } .user-menu { position: relative; summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.5rem; border-radius: var(--radius); } summary::-webkit-details-marker { display: none; } &[open] > summary { background: var(--surface-2); } } .user-menu-name { font-weight: 600; } .user-menu-panel { position: absolute; right: 0; top: 100%; margin-top: 0.3rem; min-width: 12rem; z-index: 10; display: grid; gap: 0.3rem; padding: 0.3rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / 0.12); } .user-menu-links { display: grid; a { padding: 0.4rem 0.6rem; border-radius: 6px; color: var(--text); text-decoration: none; } a:hover { background: var(--surface-2); } } .user-menu-logout { margin: 0; } /* Profile photos. The picture is always square; the initials image is served the same way. */ .avatar { width: 4rem; height: 4rem; border-radius: 50%; object-fit: cover; flex: none; } .avatar-large { width: 8rem; height: 8rem; border-radius: 50%; object-fit: cover; } .profile-photo { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }