loopable / web /src /styles /wave67 /format-cells.css
fsanyoto's picture
Deploy AIOS web (React glide grid + FastAPI slice)
a93637f verified
Raw History Blame Contribute Delete
8.02 kB
/* == S67-T16 -- THE FORMAT CELLS DIALOG (Number and Border tabs) ================================
The body of the kit's `ConfirmDialog`, which renders through `BodyPortal` as a direct child of
<body>. Every class here is therefore TOP LEVEL or scoped to `.sheet-format-cells`, never to a
sheet ancestor (a `.sheet-body ...` rule would be dead the moment the portal moved the node).
Tokens only for chrome: no literal font-size, no hex. The one exception is not in this file:
the line colour swatches and the preview's lines are the person's DATA (DESIGN.md 3) and take
their hex inline from the component. One containment layer: the panel sits on the dialog's own
surface, and the preview is the only bordered box inside it. Motion 150 ms ease-out on opacity
and transform only. */
/* Excel's dialog is wider than a confirm: two columns side by side. */
.lp-dialog:has(.sheet-format-cells) {
width: min(560px, calc(100vw - 32px));
}
.lp-dialog-body:has(.sheet-format-cells) {
color: var(--lp-ink);
}
.sheet-format-cells {
display: flex;
flex-direction: column;
gap: 12px;
margin-top: 8px;
font-size: var(--lp-fs-sm);
}
/* -- the tab strip ------------------------------------------------------------------------- */
.sheet-format-cells-tabs {
display: flex;
gap: 4px;
border-bottom: 1px solid var(--lp-line);
}
.sheet-format-cells-tab {
appearance: none;
border: 0;
background: transparent;
font: inherit;
color: var(--lp-muted);
cursor: pointer;
padding: 6px 12px;
margin-bottom: -1px;
border-bottom: 2px solid transparent;
transition: color 150ms ease-out;
}
.sheet-format-cells-tab:hover {
color: var(--lp-ink);
}
.sheet-format-cells-tab.is-on {
color: var(--lp-ink);
font-weight: 600;
border-bottom-color: var(--lp-primary);
}
.sheet-format-cells-tab:focus-visible,
.sheet-format-cells-option:focus-visible,
.sheet-format-cells-swatch:focus-visible,
.sheet-format-cells-preset:focus-visible,
.sheet-format-cells-edge:focus-visible {
outline: 2px solid var(--lp-primary);
outline-offset: 1px;
}
/* Both panels share ONE grid cell, so the dialog is as tall as the taller tab and does not jump
when the tab changes. The inactive panel keeps its `hidden` attribute (out of the tab order and
the accessibility tree through `visibility`), it only keeps its box. */
.sheet-format-cells-panels {
display: grid;
}
.sheet-format-cells-panel {
grid-area: 1 / 1;
min-width: 0;
}
.sheet-format-cells-panel[hidden] {
display: block;
visibility: hidden;
}
.sheet-format-cells-panel:not([hidden]) {
animation: sheet-format-cells-in 150ms ease-out;
}
@keyframes sheet-format-cells-in {
from {
opacity: 0;
transform: translateY(2px);
}
to {
opacity: 1;
transform: none;
}
}
@media (prefers-reduced-motion: reduce) {
.sheet-format-cells-panel:not([hidden]) {
animation: none;
}
}
/* -- shared column anatomy ----------------------------------------------------------------- */
.sheet-format-cells-number,
.sheet-format-cells-border {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
gap: 16px;
}
.sheet-format-cells-col {
display: flex;
flex-direction: column;
gap: 6px;
min-width: 0;
}
.sheet-format-cells-heading {
font-weight: 600;
color: var(--lp-ink);
}
.sheet-format-cells-sub {
font-size: var(--lp-fs-2xs);
color: var(--lp-muted);
}
.sheet-format-cells-note {
margin: 0;
font-size: var(--lp-fs-2xs);
line-height: var(--lp-lh);
color: var(--lp-muted);
}
/* A list is rows in a hairline box, not cards. */
.sheet-format-cells-list {
display: flex;
flex-direction: column;
border: 1px solid var(--lp-line);
border-radius: var(--lp-r-md);
padding: 2px;
}
.sheet-format-cells-option,
.sheet-format-cells-swatch,
.sheet-format-cells-preset,
.sheet-format-cells-edge {
appearance: none;
border: 0;
background: transparent;
font: inherit;
color: inherit;
cursor: pointer;
}
.sheet-format-cells-option {
text-align: left;
padding: 5px 8px;
border-radius: var(--lp-r-sm);
transition: background-color 150ms ease-out;
}
.sheet-format-cells-option:hover {
background: var(--lp-surface-2);
}
.sheet-format-cells-option.is-on {
background: var(--lp-primary-tint);
color: var(--lp-ink);
}
/* -- Number tab ---------------------------------------------------------------------------- */
.sheet-format-cells-sample {
display: block;
padding: 6px 8px;
border-bottom: 1px solid var(--lp-line);
font-variant-numeric: tabular-nums;
color: var(--lp-ink);
min-height: 1.5em;
}
.sheet-format-cells-field {
display: flex;
align-items: center;
gap: 8px;
}
.sheet-format-cells-input {
width: 64px;
padding: 4px 6px;
font: inherit;
color: var(--lp-ink);
background: var(--lp-surface);
border: 1px solid var(--lp-line);
border-radius: var(--lp-r-sm);
}
.sheet-format-cells-check {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
}
/* -- Border tab ---------------------------------------------------------------------------- */
.sheet-format-cells-style {
display: flex;
align-items: center;
padding-top: 7px;
padding-bottom: 7px;
}
.sheet-format-cells-swatches {
display: grid;
grid-template-columns: repeat(6, 22px);
gap: 4px;
}
.sheet-format-cells-swatch {
display: inline-flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
border-radius: var(--lp-r-sm);
}
.sheet-format-cells-swatch.is-on {
box-shadow: inset 0 0 0 2px var(--lp-primary);
}
.sheet-format-cells-chip {
display: block;
width: 14px;
height: 14px;
border-radius: 2px;
box-shadow: inset 0 0 0 1px var(--lp-line);
}
.sheet-format-cells-custom {
cursor: pointer;
}
.sheet-format-cells-color {
width: 22px;
height: 22px;
padding: 0;
border: 1px solid var(--lp-line);
border-radius: var(--lp-r-sm);
background: transparent;
cursor: pointer;
}
.sheet-format-cells-presets {
display: flex;
gap: 16px;
}
.sheet-format-cells-preset {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
padding: 6px 8px;
border-radius: var(--lp-r-md);
font-size: var(--lp-fs-2xs);
transition: background-color 150ms ease-out;
}
.sheet-format-cells-preset:hover,
.sheet-format-cells-edge:hover {
background: var(--lp-surface-2);
}
.sheet-format-cells-preset .sheet-ribbon-icon {
width: 24px;
height: 24px;
color: var(--lp-ink);
}
/* The preview board: edge buttons down the left, the 2 by 2 block, edge buttons underneath. */
.sheet-format-cells-board {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
grid-template-rows: auto auto;
gap: 6px;
align-items: stretch;
}
.sheet-format-cells-edges {
display: flex;
gap: 4px;
}
.sheet-format-cells-edges.is-rows {
grid-column: 1;
grid-row: 1;
flex-direction: column;
justify-content: space-between;
}
.sheet-format-cells-edges.is-cols {
grid-column: 2;
grid-row: 2;
justify-content: space-between;
}
.sheet-format-cells-edge {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
border-radius: var(--lp-r-sm);
box-shadow: inset 0 0 0 1px var(--lp-line);
color: var(--lp-ink);
transition: background-color 150ms ease-out;
}
.sheet-format-cells-edge.is-set {
background: var(--lp-primary-tint);
box-shadow: inset 0 0 0 1px var(--lp-primary);
}
.sheet-format-cells-edge.is-cleared {
color: var(--lp-muted);
}
.sheet-format-cells-preview {
grid-column: 2;
grid-row: 1;
width: 100%;
height: auto;
border: 1px solid var(--lp-line);
border-radius: var(--lp-r-md);
background: var(--lp-surface);
}
.sheet-format-cells-guide {
fill: none;
stroke: var(--lp-line-strong);
stroke-width: 1;
stroke-dasharray: 1 3;
}
.sheet-format-cells-guide.is-cleared {
stroke: var(--lp-line);
}
.sheet-format-cells-hit {
fill: none;
stroke: transparent;
stroke-width: 12;
pointer-events: stroke;
cursor: pointer;
}