feat(ui): IconButton tones, Switch info slot, wide right sheet, PrintArea / PrintSheet
- IconButton tone=danger|warning|info|success|special|accent: a pastel button (soft background, ink icon) for row actions that stand apart. - Switch info: an element (InfoTip) right after the label instead of after the switch. - Sheet size=wide: a 600 px drawer. - PrintArea: content rendered into <body>, hidden on screen, the only thing printed while mounted; PrintSheet: cards to cut out (dashed cut lines, never split across pages). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -52,6 +52,15 @@
|
||||
.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)); }
|
||||
.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); }
|
||||
.x-btn--tone-success { --x-tone: var(--x-success-rgb); --x-tone-soft: var(--x-success-soft-rgb); --x-tone-ink: var(--x-success-ink-rgb); }
|
||||
.x-btn--tone-special { --x-tone: var(--x-special-rgb); --x-tone-soft: var(--x-special-soft-rgb); --x-tone-ink: var(--x-special-ink-rgb); }
|
||||
.x-btn--tone-accent { --x-tone: var(--x-accent-rgb); --x-tone-soft: var(--x-accent-soft-rgb); --x-tone-ink: var(--x-accent-ink-rgb); }
|
||||
.x-btn--icon.x-btn--sm { width: var(--x-control-sm); }
|
||||
.x-btn--icon.x-btn--lg { width: var(--x-control-lg); }
|
||||
|
||||
@@ -91,6 +100,9 @@
|
||||
}
|
||||
.x-sheet--right {
|
||||
width: min(480px, 100vw); height: 100%;
|
||||
}
|
||||
.x-sheet--right.x-sheet--wide { width: min(600px, 100vw); }
|
||||
.x-sheet--right {
|
||||
border-radius: var(--x-radius-dialog) 0 0 var(--x-radius-dialog);
|
||||
animation: x-slide-left var(--x-duration-base) var(--x-ease);
|
||||
}
|
||||
@@ -313,6 +325,8 @@
|
||||
|
||||
.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); }
|
||||
.x-switch-row__head .x-switch-row__label { display: inline; }
|
||||
.x-switch-row__label { display: block; font-size: var(--x-text-body); line-height: var(--x-leading-body); font-weight: var(--x-weight-medium); color: var(--x-ink); cursor: pointer; }
|
||||
.x-switch-row__description { margin-top: var(--x-space-0-5); font-size: var(--x-text-label); line-height: var(--x-leading-label); color: var(--x-ink-2); }
|
||||
.x-switch-row--disabled .x-switch-row__label { cursor: not-allowed; opacity: 0.6; }
|
||||
@@ -498,3 +512,21 @@
|
||||
.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); }
|
||||
|
||||
/* ── Print (PrintArea / PrintSheet, 2026-11-20) ─────────────────────────────
|
||||
* A mounted .x-print-area is the only thing printed; on screen it is hidden. */
|
||||
.x-print-area { display: none; }
|
||||
@media print {
|
||||
@page { margin: 10mm; }
|
||||
body:has(> .x-print-area) > :not(.x-print-area) { display: none !important; }
|
||||
.x-print-area { display: block; color: #000; background: #fff; }
|
||||
}
|
||||
.x-print-sheet {
|
||||
display: grid; grid-template-columns: repeat(var(--x-print-columns, 3), 1fr);
|
||||
border-top: 1px dashed #888; border-left: 1px dashed #888;
|
||||
}
|
||||
.x-print-sheet > * {
|
||||
break-inside: avoid; page-break-inside: avoid;
|
||||
border-right: 1px dashed #888; border-bottom: 1px dashed #888;
|
||||
padding: 6mm 4mm; display: grid; justify-items: center; align-content: start; gap: 2mm; text-align: center;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user