feat(ui): Pane and Page fit/header, inset/fill Tabs, quiet tones, dialog toolbar

- Page `fit` + `Pane`: panes scroll on their own, the page doesn't (from 768 px);
  Page `header`: the title and description above the tabs; the scrollbar's room
  is always kept, so short and long tabs are the same width.
- Tabs `inset` (a card's header: room around the end button) and `fill`.
- IconButton tone: grey at rest, the colour on hover; Button tone (ghost text
  that turns red on hover).
- Dialog / Sheet `toolbar`: stays under the title while the body scrolls.
- A Switch without a label lines up with the buttons beside it.
- DESIGN.md updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 17:51:16 +02:00
co-authored by Claude Opus 5.5
parent 1053703f0d
commit 181b2f16b0
8 changed files with 90 additions and 22 deletions
+34 -5
View File
@@ -52,9 +52,13 @@
.x-btn--danger:hover:not(:disabled) { background: rgb(var(--x-danger-rgb) / 0.88); }
.x-btn--icon { padding: 0; width: var(--x-control-md); }
/* a pastel tone on a button (IconButton tone=…): soft background, ink icon */
.x-btn--tone { background: rgb(var(--x-tone-soft)); color: rgb(var(--x-tone-ink)); }
.x-btn--tone:hover:not(:disabled) { background: rgb(var(--x-tone) / 0.24); color: rgb(var(--x-tone-ink)); }
/* a tone on a button (2026-11-21): quiet at rest, its colour only under the pointer.
* IconButton tone=…: a grey square, the icon in the tone's ink on hover / focus.
* Button tone=… (ghost): plain text, the tone's ink on hover (e.g. "Remove" turns red). */
.x-btn--tone { color: var(--x-ink-2); }
.x-btn--tone:hover:not(:disabled), .x-btn--tone:focus-visible { color: rgb(var(--x-tone-ink)); }
.x-btn--icon.x-btn--tone { background: var(--x-surface-2); }
.x-btn--icon.x-btn--tone:hover:not(:disabled) { background: var(--x-surface-3); }
.x-btn--tone-danger { --x-tone: var(--x-danger-rgb); --x-tone-soft: var(--x-danger-soft-rgb); --x-tone-ink: var(--x-danger-ink-rgb); }
.x-btn--tone-warning { --x-tone: var(--x-warning-rgb); --x-tone-soft: var(--x-warning-soft-rgb); --x-tone-ink: var(--x-warning-ink-rgb); }
.x-btn--tone-info { --x-tone: var(--x-info-rgb); --x-tone-soft: var(--x-info-soft-rgb); --x-tone-ink: var(--x-info-ink-rgb); }
@@ -121,6 +125,7 @@
.x-modal__title { margin: 0; font-size: var(--x-text-title); line-height: var(--x-leading-title); font-weight: var(--x-weight-semibold); }
.x-modal__description { margin: var(--x-space-1) 0 0; font-size: var(--x-text-body); line-height: var(--x-leading-body); color: var(--x-ink-2); }
.x-modal__close { margin: calc(-1 * var(--x-space-1)) calc(-1 * var(--x-space-1)) 0 0; }
.x-modal__toolbar { flex-shrink: 0; padding: var(--x-space-2) var(--x-space-6) var(--x-space-3); border-bottom: var(--x-border-width) solid var(--x-line); }
.x-modal__body {
flex: 1; min-height: 0; overflow-y: auto;
padding: var(--x-space-2) var(--x-space-6) var(--x-space-6);
@@ -325,6 +330,8 @@
.x-switch:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
.x-switch:disabled { opacity: 0.45; cursor: not-allowed; }
/* a switch on its own (no label) lines up with the buttons beside it, not with a text baseline */
.x-switch-bare { display: inline-flex; align-items: center; vertical-align: middle; }
.x-switch-row { display: flex; align-items: center; gap: var(--x-space-4); }
.x-switch-row__text { flex: 1; min-width: 0; }
.x-switch-row__head { display: flex; align-items: center; gap: var(--x-space-1-5); }
@@ -355,9 +362,12 @@
/* ── Page, PageHeader, Toolbar (the page rule, 2026-11-20) ─────────────────
* A page scrolls on its own and is as wide as a 16:9 screen allows, centred beyond. */
.x-page { display: flex; flex-direction: column; height: 100%; min-height: 0; min-width: 0; }
.x-page__top { flex-shrink: 0; border-bottom: var(--x-border-width) solid var(--x-line); background: var(--x-surface); }
.x-page__top { flex-shrink: 0; border-bottom: var(--x-border-width) solid var(--x-line); background: var(--x-surface); overflow: hidden; scrollbar-gutter: stable; }
.x-page__top--header .x-page__top-inner { padding-top: var(--x-page-pad); display: grid; gap: var(--x-space-3); }
.x-page__top-inner { box-sizing: border-box; width: 100%; max-width: var(--x-page-max); margin-inline: auto; padding: 0 var(--x-page-pad); }
.x-page__scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
/* the scrollbar's room is always kept (2026-11-21): a short tab is as wide as a long one, and the
* strip above stays aligned with the body */
.x-page__scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
.x-page__body {
box-sizing: border-box; width: 100%; max-width: var(--x-page-max); margin-inline: auto;
padding: var(--x-page-pad);
@@ -365,6 +375,7 @@
}
.x-page__body--form { max-width: var(--x-page-form-max); }
.x-page__top-inner.x-page__body--form { padding-top: 0; padding-bottom: 0; }
.x-page__top--header .x-page__top-inner.x-page__body--form { padding-top: var(--x-page-pad); }
.x-page__body--flush { padding: 0; }
@media (max-width: 768px) {
.x-page__body, .x-page__top-inner { padding-inline: var(--x-space-4); }
@@ -372,6 +383,20 @@
.x-page__body--flush { padding: 0; }
}
/* Page fit + Pane (2026-11-21): panes scroll on their own, the page doesn't (from 768 px) */
.x-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
border: var(--x-border-width) solid var(--x-line); border-radius: var(--x-radius-card); background: var(--x-surface); box-shadow: var(--x-shadow-raised); }
.x-pane__header, .x-pane__footer { flex-shrink: 0; }
.x-pane__header { border-bottom: var(--x-border-width) solid var(--x-line); }
.x-pane__footer { border-top: var(--x-border-width) solid var(--x-line); }
.x-pane__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.x-pane__body--sunken { background: var(--x-surface-2); }
@media (min-width: 768px) {
.x-page--fit .x-page__scroll { overflow: hidden; }
.x-page--fit .x-page__body { height: 100%; display: flex; flex-direction: column; }
.x-page--fit .x-page__body > * { flex-shrink: 0; }
.x-page--fit .x-page__body > .x-page__fill { flex: 1 1 0; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
}
.x-page-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--x-space-3); }
.x-page-header__titles { flex: 1; min-width: 0; }
.x-page-header__title { margin: 0; display: flex; align-items: center; gap: var(--x-space-1); font-size: var(--x-text-title); line-height: var(--x-leading-title); font-weight: var(--x-weight-semibold); color: var(--x-ink); }
@@ -514,6 +539,10 @@
.x-tabs__badge { min-width: 18px; padding: 0 var(--x-space-1-5); box-sizing: border-box; border-radius: var(--x-radius-full); background: var(--x-surface-2); color: var(--x-ink-2); font-size: var(--x-text-caption); font-weight: var(--x-weight-bold); text-align: center; font-variant-numeric: tabular-nums; }
.x-tabs__badge--warn { background: var(--x-danger-soft); color: var(--x-danger-ink); }
.x-tabs__end { flex-shrink: 0; display: flex; align-items: center; gap: var(--x-space-2); }
.x-tabs--inset { align-items: stretch; padding-inline: var(--x-pad-card); min-height: calc(var(--x-control-sm) + 2 * var(--x-pad-card)); }
.x-tabs--inset .x-tabs__list { align-items: flex-end; }
.x-tabs--inset .x-tabs__end { padding-block: var(--x-pad-card); }
.x-tabs--fill .x-tabs__tab { flex: 1 1 0; justify-content: center; }
/* ── Print (PrintArea / PrintSheet, 2026-11-20) ─────────────────────────────
* A mounted .x-print-area is the only thing printed; on screen it is hidden. */