oficina / sheets Public

Clone
git clone https://amadan.net/oficina/sheets

Plain git — no account needed to clone.

Download

Download this file

1/* Sheets' own chrome, on top of rastrillo's tokens.
2 *
3 * Every colour here is a token, never a literal — a literal does not
4 * follow the person's light/dark choice, and cell fills resolve against
5 * the theme, so one hard-coded grey stays wrong in one of the two
6 * schemes forever.
7 *
8 * Token names are checked mechanically by
9 * internal/guardstest/csstokens_test.go. Five invented ones shipped
10 * here first (--rst-border, --rst-text-mut, --rst-warning,
11 * --rst-font-mono, --rst-shell-bar-h): CSS resolves an undefined custom
12 * property to its fallback in silence, so the page looked plausible and
13 * was simply not themed. The real names are --rst-line,
14 * --rst-text-muted, --rst-tone-warning-fg and --rst-font.
15 */
16
17/* The grid surface fills what is left of the viewport under the bar.
18 *
19 * The shell does that part now: the grid page renders
20 * <div estilo-shell="fill">, and estilo's chrome.css makes that shell
21 * exactly the viewport, holds the bar at its 52px and gives the grid's
22 * <main> the rest (flex: 1, min-block-size: 0). This rule used to be
23 * [rst-shell-topbar]:has([data-sheet-surface]) { height: 100dvh } here,
24 * keyed on rastrillo's wrapper, and before that a guessed topbar height
25 * that made a 771px document in a 720px viewport. What is left is the
26 * surface's own column: the chrome strips and the grid. */
27[data-sheet-surface] {
28 display: flex;
29 flex-direction: column;
30}
31
32/* ── The chrome ──────────────────────────────────────────────────────
33 *
34 * Three strips around the grid, and a budget: the whole lot is about
35 * 7rem above the grid and 2rem below, against Google's ~9.5rem, because
36 * the document title sits in the app's own top bar rather than in a row
37 * of its own.
38 *
39 * Row B — the menu bar and the toolbar, sharing one row. Six short
40 * words are about 300px, so a row holding only the menus wastes
41 * two-thirds of itself. They wrap onto separate rows when they no
42 * longer fit, which is also what keeps this inside a 320px viewport
43 * with no horizontal scroll. */
44[data-chrome] {
45 display: flex;
46 align-items: center;
47 flex-wrap: wrap;
48 gap: var(--rst-sp-1) var(--rst-sp-3);
49 padding: 0 var(--rst-sp-3);
50 border-bottom: 1px solid var(--rst-line);
51 background: var(--rst-surface);
52 color: var(--rst-text);
53}
54
55/* The menu bar is estilo's ([estilo-menubar], [estilo-menu], estilo
56 * menu.css): square titles in the page flow, 9px floating panels, inset
57 * rows and a shortcut column. What was here — rastrillo dropdowns
58 * repositioned with an anchor-positioning override, 6px rounded titles
59 * with no hover, a 17rem panel and inline accordion submenus — went with
60 * it. Only what is Sheets' own is left below. */
61
62/* An item that needs commands.js is rendered hidden until it can run.
63 * estilo's rows are display: flex, which is an author rule and beats the
64 * user agent's [hidden] { display: none } however weak its selector
65 * looks, so hidden is restated. */
66[data-menubar] [estilo-menu] > [hidden] {
67 display: none;
68}
69
70/* The Format menu's two resize forms sit in the panel as rows: the same
71 * inline padding as estilo's items, so their labels line up with the
72 * item text above and below. */
73[data-menubar] [estilo-menu] > [data-size-form] {
74 /* spacing-allow: estilo's item inset, declared in estilo's menu.css, which this check does not read */
75 padding: var(--rst-sp-1) var(--estilo-item-padding-inline, var(--rst-sp-3));
76}
77
78/* ── The keyboard shortcuts dialog ──────────────────────────────────
79 *
80 * Opened from the account menu's Help. A native modal <dialog>, so it is
81 * in the top layer above the bar; a float, so it takes estilo's float
82 * radius and shadow. */
83[data-shortcuts] {
84 inline-size: min(26rem, calc(100vw - 2rem));
85 padding: var(--rst-sp-4);
86 border: 1px solid var(--rst-line);
87 border-radius: var(--estilo-float-radius, 9px);
88 background: var(--rst-surface);
89 color: var(--rst-text);
90 box-shadow: var(--rst-shadow-pop);
91}
92
93[data-shortcuts]::backdrop {
94 background: color-mix(in oklab, var(--rst-text) 30%, transparent);
95}
96
97[data-shortcuts] h2 {
98 margin: 0 0 var(--rst-sp-3);
99 font-size: 1.125rem;
100}
101
102[data-shortcuts] dl {
103 align-items: baseline;
104 display: grid;
105 grid-template-columns: auto 1fr;
106 gap: var(--rst-sp-1) var(--rst-sp-4);
107 margin: 0;
108}
109
110[data-shortcuts] dt {
111 text-align: end;
112}
113
114[data-shortcuts] dt kbd {
115 font-family: var(--rst-font);
116 font-size: var(--rst-fs-sm);
117 font-variant-numeric: tabular-nums;
118}
119
120[data-shortcuts] dd {
121 color: var(--rst-text-muted);
122 font-size: var(--rst-fs-sm);
123 margin: 0;
124}
125
126[data-shortcuts-foot] {
127 display: flex;
128 justify-content: flex-end;
129 margin-block-start: var(--rst-sp-4);
130}
131
132/* ── The toolbar ─────────────────────────────────────────────────────
133 *
134 * `rst-btn="compact"` is not a rastrillo variant — the word appears in
135 * tokens.css only inside comments — so a toolbar built on it would be
136 * silently unstyled. These buttons are ours.
137 *
138 * 1.75rem square, clear of the 24px minimum target, and the pressed
139 * state is a box-shadow ring rather than a border: a border costs
140 * layout, and eleven of them would widen the strip by 22px against a
141 * hard 320px reflow budget. A full ring rather than an underline,
142 * because a one-sided inset shadow follows the border radius round the
143 * corners and reads as a tab stem. */
144[data-toolbar] {
145 align-items: center;
146 display: flex;
147 flex-wrap: wrap;
148 gap: var(--rst-sp-1);
149 padding: var(--rst-sp-1) 0;
150}
151
152/* Square (the suite's square rule, spec §11 and Paul's §13 answer 4):
153 * these buttons are borderless, so their hover and pressed fill is an
154 * in-flow highlight, not a bordered control. They were 6px. */
155[data-tool] {
156 align-items: center;
157 background: transparent;
158 border: 0;
159 border-radius: 0;
160 color: var(--rst-text-muted);
161 cursor: pointer;
162 display: inline-flex;
163 font: inherit;
164 font-size: var(--rst-fs-sm);
165 gap: 0.1rem; /* spacing-allow: a tool's glyph and its caret read as one mark */
166 justify-content: center;
167 min-block-size: 1.75rem;
168 min-inline-size: 1.75rem;
169 padding: 0 var(--rst-sp-1);
170 /* [rst-tip]::after is absolutely positioned and rastrillo does not
171 * position the host, so the tooltip would anchor to the page. */
172 position: relative;
173}
174
175[data-tool]:hover {
176 background: var(--rst-surface-2);
177 color: var(--rst-text);
178}
179
180[data-tool][aria-pressed="true"] {
181 background: var(--rst-accent-soft);
182 box-shadow: inset 0 0 0 1px currentColor;
183 color: var(--rst-accent);
184}
185
186[data-tool]:focus-visible {
187 outline: 2px solid var(--rst-accent);
188 outline-offset: 2px;
189}
190
191[data-tool] svg {
192 block-size: 1rem;
193 fill: none;
194 inline-size: 1rem;
195 stroke: currentColor;
196 stroke-linecap: round;
197 stroke-width: 1.5;
198}
199
200[data-tool-rule] {
201 align-self: stretch;
202 border-inline-start: 1px solid var(--rst-line);
203 margin: var(--rst-sp-1) var(--rst-sp-1);
204}
205
206[data-tool-menu] > summary {
207 padding: 0;
208}
209
210[data-tool-menu] > summary::-webkit-details-marker {
211 display: none;
212}
213
214/* The same pair as the menu bar's, for the same reason and with the
215 * same two branches. A toolbar's colour picker opens under its own
216 * button, not off the right edge of the window. */
217[data-tool-menu] [rst-dropdown-menu] {
218 inset-inline-start: 0;
219 inset-inline-end: auto;
220}
221
222@supports (position-area: block-end) and (position-try-fallbacks: flip-block) {
223 [data-tool-menu] [rst-dropdown-menu] {
224 inset: auto;
225 position-area: block-end span-inline-end;
226 }
227}
228
229/* A picker's tooltip names the button; once its panel is open it only
230 * covers the panel's first row ("No fill"), so it steps aside. */
231[data-tool-menu][open] > [rst-tip]::after {
232 opacity: 0;
233}
234
235[data-tool] [rst-caret] svg {
236 block-size: 0.75rem;
237 inline-size: 0.75rem;
238}
239
240/* The two colour chips on the toolbar show what the anchor cell has,
241 * so the button says what it will do rather than only what it is.
242 * --sheet-h and --sheet-c are set by commands.js from the selection. */
243[data-fill-chip],
244[data-ink-chip] {
245 border-radius: 2px;
246 display: block;
247 inline-size: 1rem;
248 line-height: 1;
249 text-align: center;
250}
251
252[data-fill-chip] {
253 block-size: 1rem;
254 border: 1px solid var(--rst-line);
255 background: var(--rst-surface-2);
256}
257
258[data-fill-chip][data-set] {
259 background: oklch(var(--sheet-fill-l) var(--sheet-c) var(--sheet-h));
260}
261
262[data-ink-chip] {
263 border-bottom: 3px solid var(--rst-text-muted);
264 font-weight: 700;
265}
266
267[data-ink-chip][data-set] {
268 border-bottom-color: oklch(var(--sheet-ink-l) var(--sheet-kc) var(--sheet-kh));
269}
270
271/* A swatch button is its colour with its name beside it. Named, not
272 * colour alone: a picker that only shows colour is unusable to somebody
273 * who cannot tell two of them apart, and the name is also what the
274 * server is sent. */
275[data-swatches] {
276 min-inline-size: 11rem;
277}
278
279/* A swatch button is its colour and then its name, reading left to
280 * right as one thing. The menu's general rule pushes an item's trailing
281 * content to the far end so a keyboard shortcut lines up in a column —
282 * right for "Bold … Ctrl B", wrong here, where it stranded each name
283 * against the opposite edge from its own colour.
284 *
285 * Written at the full depth on purpose: that general rule is
286 * [data-menubar] [rst-dropdown-menu] button, which is (0,2,1), and the
287 * obvious [data-swatches] button is (0,1,1) and loses. */
288[data-menubar] [rst-dropdown-menu] [data-swatches] button {
289 gap: 0;
290 justify-content: flex-start;
291}
292
293[data-swatch]::before {
294 border: 1px solid var(--rst-line);
295 border-radius: 2px;
296 content: "";
297 display: inline-block;
298 block-size: 0.85rem;
299 inline-size: 0.85rem;
300 margin-inline-end: var(--rst-sp-2);
301 vertical-align: -2px;
302 background: oklch(var(--sheet-fill-l) var(--sheet-c) var(--sheet-h));
303}
304
305[data-ink-swatch]::before {
306 background: oklch(var(--sheet-ink-l) var(--sheet-kc) var(--sheet-kh));
307}
308
309/* ── Row C: the name box and the formula bar ─────────────────────────
310 *
311 * The formula bar gets the whole row and all the slack. It used to
312 * share a strip with five links and was capped at 40rem so they had
313 * somewhere to sit; on its own row a cap only truncates long formulas
314 * for no gain. */
315[data-formula-row] {
316 align-items: center;
317 background: var(--rst-surface);
318 border-bottom: 1px solid var(--rst-line);
319 display: flex;
320 gap: var(--rst-sp-2);
321 padding: var(--rst-sp-1) var(--rst-sp-3);
322}
323
324[data-name-box] {
325 flex: 0 0 auto;
326 inline-size: 6rem;
327 text-align: center;
328}
329
330[data-fx] {
331 color: var(--rst-text-faint);
332 flex: 0 0 auto;
333 font-size: var(--rst-fs-sm);
334}
335
336[data-formula-input] {
337 flex: 1;
338 min-inline-size: 0;
339}
340
341/* ── Row D: the tab strip ────────────────────────────────────────────
342 *
343 * One tab today, and deliberately no "+": nothing in this build
344 * creates, names or switches a tab, and spec §14 makes "a second tab is
345 * reachable in the UI" the trigger for multi-worksheet import. */
346[data-tabstrip] {
347 align-items: stretch;
348 background: var(--rst-surface-2);
349 border-top: 1px solid var(--rst-line);
350 display: flex;
351 gap: var(--rst-sp-3);
352 min-block-size: 2rem;
353 padding-inline: var(--rst-sp-3);
354}
355
356[data-sheet-tabs] {
357 display: flex;
358}
359
360[data-sheet-tabs] a {
361 align-items: center;
362 border-bottom: 2px solid transparent;
363 color: var(--rst-text-muted);
364 display: flex;
365 font-size: var(--rst-fs-sm);
366 padding-inline: var(--rst-sp-3);
367 text-decoration: none;
368}
369
370[data-sheet-tabs] a:hover {
371 color: var(--rst-text);
372}
373
374[data-sheet-tabs] a[aria-current] {
375 background: var(--rst-surface);
376 border-bottom-color: var(--rst-accent);
377 color: var(--rst-text);
378 font-weight: 600;
379}
380
381/* The size of the selection, not a sum of it. A total would be the
382 * client doing arithmetic on strings the server rendered, which is the
383 * one thing this design keeps out of JavaScript. */
384[data-selection-size] {
385 align-self: center;
386 color: var(--rst-text-faint);
387 font-size: var(--rst-fs-xs);
388}
389
390/* The transient note. Empty almost always, and the app's only way of
391 * saying something happened or did not: today, that a browser refused
392 * the menu's clipboard read, or that a paste is larger than one write
393 * can carry.
394 *
395 * It takes the slack rather than the live indicator, which is why the
396 * auto margin moved here — otherwise a note appearing shoves the
397 * connection state sideways every time one is shown. Truncates rather
398 * than wrapping: this strip is 2rem and a two-line message would push
399 * the grid. */
400/* A note the person has to act on. Muted grey in a strip under the
401 * grid is the right weight for "12 cells were not pasted" and the
402 * wrong one for "the menu could not paste, use the keyboard" — the
403 * second went unread on the live instance while the menu item read as
404 * simply broken. */
405[data-sheet-note][data-tone="warn"] {
406 color: var(--rst-tone-warning-fg);
407 font-weight: 550;
408}
409
410[data-sheet-note] {
411 align-self: center;
412 color: var(--rst-text-muted);
413 font-size: var(--rst-fs-xs);
414 margin-inline-start: auto;
415 overflow: hidden;
416 text-overflow: ellipsis;
417 white-space: nowrap;
418}
419
420/* The live indicator. It says connected or reconnecting and nothing
421 * else — presence is a later slice, and a dot that claims more than it
422 * knows is worse than no dot. */
423[data-sheet-live] {
424 align-self: center;
425 font-size: var(--rst-fs-xs);
426 color: var(--rst-tone-positive-fg);
427}
428
429[data-sheet-live][data-state="off"] {
430 color: var(--rst-tone-warning-fg);
431}
432
433/* isolation: the vendored grid's stylesheets stack with z-index values
434 * up to 10001. Contained here they compete only with each other, under
435 * the bar's 45 and the menus that float over the grid (spec §5.3). */
436[data-sheet-grid] {
437 flex: 1;
438 min-height: 0;
439 overflow: auto;
440 background: var(--rst-bg);
441 isolation: isolate;
442}
443
444/* ── The vendored grid ───────────────────────────────────────────────
445 *
446 * Jspreadsheet paints its own colours, hard-coded: #fff for the table,
447 * #f3f3f3 for the headers, #ccc for every border. None of them follow a
448 * theme, so all of them are restated here in tokens.
449 *
450 * The selectors are `.jss_*`. Jspreadsheet v5 renamed everything from
451 * v4's `.jexcel`, and this block was first written against `.jexcel` —
452 * so it matched nothing at all, and the grid stayed white inside dark
453 * chrome. Check the vendored stylesheet, not a memory of the last major
454 * version, when these stop working.
455 *
456 * Every rule that sets a background on something carrying text also
457 * sets a color. The library sets background-color on the headers and no
458 * color, so the text is inherited from the page: in dark mode that put
459 * light grey text on a light grey header and the row and column names
460 * became invisible. A background without a foreground beside it is the
461 * bug, not the colour. (The exceptions are the things with no text in
462 * them — the fill handle is a 1px knob.) */
463[data-sheet-grid] .jss_worksheet {
464 background-color: var(--rst-bg);
465 color: var(--rst-text);
466 border-right-color: var(--rst-line);
467 border-bottom-color: var(--rst-line);
468}
469
470[data-sheet-grid] .jss_worksheet > tbody > tr > td {
471 background-color: var(--rst-bg);
472 color: var(--rst-text);
473 border-top-color: var(--rst-line);
474 border-left-color: var(--rst-line);
475}
476
477/* The row and column names. Both headers, one look. */
478[data-sheet-grid] .jss_worksheet > thead > tr > td,
479[data-sheet-grid] .jss_worksheet > tbody > tr > td:first-child {
480 background-color: var(--rst-surface-2);
481 color: var(--rst-text-muted);
482 border-top-color: var(--rst-line);
483 border-left-color: var(--rst-line);
484 font-weight: 600;
485}
486
487/* The names of the selected column and row. The library puts .selected
488 * on the thead td but on the tbody TR — not on its first cell — so the
489 * two halves need different selectors. Written as `td:first-child.selected`
490 * the second half matched nothing at all, and a rule that matches nothing
491 * fails exactly like a rule nobody wrote: the vendored #dcdcdc stood, and
492 * a dark grid grew a light-grey slab down its left edge carrying
493 * --rst-text-muted (#a8b0ba) at 1.60:1. */
494[data-sheet-grid] .jss_worksheet > thead > tr > td.selected,
495[data-sheet-grid] .jss_worksheet > tbody > tr.selected > td:first-child {
496 background-color: var(--rst-accent-soft);
497 color: var(--rst-text);
498}
499
500/* ── The selection ───────────────────────────────────────────────────
501 *
502 * A range is a fill plus an outline. This file used to restate only the
503 * fill, and the outline is where every hard-coded colour in the vendored
504 * stylesheet lives:
505 *
506 * .highlight-right/-bottom border: 1px solid #000
507 * .highlight-top/-left border: 1px solid #000, plus a decorative
508 * box-shadow of #ccc just outside it
509 *
510 * In dark that renders backwards. The black borders disappear into the
511 * grid; the two that do not are overwritten by our own
512 * `td { border-top-color: var(--rst-line) }` above, which is one
513 * specificity step higher than the library's `.jss_worksheet .highlight-top`
514 * — so they become ordinary grid lines, while the #ccc shadow, which
515 * exists only to mask the grid line the border sits on, survives as the
516 * one bright thing on screen. What you get is a navy slab lit down its
517 * top and left and nowhere else, with no way to see where it ends.
518 *
519 * ── Why every rule below is scoped `> tbody > tr > td` ────────────────
520 * Two reasons, and the second is the one that bites.
521 *
522 * 1. The grid-line rule above is (0,2,3). A restatement written at the
523 * library's own `.jss_worksheet .highlight-top` is (0,2,0) and loses
524 * to it — a rule that parses, uses a token, and paints nothing.
525 * 2. sheet.html links the vendored stylesheets in the head block, which
526 * layout.html renders AFTER sheets.css. The library is later in
527 * source order, so equal specificity loses too. Ours must be
528 * strictly higher, never merely equal. That is also the real reason
529 * the vendored #dcdcdc beat the header rule above: both are (0,3,3),
530 * and the vendor came last.
531 *
532 * So: one outline colour, --rst-accent, on all four sides, above both.
533 * Measured on the fill it sits on, 6.59:1 in dark and 4.75:1 in light —
534 * both past 1.4.11's 3:1 for a component boundary. The shadow goes:
535 * with the outline in a colour that reads, masking the line underneath
536 * it buys nothing and costs the selection its symmetry.
537 *
538 * The library gives each of its three range states a different border
539 * STYLE — solid for the selection, dashed for the copy marquee, dotted
540 * for the fill-handle drag preview — and the style survives our
541 * colour-only override. That is the distinction doing the work, so all
542 * three take the same accent and stay told apart by shape. */
543[data-sheet-grid] .jss_worksheet > tbody > tr > td.highlight {
544 background-color: var(--rst-accent-soft);
545 color: var(--rst-text);
546}
547
548/* A link inside a selected cell. Vendored as the browser's own `blue`,
549 * which on the fill in dark is 2.4:1. */
550[data-sheet-grid] .jss_worksheet > tbody > tr > td.highlight > a {
551 color: var(--rst-accent);
552}
553
554[data-sheet-grid] .jss_worksheet > tbody > tr > td.highlight-top,
555[data-sheet-grid] .jss_worksheet > tbody > tr > td.selection-top,
556[data-sheet-grid] .jss_worksheet > tbody > tr > td.copying-top {
557 border-top-color: var(--rst-accent);
558 box-shadow: none;
559}
560
561[data-sheet-grid] .jss_worksheet > tbody > tr > td.highlight-left,
562[data-sheet-grid] .jss_worksheet > tbody > tr > td.selection-left,
563[data-sheet-grid] .jss_worksheet > tbody > tr > td.copying-left {
564 border-left-color: var(--rst-accent);
565 box-shadow: none;
566}
567
568[data-sheet-grid] .jss_worksheet > tbody > tr > td.highlight-right,
569[data-sheet-grid] .jss_worksheet > tbody > tr > td.selection-right,
570[data-sheet-grid] .jss_worksheet > tbody > tr > td.copying-right {
571 border-right-color: var(--rst-accent);
572}
573
574[data-sheet-grid] .jss_worksheet > tbody > tr > td.highlight-bottom,
575[data-sheet-grid] .jss_worksheet > tbody > tr > td.selection-bottom,
576[data-sheet-grid] .jss_worksheet > tbody > tr > td.copying-bottom {
577 border-bottom-color: var(--rst-accent);
578}
579
580/* The rows the fill handle is being dragged over — the preview of what
581 * a release would fill, NOT the range a formula is pointing at. There is
582 * separate formula reference chrome below. `parseFormulas: false` keeps
583 * calculation on the server. The library
584 * adds these classes from updateCopySelection, off `selectedCorner`.
585 * Vendored as rgba(0,0,0,0.05) — a darkening, which on a dark grid is
586 * nothing at all. */
587[data-sheet-grid] .jss_worksheet > tbody > tr > td.selection {
588 background-color: var(--rst-accent-soft);
589 color: var(--rst-text);
590}
591
592/* The anchor — the one cell the keyboard is on. The library paints it
593 * transparent on purpose so it reads out of the fill; our .highlight
594 * rule was opaque and took that back, leaving a range with no visible
595 * cursor in either scheme.
596 *
597 * It comes LAST among the SELECTION rules on purpose. It ties
598 * .highlight and .selection at (0,3,3), and the anchor is inside both
599 * while you drag the fill handle — so on a tie it has to be the later
600 * rule or the cursor disappears at exactly the moment you are aiming
601 * with it.
602 *
603 * **The ring is what actually marks it, and the background no longer
604 * can.** Cell fills are painted further down this file, at the same
605 * (0,3,3) and therefore later, so on a filled range a background-only
606 * anchor is indistinguishable from the rest of the selection — the
607 * exact failure the paragraph above guards against, arriving by a new
608 * route. An inset shadow survives any fill because it is drawn over
609 * one, and it costs no layout, so it cannot shift a cell by a pixel
610 * when the cursor lands on it.
611 *
612 * The background stays for the unfilled case, where it is what makes
613 * the anchor read as "not part of the tint". */
614[data-sheet-grid] .jss_worksheet > tbody > tr > td.highlight-selected {
615 background-color: var(--rst-bg);
616 color: var(--rst-text);
617 box-shadow: inset 0 0 0 2px var(--rst-accent);
618}
619
620/* The fill handle at the corner of the range: a black knob ringed in
621 * white, which in dark reads as a white dot with a dark centre — the
622 * inverse of the thing it is meant to be. It is 1px plus its ring, so
623 * it is the accent or it is invisible. */
624[data-sheet-grid] .jss_corner {
625 background-color: var(--rst-accent);
626 border-color: var(--rst-bg);
627}
628
629/* ── The right-click menu ────────────────────────────────────────────
630 *
631 * Not Jspreadsheet's: jsuites', which it binds to `contextmenu` whether
632 * or not the host app configures one. grid.js turns it off (its stock
633 * items bypass our write paths), so today it never opens. The restatement
634 * stays because the element is still mounted, and TestVendorPaintIsRestated
635 * lists it: vendored it is #fff with #555 text — a white card on a dark
636 * grid — should anything ever open it again.
637 *
638 * It is `position: fixed` and mounted inside the grid, so it is scoped
639 * the same way everything else here is. */
640[data-sheet-grid] .jcontextmenu {
641 background: var(--rst-surface);
642 color: var(--rst-text);
643 border-color: var(--rst-line-strong);
644 box-shadow: var(--rst-shadow-pop);
645}
646
647[data-sheet-grid] .jcontextmenu > div a {
648 color: var(--rst-text);
649}
650
651[data-sheet-grid] .jcontextmenu > div span {
652 color: var(--rst-text-muted);
653}
654
655[data-sheet-grid] .jcontextmenu > div:hover {
656 background: var(--rst-accent-soft);
657 color: var(--rst-text);
658}
659
660[data-sheet-grid] .jcontextmenu .jcontextmenu-disabled a,
661[data-sheet-grid] .jcontextmenu .jcontextmenu-disabled::before {
662 color: var(--rst-text-faint);
663}
664
665[data-sheet-grid] .jcontextmenu hr {
666 border-color: var(--rst-line);
667}
668
669/* The cell editor is an input the library drops into the td. Left
670 * alone it inherits the browser's own white. */
671[data-sheet-grid] .jss_worksheet td input,
672[data-sheet-grid] .jss_worksheet td textarea {
673 font: inherit;
674 letter-spacing: inherit;
675 text-align: inherit;
676 background-color: inherit;
677 color: inherit;
678}
679
680/* iOS zooms the page into any text control under 16px, and tokens.css
681 * brings controls up to 16px where the pointer is coarse. Two of ours
682 * set `font: inherit` with a selector that outweighs tokens.css's bare
683 * `input`, and fell back to 14px: the cell editor above, and estilo's
684 * title field in the bar. Same rule, same max(), restated here at their
685 * weight. TestNoZoomOnTap (make test-browser) measures both. */
686@media (pointer: coarse) {
687 [data-sheet-grid] .jss_worksheet td input,
688 [data-sheet-grid] .jss_worksheet td textarea,
689 [estilo-bar-title-input] {
690 font-size: max(1rem, 1em);
691 }
692}
693
694[data-sheet-grid] .jss_container,
695[data-sheet-grid] .jss_content {
696 background-color: var(--rst-bg);
697}
698
699/* A cell whose imported fill fails WCAG AA against its ink. Spec §11.1
700 * ruled that we retain such a fill rather than silently correcting it,
701 * so the fill stays and this marks it instead: a corner flag that costs
702 * nothing to ignore and is impossible to miss once you look. */
703[data-sheet-grid] td[data-contrast="low"] {
704 position: relative;
705}
706
707[data-sheet-grid] td[data-contrast="low"]::after {
708 content: "";
709 position: absolute;
710 inset-block-start: 0;
711 inset-inline-end: 0;
712 border-block-start: 0.5rem solid var(--rst-tone-warning-fg);
713 border-inline-start: 0.5rem solid transparent;
714 /* A halo in the page's own surface colour, so the flag survives the
715 * fill it is flagging.
716 *
717 * The flag marks a cell whose IMPORTED fill and ink fail AA, and the
718 * fill is an arbitrary colour out of somebody's file — including, in
719 * the case this app cites by name, Excel's #FFEB9C, against which an
720 * amber triangle is invisible in dark mode. A warning that disappears
721 * on exactly the cells it is about is not a warning.
722 *
723 * drop-shadow rather than a border or an outline: those two follow
724 * the box, and this triangle is drawn out of borders, so there is no
725 * box to put an edge on. filter traces the rendered shape. */
726 filter: drop-shadow(0 0 1px var(--rst-surface))
727 drop-shadow(0 0 1px var(--rst-surface));
728}
729
730/* ── The scriptless table ────────────────────────────────────────────
731 *
732 * Not a fallback in the apologetic sense: it is the only view that
733 * works everywhere, and every affordance the grid has exists here too. */
734[data-cell-table] {
735 border-collapse: collapse;
736 width: 100%;
737}
738
739[data-cell-table] th,
740[data-cell-table] td {
741 border: 1px solid var(--rst-line);
742 padding: var(--rst-sp-1) var(--rst-sp-2);
743 text-align: start;
744 vertical-align: top;
745}
746
747[data-cell-table] th {
748 background: var(--rst-surface-2);
749 color: var(--rst-text-muted);
750 font-weight: 600;
751}
752
753/* The cell link, which is every cell.
754 *
755 * Each cell is an anchor, because the link IS the edit affordance in a
756 * view with no script. Left at the browser's default that meant roughly
757 * 650 blue underlined links per page — data and emptiness in the same
758 * colour and the same weight, so `94200` and a blank cell differed only
759 * in glyph width. A spreadsheet you can only read cell by cell is not a
760 * spreadsheet, and this is the view the spec calls the product.
761 *
762 * So the cell reads as a cell and the affordance shows on approach. The
763 * anchor takes the cell's full width and a line of height, so the
764 * target is the whole line rather than the few pixels of the glyph —
765 * which is also what lets an empty cell be clickable without a &nbsp;
766 * standing in for content. It does not stretch to a row made taller by
767 * a wrapped neighbour; that was true of the &nbsp; it replaces too.
768 *
769 * :focus-visible carries the same treatment as :hover deliberately.
770 * Keyboard is the primary way through this view, and a focus ring alone
771 * on a 26-column grid is easy to lose. */
772[data-cell-table] td > a {
773 color: inherit;
774 text-decoration: none;
775 display: block;
776 min-block-size: 1.25rem;
777 /* Square, and the whole cell: the link reaches out over the cell's own
778 * padding and pads itself back in, so its hover fills the cell edge to
779 * edge. It was a 6px rounded pill round the text inside a square cell
780 * — on an empty cell a small floating blob (the square rule, spec §11:
781 * an in-flow highlight is square). */
782 margin: calc(-1 * var(--rst-sp-1)) calc(-1 * var(--rst-sp-2));
783 padding: var(--rst-sp-1) var(--rst-sp-2);
784}
785
786[data-cell-table] td > a:hover,
787[data-cell-table] td > a:focus-visible {
788 background: var(--rst-accent-soft);
789 color: var(--rst-accent);
790}
791
792/* Numbers right, text left — the alignment IS the type signal in a
793 * spreadsheet, and it is the one the grid gives for free and this view
794 * had to be told.
795 *
796 * Both spellings, because there are two of these tables. The editable
797 * one wraps every cell in an anchor, so the alignment has to reach the
798 * block anchor rather than the cell around it; the anonymous link view
799 * has no anchors, because there is nothing on it to edit. One rule for
800 * each, rather than one selector that quietly covers only the surface
801 * that happened to get tested. */
802[data-cell-table] td[data-kind="number"],
803[data-cell-table] td[data-kind="number"] > a {
804 text-align: end;
805}
806
807[data-cell-table] td form {
808 display: flex;
809 gap: var(--rst-sp-1);
810}
811
812[data-cell-table] td input[type="text"] {
813 inline-size: 100%;
814 min-inline-size: 6ch;
815}
816
817/* [data-cell-value] used to be styled here and is now gone. Nothing in
818 * any template or module has ever written that attribute, so the rule
819 * matched no element for the life of the branch — the same defect as
820 * the contrast flag two sections up, which had a rule and no attribute
821 * and therefore warned about cells it never marked.
822 *
823 * A selector that matches nothing is invisible to every test we have
824 * and to every screenshot, which is why it is worth saying it was here
825 * rather than deleting it silently: the next person to want a secondary
826 * line under a table cell should write the markup and the rule
827 * together, not find this and assume it works. */
828
829
830/* Import drop zone ───────────────────────────────────────────────────
831 *
832 * The dashed outline is the whole visual: it says "this box takes a
833 * file" without becoming a second, competing button beside the one that
834 * is already there. The field and its button inside it are untouched
835 * rastrillo, because with scripting off they are the entire feature and
836 * a drop zone that restyles them would be decorating something that
837 * cannot happen.
838 *
839 * The highlight is an ATTRIBUTE toggled by drop.js, not a class: it is
840 * transient state on one element, and the attribute spelling is what
841 * the rest of this app's own hooks use (data-sheet-surface,
842 * data-cell-table).
843 *
844 * transition on border-color only — a person dragging a file across the
845 * page crosses this box repeatedly, and animating the outline is the
846 * difference between a box that acknowledges the drag and one that
847 * flashes. */
848/* :not([data-drop-page]) on both, because there are two zones now and
849 only one of them is a box. The overlay on the sheet list carries
850 data-drop too — it has to, it is what drop.js looks for — and these
851 two selectors are 0-2-0 and 0-3-0, so without the exclusion they beat
852 [rst-modal-overlay]'s 0-1-0 and paint the sheet of glass over the
853 whole page in accent-soft. It renders as a flat blue screen with the
854 list gone: a defect a browser found and no test could. */
855[data-drop]:not([data-drop-page]) {
856 border: 1px dashed var(--rst-line);
857 border-radius: var(--rst-radius);
858 padding: var(--rst-sp-3);
859 transition: border-color 120ms ease, background-color 120ms ease;
860}
861
862[data-drop][data-drop-over]:not([data-drop-page]) {
863 border-color: var(--rst-accent);
864 background: var(--rst-accent-soft);
865}
866
867/* Somebody who has asked for less motion still needs to see the box
868 respond — so the change stays and only the animation goes. */
869@media (prefers-reduced-motion: reduce) {
870 [data-drop] {
871 transition: none;
872 }
873}
874
875/* ── The sheet list's drop overlay ───────────────────────────────────
876 *
877 * The list has no drop box. It has a full-window target that does not
878 * exist until a file is over the window, and drop.js is what reveals
879 * it — see the comment on [data-drop-page] in sheets.html.
880 *
881 * It borrows rastrillo's modal paint rather than growing its own, so
882 * the layer that appears over the list looks like every other layer in
883 * the suite. Only the four rules below are ours.
884 *
885 * THIS FIRST RULE IS LOAD-BEARING. [rst-modal-overlay] sets
886 * display: flex, and an author declaration beats the user agent's
887 * [hidden] { display: none } no matter how weak its selector looks.
888 * Without it the overlay covers the sheet list permanently and the page
889 * is unusable — with scripting off, where nothing would ever come along
890 * to hide it again. TestTheDropOverlayIsHiddenAtRest pins the markup;
891 * this pins the paint. */
892[data-drop-page][hidden] {
893 display: none;
894}
895
896/* A full-window overlay sits above the bar (spec §5.3): rastrillo's
897 * modal overlay is z-index 10, under the bar's 45, so without this the
898 * bar would paint over the top of the drop target. */
899[data-drop-page] {
900 z-index: 50;
901}
902
903/* The overlay is position: fixed, but it is also <main>'s child, and
904 * the stack gives every child after the first a block-start margin,
905 * which a fixed box still takes: it opened 4px below the window's top.
906 * (0,3,0), as the stack's own rule, and later. */
907[rst-stack] > [data-drop-page][rst-modal-overlay] {
908 margin: 0;
909}
910
911[data-drop-page] [rst-modal-panel] {
912 max-width: 24rem;
913 transition: border-color 120ms ease;
914}
915
916/* The panel answers the drag, the same way the box on /sheets/import
917 does and with the same token, so the two read as one gesture. */
918[data-drop-page][data-drop-over] [rst-modal-panel] {
919 border-color: var(--rst-accent);
920}
921
922[data-drop-page-body] {
923 display: grid;
924 gap: var(--rst-sp-3);
925 justify-items: center;
926 padding: var(--rst-sp-5);
927 text-align: center;
928 width: 100%;
929}
930
931[data-drop-page-title] {
932 font-size: var(--rst-fs-base);
933 font-weight: 600;
934 margin: 0;
935}
936
937/* The chooser is for afterwards.
938 *
939 * While a file is over the window the panel has one thing to say, and a
940 * "Choose File" button beside "Drop it to import" offers a second way to
941 * do the thing the person is already doing. It appears when the overlay
942 * is up WITHOUT a drag over it, which is exactly the state a refused
943 * drop leaves behind — and then it is the way out of that refusal. */
944[data-drop-page-recover] {
945 display: grid;
946 gap: var(--rst-sp-3);
947 justify-items: center;
948 width: 100%;
949}
950
951[data-drop-page][data-drop-over] [data-drop-page-recover] {
952 display: none;
953}
954
955@media (prefers-reduced-motion: reduce) {
956 [data-drop-page] [rst-modal-panel] {
957 transition: none;
958 }
959}
960
961/* ── Cell formatting ─────────────────────────────────────────────────
962 *
963 * The paint for a cell's stored Format: bold, italic, alignment, fill
964 * and ink. Every rule is here, in the file the guards read, rather than
965 * in a stylesheet JavaScript generates — a generated sheet is invisible
966 * to TestOurStylesheetHasNoColourLiterals, TestEveryTokenWeUseExists
967 * and TestVendorPaintIsRestated alike, which is three reasons not to
968 * have one. paint.js only sets attributes and two custom properties.
969 *
970 * Specificity: [data-sheet-grid] .jss_worksheet > tbody > tr > td[attr]
971 * is (0,3,3) — one step above the grid-line rule at (0,2,3), as the
972 * restatement rule requires, and equal to the selection rules. So these
973 * are placed AFTER them: a filled cell keeps its fill while selected,
974 * and the selection outline does the work of showing the selection,
975 * which is what every spreadsheet does.
976 *
977 * A colour a person picks HERE is a hue and a chroma with no lightness
978 * — see store/models.go — and the lightness comes from the theme below.
979 * A colour an imported FILE authored is painted exactly as authored,
980 * in both themes, because spec §11.1 says we render a document as
981 * written and warn rather than silently correcting it. */
982
983/* light-dark() is a colour function and cannot hold a number, so these
984 * are written the long way. They still resolve before first paint:
985 * data-theme is server-rendered into the first bytes of the response
986 * (layout.html), so there is no flash of the wrong lightness. */
987:root {
988 --sheet-fill-l: 0.92;
989 --sheet-ink-l: 0.42;
990}
991
992@media (prefers-color-scheme: dark) {
993 :root:not([data-theme="light"]) {
994 --sheet-fill-l: 0.30;
995 --sheet-ink-l: 0.80;
996 }
997}
998
999:root[data-theme="dark"] {
1000 --sheet-fill-l: 0.30;
1001 --sheet-ink-l: 0.80;
1002}
1003
1004[data-sheet-grid] .jss_worksheet > tbody > tr > td[data-b] {
1005 font-weight: 600;
1006}
1007
1008[data-sheet-grid] .jss_worksheet > tbody > tr > td[data-i] {
1009 font-style: italic;
1010}
1011
1012/* ── Alignment, and why these three rules carry !important ───────────
1013 *
1014 * Jspreadsheet writes `text-align` as an INLINE style on every data
1015 * cell, from the column's `align` or from `defaultColAlign`. An inline
1016 * declaration outranks any selector, at any specificity, so the
1017 * ordinary version of these rules set the attribute, reflected
1018 * aria-pressed on the button, and changed nothing on screen. The
1019 * toolbar looked like it worked. Only a browser could see it, and the
1020 * branch's own drive did not check alignment — bold and fill, which
1021 * both paint from properties the library does not touch, passed.
1022 *
1023 * !important is the correct tool here and not a shortcut: it is what
1024 * outranks an inline style, and there is no other. These are new paint
1025 * rather than a restatement of a vendored rule, so the restatement
1026 * guard is unaffected.
1027 *
1028 * The numeric rule is important for the same reason and comes FIRST,
1029 * so an explicit alignment beats it on source order — both are
1030 * important and (0,3,3), so nothing else separates them. */
1031[data-sheet-grid] .jss_worksheet > tbody > tr > td[data-n] {
1032 text-align: end !important;
1033}
1034
1035[data-sheet-grid] .jss_worksheet > tbody > tr > td[data-a="left"] {
1036 text-align: start !important;
1037}
1038
1039[data-sheet-grid] .jss_worksheet > tbody > tr > td[data-a="center"] {
1040 text-align: center !important;
1041}
1042
1043[data-sheet-grid] .jss_worksheet > tbody > tr > td[data-a="right"] {
1044 text-align: end !important;
1045}
1046
1047/* Ours: hue and chroma from the cell, lightness from the theme. */
1048[data-sheet-grid] .jss_worksheet > tbody > tr > td[data-fill] {
1049 background-color: oklch(var(--sheet-fill-l) var(--sheet-c) var(--sheet-h));
1050}
1051
1052[data-sheet-grid] .jss_worksheet > tbody > tr > td[data-ink] {
1053 color: oklch(var(--sheet-ink-l) var(--sheet-kc) var(--sheet-kh));
1054}
1055
1056/* The author's: painted as the file wrote it. --sheet-fx and --sheet-k
1057 * carry a hex that came from a document, which is why a literal is
1058 * acceptable here and nowhere else in this file — it is data, set by
1059 * script from the document, not a colour this stylesheet chose. */
1060[data-sheet-grid] .jss_worksheet > tbody > tr > td[data-fx] {
1061 background-color: var(--sheet-fx);
1062}
1063
1064[data-sheet-grid] .jss_worksheet > tbody > tr > td[data-k] {
1065 color: var(--sheet-k);
1066}
1067
1068/* ── The table view paints what the grid paints ──────────────────────
1069 *
1070 * The same attributes, because the server writes the same attributes
1071 * (tablepaint.go). PRODUCT.md's second principle is why: the scriptless
1072 * path is the product, and a screen that can SET bold but cannot SHOW
1073 * it is the worse half of the feature.
1074 *
1075 * Written as its own block rather than by widening the grid's selectors
1076 * to cover both. Those carry `.jss_worksheet` and `!important` for
1077 * reasons that belong entirely to the vendored library — an inline
1078 * text-align the library writes on every data cell — and none of that
1079 * is true here. A shared selector would carry the library's problem
1080 * onto a table that does not have it, and would make the restatement
1081 * guard's job ambiguous.
1082 *
1083 * No !important, and that is the tell that these are new paint rather
1084 * than a restatement: nothing writes an inline text-align on this
1085 * table. The one inline style a cell here carries is the custom
1086 * properties, which set values rather than win a cascade. */
1087[data-cell-table] td[data-b],
1088[data-cell-table] td[data-b] > a {
1089 font-weight: 600;
1090}
1091
1092[data-cell-table] td[data-i],
1093[data-cell-table] td[data-i] > a {
1094 font-style: italic;
1095}
1096
1097/* The numeric rule comes first so an explicit alignment beats it on
1098 * source order, the same ordering the grid's block relies on. Both are
1099 * (0,2,1) here, so nothing else separates them.
1100 *
1101 * The existing [data-kind="number"] rule above already right-aligns a
1102 * numeric cell; these three are the explicit override, and they have to
1103 * come after it in the file for the same reason. */
1104[data-cell-table] td[data-a="left"],
1105[data-cell-table] td[data-a="left"] > a {
1106 text-align: start;
1107}
1108
1109[data-cell-table] td[data-a="center"],
1110[data-cell-table] td[data-a="center"] > a {
1111 text-align: center;
1112}
1113
1114[data-cell-table] td[data-a="right"],
1115[data-cell-table] td[data-a="right"] > a {
1116 text-align: end;
1117}
1118
1119/* Ours: hue and chroma from the cell, lightness from the theme, so a
1120 * fill somebody picked follows their light/dark choice. Identical to
1121 * the grid's rule and deliberately so — a fill must not be one colour
1122 * on one screen and another on the other. */
1123[data-cell-table] td[data-fill] {
1124 background-color: oklch(var(--sheet-fill-l) var(--sheet-c) var(--sheet-h));
1125}
1126
1127[data-cell-table] td[data-ink],
1128[data-cell-table] td[data-ink] > a {
1129 color: oklch(var(--sheet-ink-l) var(--sheet-kc) var(--sheet-kh));
1130}
1131
1132/* The author's, painted as the file wrote it (spec §11.1). --sheet-fx
1133 * and --sheet-k carry a hex that came out of a document — data, checked
1134 * by previewsvg.go's safeHex before it was ever written into the
1135 * attribute, and not a colour this stylesheet chose. */
1136[data-cell-table] td[data-fx] {
1137 background-color: var(--sheet-fx);
1138}
1139
1140[data-cell-table] td[data-k],
1141[data-cell-table] td[data-k] > a {
1142 color: var(--sheet-k);
1143}
1144
1145/* The cell edit form's formatting row. Six selects and a button, on
1146 * their own line under the value field: side by side they would push
1147 * the table's column wider than the page. */
1148[data-cell-format] {
1149 display: flex;
1150 flex-wrap: wrap;
1151 gap: var(--rst-sp-1);
1152 margin-block-start: var(--rst-sp-1);
1153}
1154
1155[data-cell-format] select {
1156 font-size: var(--rst-fs-xs);
1157 padding-block: var(--rst-sp-1);
1158}
1159
1160/* ── The list's thumbnails ───────────────────────────────────────────
1161 *
1162 * A 26x34 slot at the row's left edge, the same box in the same place
1163 * as the Docs app's, so the two file lists have the same row height and
1164 * read as one product rather than two apps that both grew thumbnails.
1165 *
1166 * The slot is reserved whether or not there is anything to draw: an
1167 * empty sheet renders the empty bordered box, so a row never changes
1168 * height when a sheet gains its first cell. */
1169/* The list card is a <ul> and rastrillo's [rst-list] is written for a
1170 * <div> — its comment says "a list card holds rows", and every rule it
1171 * declares is background, border and radius. It resets nothing, because
1172 * a <div> has nothing to reset.
1173 *
1174 * A <ul> does. The UA stylesheet gives it `padding-inline-start: 40px`
1175 * and `list-style: disc`, and both survived: the 40px is the gap Paul
1176 * saw to the left of the thumbnail on 2026-09-03, and it is 40px of
1177 * card that every row is indented inside. The markers were invisible
1178 * only because they render in that padding, outside the row's own box.
1179 *
1180 * The element stays a <ul>. A list of sheets is a list, and the fix for
1181 * a framework rule that assumed a <div> is to reset what the <div>
1182 * never had — not to drop the semantics that make the list announce as
1183 * one to a screen reader.
1184 *
1185 * It sets no block margin: <main> is Fiesta's stack (layout.html),
1186 * which spaces the list from whatever is above and below it, and whose
1187 * child rule zeroes the <ul>'s UA `margin-block: 1em` anyway. */
1188[data-sheet-list] {
1189 list-style: none;
1190 margin-inline: 0;
1191 padding: 0;
1192}
1193
1194/* [rst-lrow] is a grid, and --rst-cols is rastrillo's own hook for
1195 * saying what its columns are. Setting it is how a row gains a
1196 * thumbnail without overriding anything: without it the row has one
1197 * column and the picture stacks above the title. */
1198[data-sheet-list] [rst-lrow] {
1199 --rst-cols: 26px 1fr;
1200}
1201
1202/* Below 800px rastrillo sets grid-template-columns on [rst-lrow]
1203 * DIRECTLY rather than through --rst-cols, so the hook above stops
1204 * being read and the thumbnail lands in the title's column with an
1205 * empty one trailing. This is (0,2,0) against the framework's (0,1,0),
1206 * so it wins wherever it sits in the file. */
1207@media (max-width: 800px) {
1208 [data-sheet-list] [rst-lrow] {
1209 grid-template-columns: 26px minmax(0, 1fr);
1210 }
1211}
1212
1213/* The share page's two lists: links and people. The same reset the
1214 * sheet list needs — rastrillo's [rst-list] keeps the browser's 40px
1215 * list indent — and two columns, so "Remove" and "Turn off" sit beside
1216 * the row instead of dropping under its name: [rst-lrow] is a one-column
1217 * grid until --rst-cols says otherwise. Below 800px rastrillo sets the
1218 * columns directly, so the narrow rule restates them. */
1219[data-share-list] {
1220 list-style: none;
1221 margin-inline: 0;
1222 padding: 0;
1223}
1224
1225[data-share-list] > [rst-lrow] {
1226 --rst-cols: minmax(0, 1fr) auto;
1227}
1228
1229@media (max-width: 800px) {
1230 [data-share-list] > [rst-lrow] {
1231 grid-template-columns: minmax(0, 1fr) auto;
1232 }
1233}
1234
1235[data-share-list] form {
1236 margin: 0;
1237}
1238
1239[data-preview-slot] {
1240 display: block;
1241 block-size: 34px;
1242 inline-size: 26px;
1243}
1244
1245[data-preview] {
1246 display: block;
1247}
1248
1249/* The Format menu's two resize forms. A row rather than a stack: the
1250 * label, the number and the button read as one control, and the panel
1251 * is already 15rem wide enough to hold them. */
1252[data-size-form] {
1253 align-items: center;
1254 display: flex;
1255 gap: var(--rst-sp-2);
1256 padding: var(--rst-sp-1) var(--rst-sp-2);
1257}
1258
1259/* nowrap is the point of the three rules below, and they are sized
1260 * backwards from it. The panel is 15rem, so a row has 224px of content
1261 * box; at 4rem of field and a button padded to its word, the label is
1262 * left about 100px and "Column width" sets on one line. At the numbers
1263 * this started with — a 4.5rem field and a default-padded button — it
1264 * had 48px and broke over two lines, and the two forms then disagreed
1265 * about their own height. */
1266/* A fixed label column, not flex: 1. The two forms are siblings and
1267 * cannot share a grid, so the only thing that lines their fields and
1268 * their two Set buttons up is both labels reserving the same width —
1269 * with flex: 1 each label took its own text's width and the rows sat
1270 * 33px out of step with each other. */
1271[data-size-form] label {
1272 color: var(--rst-text-muted);
1273 flex: 0 0 7rem;
1274 font-size: var(--rst-fs-sm);
1275 white-space: nowrap;
1276}
1277
1278[data-size-form] input {
1279 inline-size: 4rem;
1280}
1281
1282[data-size-form] button {
1283 padding-inline: var(--rst-sp-2);
1284}
1285
1286/* On a touch screen the field is 16px type (no zoom on tap) and the
1287 * button is padded for a finger, and the row no longer fits: Set hung
1288 * 11-21px out of the panel's right edge. The label column gives the room
1289 * back; "Column width" still sets on one line in 5.5rem, and both rows
1290 * keep the same column, so they stay in step. */
1291@media (pointer: coarse) {
1292 [data-size-form] label {
1293 flex-basis: 5.5rem;
1294 }
1295}
1296
1297/* The referenced range is separate from the cell receiving the formula. */
1298[data-sheet-grid] .jss_worksheet > tbody > tr > td[data-formula-reference] {
1299 outline: 2px solid var(--rst-accent);
1300 outline-offset: -2px;
1301}
1302
1303/* One entry in a comment thread (comments.html): author and time, then
1304 the text, always shown. Entries after the first get a rule between. */
1305[data-comment] > p {
1306 margin: 0;
1307}
1308
1309[data-comment] > p + p {
1310 margin-block-start: var(--rst-sp-1);
1311 white-space: pre-line;
1312}
1313
1314[data-comment] + [data-comment] {
1315 border-block-start: 1px solid var(--rst-line);
1316 margin-block-start: var(--rst-sp-3);
1317 padding-block-start: var(--rst-sp-3);
1318}
1319
1320[data-comment] [rst-row-sub] {
1321 display: inline;
1322 margin-inline-start: var(--rst-sp-2);
1323}
1324
1325/* ── Import from Google Drive ─────────────────────────────────────────
1326 *
1327 * estilo's chooser (estilo-google-import) brings markup and no
1328 * stylesheet, so its paragraphs kept the browser's 1em margins: its
1329 * disclosure sat 24px under its heading and its status 60-odd px under
1330 * the disclosure, around the Choose button the script reveals. Spaced
1331 * here as a column on the scale, the buttons at their own width, until
1332 * estilo spaces it itself. */
1333[estilo-google-import] {
1334 align-items: flex-start;
1335 display: flex;
1336 flex-direction: column;
1337 gap: var(--rst-sp-3);
1338}
1339
1340[estilo-google-import] p {
1341 margin: 0;
1342}
1343
1344/* typestart.js: the keyboard's place on the selected cell, so a dead key
1345 * or an input method composes from the first key. Never seen: the key
1346 * that starts typing opens the cell's own editor, which shows the text.
1347 * 16px type so a touch screen never zooms for it. */
1348[data-type-holder] {
1349 position: fixed;
1350 inline-size: 1px;
1351 block-size: 1px;
1352 padding: 0;
1353 border: 0;
1354 margin: 0;
1355 opacity: 0;
1356 resize: none;
1357 overflow: hidden;
1358 pointer-events: none;
1359 font-size: 16px;
1360}
1361