loopable / web /src /styles /wave51 /kit.css
fsanyoto's picture
Deploy AIOS web (React glide grid + FastAPI slice)
9e15897 verified
Raw History Blame
6.96 kB
/* ---------------------------------------------------------------------------
styles/wave51/kit.css β€” W51-T01, the wave-51 base kit.
The ONE confirm dialog's surface, plus the labelled switch row its bodies use.
⚠ IMPORTED FROM index.css, NOT FROM THE COMPONENT, and that breaks with the
convention every wave since 43 has followed. The reason is that this sheet is
consumed by three lanes on pages that have nothing else in common: a
per-component `import "../styles/wave51/kit.css"` lands the rules in whichever
lazy chunk happens to pull it first, so a dialog opened from any other chunk
paints an unstyled <div> over the app while tsc, the build and every source
check stay green. A globally imported sheet cannot fail that way.
⚠ EVERY SELECTOR IS TOP-LEVEL. The dialog renders through `BodyPortal`, so it
is a direct child of <body>; a descendant-scoped rule would simply never match
and would fail with no error at all (`.cg-pop` shipped transparent this way).
β›” NO LITERAL `font-size` ANYWHERE IN THIS FILE. `--lp-fs-*` or nothing β€”
verify_ui.py goes red on a literal, and 32 accumulated sizes is how that rule
was earned (DESIGN.md section 5).
--------------------------------------------------------------------------- */
@import "../sdlc81/dialog-size.css";
/* The scrim. Covering everything is its whole job, so it also carries the layer:
`--cg-z-overlay` is the top of the --cg-z-* ladder declared in index.css. */
.lp-dialog-scrim {
position: fixed;
inset: 0;
z-index: var(--cg-z-overlay);
background: rgba(15, 23, 42, 0.32);
display: flex;
align-items: center;
justify-content: center;
padding: 16px;
}
/* Two radii on this surface at most (DESIGN.md section 2): --lp-r-lg for the
dialog, --lp-r-md for the buttons inside it. */
.lp-dialog {
/* Shared geometry must beat legacy :has() rules and ordinary inline sizes. */
width: var(--lp-dialog-w) !important;
height: var(--lp-dialog-h) !important;
min-width: 0 !important;
max-width: none !important;
min-height: 0 !important;
max-height: none !important;
flex-shrink: 0;
overflow: hidden;
box-sizing: border-box;
background: var(--lp-surface);
border: 1px solid var(--lp-line);
border-radius: var(--lp-r-lg);
/* A tinted shadow, and shadows are allowed here because this IS an overlay
(DESIGN.md section 2: hairlines, not shadows; shadows only on overlays). */
box-shadow: 0 12px 34px rgba(20, 24, 40, 0.17);
padding: 16px;
font: inherit;
font-size: var(--lp-fs-sm);
line-height: var(--lp-lh);
color: var(--lp-ink);
display: flex;
flex-direction: column;
gap: 12px;
}
.lp-dialog-head {
flex-shrink: 0;
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
}
.lp-dialog-title {
margin: 0;
font-size: var(--lp-fs-md);
font-weight: 600;
line-height: var(--lp-lh-tight);
color: var(--lp-ink);
}
.lp-dialog-body {
flex: 1 1 auto;
min-width: 0;
min-height: 0;
overflow: auto;
overscroll-behavior: contain;
scrollbar-gutter: stable;
margin: 0;
color: var(--lp-muted);
}
/* β›” THE CHROME RESET. A native <button> brings its own border, background, font
and colour from the user agent, and the app's type stops at its edge. Every
button rule in this file resets all four in its BASE declaration. */
.lp-dialog-x,
.lp-dialog-btn,
.lp-switch {
appearance: none;
border: 0;
background: transparent;
font: inherit;
color: inherit;
cursor: pointer;
}
.lp-dialog-x {
flex: 0 0 auto;
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
border-radius: var(--lp-r-md);
color: var(--lp-muted);
}
.lp-dialog-x:hover {
background: var(--lp-surface-2);
color: var(--lp-ink);
}
.lp-dialog-x:disabled {
opacity: 0.5;
cursor: default;
}
.lp-dialog-actions {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: flex-end;
gap: 8px;
margin-top: auto;
}
.lp-dialog-btn {
font-size: var(--lp-fs-sm);
font-weight: 500;
padding: 6px 12px;
border-radius: var(--lp-r-md);
min-height: 30px;
display: inline-flex;
align-items: center;
justify-content: center;
}
.lp-dialog-btn:disabled {
opacity: 0.55;
cursor: default;
}
.lp-dialog-btn:focus-visible {
outline: 2px solid var(--lp-blue-deep);
outline-offset: 2px;
}
/* Quiet, because the safe choice does not need to shout. A hairline, not a fill. */
.lp-dialog-btn-quiet {
border: 1px solid var(--lp-line);
color: var(--lp-ink);
}
.lp-dialog-btn-quiet:hover:not(:disabled) {
background: var(--lp-surface-2);
}
/* β›” `--lp-red-deep`, NOT `--lp-red`. DESIGN.md section 8 measures the pair:
--lp-red is a FILL at 1.94:1, so white text on it is unreadable; --lp-red-deep
carries the contrast that makes the label legible. */
.lp-dialog-btn-destructive {
background: var(--lp-red-deep);
color: #ffffff;
}
.lp-dialog-btn-destructive:hover:not(:disabled) {
opacity: 0.9;
}
/* `--lp-primary` at 7.71:1 against white, and `--lp-primary-hover` at 9.47:1.
β›” Never `--cg-primary-hover`: it derives from --lp-blue-solid, the wrong hue. */
.lp-dialog-btn-primary {
background: var(--lp-primary);
color: #ffffff;
}
.lp-dialog-btn-primary:hover:not(:disabled) {
background: var(--lp-primary-hover);
}
/* --- the labelled switch row -------------------------------------------------
⚠ SAME SHAPE AS `.conn-db-switch`, declaration for declaration. It is repeated
rather than reused because styles/wave49/connectors.css is imported from the
connectors components, so its rules reach only the chunks those pages pull in;
a dialog opened elsewhere would show a bare button with no track and no knob.
β›” If the switch shape changes, change it in BOTH files. One shape, two homes. */
.lp-toggle-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.lp-toggle-label {
font-size: var(--lp-fs-sm);
color: var(--lp-ink);
}
.lp-switch {
border: 1px solid var(--lp-line);
background: var(--lp-surface-2);
flex: 0 0 auto;
width: 34px;
height: 20px;
padding: 2px;
border-radius: var(--lp-r-pill);
display: inline-flex;
align-items: center;
/* ⚠ NO TRANSITION ON THE TRACK: DESIGN.md section 4 allows motion on opacity and
transform only, so the knob's translate carries the change and the fill swaps. */
}
.lp-switch.is-on {
border-color: var(--lp-primary);
background: var(--lp-primary);
}
.lp-switch:focus-visible {
outline: 2px solid var(--lp-blue-deep);
outline-offset: 2px;
}
.lp-switch:disabled {
opacity: 0.55;
cursor: default;
}
.lp-switch-knob {
width: 14px;
height: 14px;
border-radius: var(--lp-r-pill);
background: var(--lp-surface);
transform: translateX(0);
transition: transform 0.12s ease;
}
.lp-switch.is-on .lp-switch-knob {
transform: translateX(14px);
background: #ffffff;
}