@pretable/ui 0.3.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -22
- package/dist/grid.css +246 -25
- package/dist/tailwind.css +1 -1
- package/dist/themes/excel.css +18 -0
- package/dist/themes/material.css +50 -3
- package/dist/themes/pretable.css +334 -0
- package/dist/themes/pretable.css.d.ts +2 -0
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @pretable/ui
|
|
2
2
|
|
|
3
|
-
CSS theme + a small JS helper for [pretable](https://pretable.
|
|
3
|
+
CSS theme + a small JS helper for [pretable](https://pretable.ai/). Pair with [`@pretable/react`](../react) for the full surface, or use the JS helper standalone in non-React adapters.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -11,43 +11,57 @@ npm install @pretable/ui
|
|
|
11
11
|
|
|
12
12
|
## Minimal usage
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Two imports at the root of your app — a theme, then `grid.css`:
|
|
15
15
|
|
|
16
16
|
```ts
|
|
17
|
+
import "@pretable/ui/themes/pretable.css";
|
|
17
18
|
import "@pretable/ui/grid.css";
|
|
18
19
|
```
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
`pretable.css` is the house theme and the default. Both imports are load-bearing: `grid.css` imports nothing and declares no token values of its own, so without a theme underneath it its colors, type, and spacing all resolve against variables no one has set.
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
Tailwind v4 users import the same two files, plus the opt-in bridge:
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
@import "tailwindcss";
|
|
27
|
+
@import "@pretable/ui/themes/pretable.css";
|
|
28
|
+
@import "@pretable/ui/grid.css";
|
|
29
|
+
@import "@pretable/ui/tailwind.css";
|
|
25
30
|
```
|
|
26
31
|
|
|
27
|
-
|
|
32
|
+
`tailwind.css` is additive — it adds utility shortcuts for styling _your_ UI in the grid's palette. It is not a substitute for `grid.css`.
|
|
28
33
|
|
|
29
34
|
## CSS API (v1 contract)
|
|
30
35
|
|
|
31
|
-
`@pretable/ui` ships
|
|
36
|
+
`@pretable/ui` ships six CSS entrypoints. The `[data-pretable-*]` selectors `grid.css` targets and the 50 `--pretable-*` tokens the theme files define are the v1 styling contract — pretable's React components (`<Pretable>`, `<PretableSurface>`, `<LabeledGridSurface>`) emit the data attributes these stylesheets target.
|
|
32
37
|
|
|
33
38
|
### Entrypoints
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- `@pretable/ui/
|
|
38
|
-
- `@pretable/ui/themes/
|
|
39
|
-
- `@pretable/ui/themes/
|
|
40
|
+
Nothing here imports anything else; you compose them yourself, in this order.
|
|
41
|
+
|
|
42
|
+
- `@pretable/ui/grid.css` — the grid rules, and the only file in the package that styles a grid element. Its selectors target the `[data-pretable-*]` attributes; every themeable value reads a `--pretable-*` token, so it needs a theme underneath it. Ships inside the `pretable` cascade layer.
|
|
43
|
+
- `@pretable/ui/themes/pretable.css` — the house theme, and the default. Defines all 50 tokens at `:root`, with dark-mode and per-density-tier overrides.
|
|
44
|
+
- `@pretable/ui/themes/excel.css` — Excel compatibility skin. Same 50 tokens; light only, with density tiers.
|
|
45
|
+
- `@pretable/ui/themes/material.css` — Material compatibility skin. Same 50 tokens, with dark mode and density tiers.
|
|
46
|
+
- `@pretable/ui/tailwind.css` — opt-in Tailwind v4 bridge: an `@theme inline` block that re-exports 17 of the 50 tokens as `--color-pt-*` / `--font-pt-*` utility shortcuts (`bg-pt-bg-grid`, `text-pt-accent`, `font-pt-mono`). It contains **no grid rules** — importing it instead of `grid.css` leaves the grid unstyled.
|
|
47
|
+
- `@pretable/ui/tokens.css` — **not part of the grid contract.** A legacy `--pt-*` palette that predates this package's `--pretable-*` namespace; it defines no `--pretable-*` token and styles no grid element. Only pretable's own website consumes it. Consumer apps want a theme file, not this.
|
|
48
|
+
|
|
49
|
+
Pick exactly one theme file. The theme files are unlayered and all declare at `:root`, so loading two resolves by source order token by token — and the two do not necessarily ship the same blocks (Excel has no dark mode), so the result is not "the second theme" either.
|
|
40
50
|
|
|
41
51
|
### Density CSS variables
|
|
42
52
|
|
|
43
|
-
The two
|
|
53
|
+
The two variables `getDensityHeights()` reads:
|
|
54
|
+
|
|
55
|
+
| Variable | Purpose | JS fallback |
|
|
56
|
+
| -------------------------- | ------------------ | ----------- |
|
|
57
|
+
| `--pretable-row-height` | Body row height. | `32px` |
|
|
58
|
+
| `--pretable-header-height` | Header row height. | `36px` |
|
|
59
|
+
|
|
60
|
+
The fallbacks are hard-coded in [`src/density.ts`](./src/density.ts) and apply only when a variable is unset or is not a `<number>px` value — they are not a theme's values. Every shipped theme sets both at every density tier: `pretable` is `48px` / `52px` at standard, Excel `20px` / `24px` at its compact default.
|
|
44
61
|
|
|
45
|
-
|
|
46
|
-
| -------------------------- | ------------------------- | ------------------ |
|
|
47
|
-
| `--pretable-row-height` | `32px` | Body row height. |
|
|
48
|
-
| `--pretable-header-height` | `36px` | Header row height. |
|
|
62
|
+
`@pretable/react` reads a third token in JS, `--pretable-group-panel-height`, and only while the drag-to-group panel is enabled. `getDensityHeights()` does not cover it; the remaining 47 tokens never enter JavaScript at all.
|
|
49
63
|
|
|
50
|
-
The full token set
|
|
64
|
+
The full 50-token set is defined by the theme files in [`src/themes/`](./src/themes/); the [token reference](https://pretable.ai/docs/theming/token-reference) lists every name with its per-theme value. Override any token at `:root` or on a scoped element to change the look.
|
|
51
65
|
|
|
52
66
|
### Data-attribute hooks
|
|
53
67
|
|
|
@@ -65,9 +79,9 @@ layer order or specificity without `!important`. In a Tailwind v4 app declare:
|
|
|
65
79
|
@layer theme, base, pretable, components, utilities;
|
|
66
80
|
```
|
|
67
81
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
82
|
+
Theme files (`themes/*.css`) are intentionally **unlayered** — override tokens
|
|
83
|
+
after importing the theme. See the website's "Cascade & overrides" theming page
|
|
84
|
+
for the full contract.
|
|
71
85
|
|
|
72
86
|
## JS API
|
|
73
87
|
|
package/dist/grid.css
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @layer theme, base, pretable, components, utilities;
|
|
11
11
|
*
|
|
12
12
|
* Consumer recipe:
|
|
13
|
-
* @import "@pretable/ui/themes/
|
|
13
|
+
* @import "@pretable/ui/themes/pretable.css";
|
|
14
14
|
* @import "@pretable/ui/grid.css";
|
|
15
15
|
*/
|
|
16
16
|
|
|
@@ -44,11 +44,17 @@
|
|
|
44
44
|
height: var(--pretable-icon-size, 16px);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
/* Outer viewport (scrollable container)
|
|
47
|
+
/* Outer viewport (scrollable container).
|
|
48
|
+
The card shadow lets a theme separate the grid from the host page with
|
|
49
|
+
elevation instead of a drawn frame — the frame alone cannot go faint,
|
|
50
|
+
because --pretable-rule-strong is also the sticky header's underline and
|
|
51
|
+
owes 3:1 there. Both compatibility skins set it to `none` and are
|
|
52
|
+
unchanged. */
|
|
48
53
|
:where([data-pretable-scroll-viewport]) {
|
|
49
54
|
background: var(--pretable-bg-grid);
|
|
50
55
|
border: 1px solid var(--pretable-rule-strong);
|
|
51
56
|
border-radius: var(--pretable-radius);
|
|
57
|
+
box-shadow: var(--pretable-shadow-card);
|
|
52
58
|
font-family: var(--pretable-font-sans);
|
|
53
59
|
color: var(--pretable-text-cell);
|
|
54
60
|
}
|
|
@@ -227,12 +233,16 @@
|
|
|
227
233
|
line. The spread is <= -blur/2 on purpose — any less negative and the blur
|
|
228
234
|
bleeds above and below each cell and paints a dark band at every row
|
|
229
235
|
boundary inside the pinned region.
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
+
This box-shadow slot is the seam's alone. It used to be contested: the
|
|
237
|
+
cell focus ring was an inset box-shadow too, and box-shadow is not
|
|
238
|
+
additive across rules, so a FOCUSED pinned cell showed the ring and lost
|
|
239
|
+
its seam for as long as it held focus. That was accepted while both
|
|
240
|
+
shipped themes set --pretable-seam-color: transparent and the loss was
|
|
241
|
+
unobservable — a precondition that failed the moment the house theme drew
|
|
242
|
+
a visible seam. The focus ring is now an `outline` (see the Focus rule
|
|
243
|
+
below), which composes with this shadow, so the seam survives focus.
|
|
244
|
+
Anything added here must keep that property: a second box-shadow on this
|
|
245
|
+
element silently wins the whole slot. */
|
|
236
246
|
:where([data-pretable-cell][data-pretable-pinned="left"]) {
|
|
237
247
|
background: var(--pretable-bg-pinned);
|
|
238
248
|
box-shadow: 8px 0 8px -8px var(--pretable-seam-color);
|
|
@@ -280,10 +290,10 @@
|
|
|
280
290
|
that precede this one (base, zebra, group row, pinned) each set
|
|
281
291
|
`background-color`, and hover must tint that rather than replace it.
|
|
282
292
|
Replacing it is not cosmetic — `--pretable-bg-hover` is a translucent
|
|
283
|
-
state layer in
|
|
284
|
-
pinned cells are `position: sticky; z-index: 1` with
|
|
285
|
-
scrolling underneath. A hovered pinned cell that loses its
|
|
286
|
-
lets the scrolled-under column print straight through it. */
|
|
293
|
+
state layer in all three shipped themes (Excel sets it to `transparent`
|
|
294
|
+
outright), and pinned cells are `position: sticky; z-index: 1` with
|
|
295
|
+
unpinned cells scrolling underneath. A hovered pinned cell that loses its
|
|
296
|
+
opaque fill lets the scrolled-under column print straight through it. */
|
|
287
297
|
background-image: linear-gradient(
|
|
288
298
|
var(--pretable-bg-hover),
|
|
289
299
|
var(--pretable-bg-hover)
|
|
@@ -300,23 +310,48 @@
|
|
|
300
310
|
color: var(--pretable-text-selected);
|
|
301
311
|
}
|
|
302
312
|
|
|
303
|
-
/* Focus
|
|
304
|
-
|
|
313
|
+
/* Focus.
|
|
314
|
+
One rule, two arms, drawn with `outline` — never `box-shadow`.
|
|
315
|
+
|
|
316
|
+
The ARIA arm is here for the same reason the selection fill below targets
|
|
317
|
+
`aria-selected`: a custom renderer that emits the ARIA grid pattern
|
|
318
|
+
without pretable's data attributes still gets the ring. @pretable/react
|
|
319
|
+
puts both attributes on the same element, so this used to be TWO rules —
|
|
320
|
+
this outline plus an inset box-shadow keyed on [role="gridcell"] — and
|
|
321
|
+
every focused cell in every shipped app drew both rings at once.
|
|
322
|
+
|
|
323
|
+
`outline`, because box-shadow is not additive across rules: the pinned
|
|
324
|
+
seam above occupies that slot, and a ring declared there erases the
|
|
325
|
+
frozen-column seam for as long as the cell holds focus. Outline composes
|
|
326
|
+
with it. It also matches every other focus affordance in this stylesheet
|
|
327
|
+
(twisty, group chip, menu item), so a consumer restyles one thing. */
|
|
328
|
+
:where(
|
|
329
|
+
[data-pretable-cell][data-pretable-focused="true"],
|
|
330
|
+
[role="gridcell"][data-pretable-focused="true"]
|
|
331
|
+
) {
|
|
305
332
|
outline: 2px solid var(--pretable-focus-ring);
|
|
306
333
|
outline-offset: -2px;
|
|
307
334
|
}
|
|
308
335
|
|
|
309
336
|
/**
|
|
310
|
-
*
|
|
311
|
-
* Targets the ARIA role + aria-selected attribute
|
|
312
|
-
*
|
|
313
|
-
* a
|
|
337
|
+
* Cell-range selection fill (Phase 3).
|
|
338
|
+
* Targets the ARIA role + aria-selected attribute rather than
|
|
339
|
+
* [data-pretable-selected]: @pretable/react sets both from the same
|
|
340
|
+
* condition, so a custom renderer that emits the ARIA grid pattern picks up
|
|
341
|
+
* the fill without also adopting the data attribute.
|
|
342
|
+
*
|
|
343
|
+
* It does NOT make the grid usable without a theme file — this comment used
|
|
344
|
+
* to say so. tokens.css defines no --pretable-* token at all, so with it
|
|
345
|
+
* alone --pretable-selection-bg is unset and the gradient below is invalid.
|
|
346
|
+
* A theme file is required, here as everywhere in this stylesheet.
|
|
314
347
|
*/
|
|
315
348
|
:where([role="gridcell"][aria-selected="true"]) {
|
|
316
349
|
/* A background-image layer for the same reason as hover above:
|
|
317
|
-
`--pretable-selection-bg` is
|
|
318
|
-
|
|
319
|
-
|
|
350
|
+
`--pretable-selection-bg` is translucent in all three shipped themes —
|
|
351
|
+
an 8% color-mix in Excel and Material, a literal rgba at 10% light /
|
|
352
|
+
16% dark in pretable — so the `background` shorthand would replace a
|
|
353
|
+
pinned cell's opaque fill with a mostly-transparent one and let the
|
|
354
|
+
scrolled-under column show through.
|
|
320
355
|
This rule follows hover in source order, so on a cell that is both
|
|
321
356
|
hovered and selected the selection tint wins the background-image slot
|
|
322
357
|
outright — the same precedence the shorthand gave it, unchanged. */
|
|
@@ -326,10 +361,6 @@
|
|
|
326
361
|
);
|
|
327
362
|
}
|
|
328
363
|
|
|
329
|
-
:where([role="gridcell"][data-pretable-focused="true"]) {
|
|
330
|
-
box-shadow: inset 0 0 0 2px var(--pretable-focus-ring);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
364
|
/* Column alignment.
|
|
334
365
|
`justify-content`, not `text-align`: cells are flex containers and an
|
|
335
366
|
unwrapped value is an anonymous flex item, which text-align cannot move.
|
|
@@ -367,6 +398,196 @@
|
|
|
367
398
|
font-variant-numeric: tabular-nums lining-nums;
|
|
368
399
|
}
|
|
369
400
|
|
|
401
|
+
/* ------------------------------------------------------------------------
|
|
402
|
+
Cell presentations. Small, composable readings of a value that a consumer
|
|
403
|
+
opts into from a `render`, not automatic behaviour — the grid never infers
|
|
404
|
+
that a number is a delta. Each one is styled here and emitted by a
|
|
405
|
+
component in @pretable/react, so the markup and the skin cannot drift.
|
|
406
|
+
---------------------------------------------------------------------- */
|
|
407
|
+
|
|
408
|
+
/* Signed numeric change. Direction is carried by a MARKER as well as by
|
|
409
|
+
colour, so it survives greyscale, colour-blindness and a printed page —
|
|
410
|
+
colour alone is not an accessible signal, and a red/green pair is the
|
|
411
|
+
worst possible choice for the most common deficiency.
|
|
412
|
+
|
|
413
|
+
The marker is a real element (PretableDelta emits one from the icon set),
|
|
414
|
+
deliberately NOT a Unicode glyph in a `content:` declaration here. `▲` and
|
|
415
|
+
`▼` are two of the exact characters SP2b removed from this grid: text
|
|
416
|
+
glyphs re-render in whatever font the active theme picked, so their
|
|
417
|
+
weight, size and baseline shift between Excel's Aptos Narrow, Material's
|
|
418
|
+
Roboto and this theme's own stack — and on most UI stacks they are not in
|
|
419
|
+
the font at all and fall through to a platform symbol font, which changes
|
|
420
|
+
the metrics again per OS. A ::before would have saved one node per cell,
|
|
421
|
+
but virtualization already bounds that to the visible rows.
|
|
422
|
+
|
|
423
|
+
`align-items: baseline`, not `center`: a delta is frequently a two-line
|
|
424
|
+
stack (the figure over its percentage), and baseline alignment pins the
|
|
425
|
+
marker to the FIRST line. Centring floats it against the whole stack. */
|
|
426
|
+
:where([data-pretable-delta]) {
|
|
427
|
+
display: inline-flex;
|
|
428
|
+
align-items: baseline;
|
|
429
|
+
gap: 4px;
|
|
430
|
+
font-variant-numeric: tabular-nums lining-nums;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/* The marker rides the TEXT size, not --pretable-icon-size: it sits inline
|
|
434
|
+
beside digits rather than inside a control, and a control-sized glyph next
|
|
435
|
+
to a cell's text reads as a bullet. `1em`, measured against a screenshot —
|
|
436
|
+
the first pass at 0.85em put a 1.1px stroke beside a 14px figure's ~1.4px
|
|
437
|
+
stems and the caret read as an accent mark rather than an arrow. The BOX is
|
|
438
|
+
1em; the caret inside it occupies 4.5 of 16 units, so what a reader sees is
|
|
439
|
+
a mark about a third of the text height, not a 14px blob.
|
|
440
|
+
Declared after the shared icon rule so it wins on source order —
|
|
441
|
+
everything here is :where()-flattened to (0,0,0). */
|
|
442
|
+
:where([data-pretable-delta] [data-pretable-icon]) {
|
|
443
|
+
width: 1em;
|
|
444
|
+
height: 1em;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/* The colour rides the direction. These sit on the presentation element, not
|
|
448
|
+
the cell, so a selected cell's --pretable-text-selected does not erase
|
|
449
|
+
them: the signal must not disappear because a range happens to cover it. */
|
|
450
|
+
:where([data-pretable-delta="up"]) {
|
|
451
|
+
color: var(--pretable-positive);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
:where([data-pretable-delta="down"]) {
|
|
455
|
+
color: var(--pretable-negative);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
:where([data-pretable-delta="flat"]) {
|
|
459
|
+
color: var(--pretable-text-dim);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/* Status: a dot AND a label, both carrying the state for the same reason the
|
|
463
|
+
delta has a marker — a reader who cannot separate the hues still has the
|
|
464
|
+
word. The dot IS generated content here, unlike the delta's marker: it is
|
|
465
|
+
a border-radius box with no text in it, so it has no font to re-render in
|
|
466
|
+
and none of the objection above applies. 7px because a 6px dot goes soft
|
|
467
|
+
against a hairline-ruled surface and an 8px one starts competing with the
|
|
468
|
+
label for weight. */
|
|
469
|
+
:where([data-pretable-status]) {
|
|
470
|
+
display: inline-flex;
|
|
471
|
+
align-items: center;
|
|
472
|
+
gap: 6px;
|
|
473
|
+
color: var(--pretable-text-cell);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/* `:where(sel)::before`, never `:where(sel::before)` — a pseudo-element is
|
|
477
|
+
not a valid argument to :where(), and a browser drops the entire rule. */
|
|
478
|
+
:where([data-pretable-status])::before {
|
|
479
|
+
content: "";
|
|
480
|
+
flex: none;
|
|
481
|
+
width: 7px;
|
|
482
|
+
height: 7px;
|
|
483
|
+
border-radius: 50%;
|
|
484
|
+
background: var(--pretable-text-dim);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
:where([data-pretable-status="positive"])::before {
|
|
488
|
+
background: var(--pretable-positive);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
:where([data-pretable-status="negative"])::before {
|
|
492
|
+
background: var(--pretable-negative);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
:where([data-pretable-status="warning"])::before {
|
|
496
|
+
background: var(--pretable-warning);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
:where([data-pretable-status="info"])::before {
|
|
500
|
+
background: var(--pretable-info);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/* Badge: a hairline chip, never a tinted one. Tinting the fill with the
|
|
504
|
+
text's own hue costs ~0.6 of contrast and drops every tone below AA — the
|
|
505
|
+
worst is 4.13 at a 10% tint over white, and it gets worse deeper. The
|
|
506
|
+
reference designs got this right: a white chip with a hairline and
|
|
507
|
+
restrained text. Tone rides on the TEXT, and what that measures depends on
|
|
508
|
+
the ground the chip inherits, since contrast is a property of the pair:
|
|
509
|
+
4.83–5.17 on a white grid surface (pretable, Excel), 4.71–5.04 on
|
|
510
|
+
Material's #fcfcfc. Every shipped theme clears 4.5. */
|
|
511
|
+
:where([data-pretable-badge]) {
|
|
512
|
+
display: inline-flex;
|
|
513
|
+
align-items: center;
|
|
514
|
+
gap: 5px;
|
|
515
|
+
padding: 1px 8px;
|
|
516
|
+
border: 1px solid var(--pretable-rule-strong);
|
|
517
|
+
border-radius: 999px;
|
|
518
|
+
background: var(--pretable-bg-grid);
|
|
519
|
+
color: var(--pretable-text-cell);
|
|
520
|
+
font-size: 0.85em;
|
|
521
|
+
white-space: nowrap;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
:where([data-pretable-badge][data-pretable-tone="positive"]) {
|
|
525
|
+
color: var(--pretable-positive);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
:where([data-pretable-badge][data-pretable-tone="negative"]) {
|
|
529
|
+
color: var(--pretable-negative);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
:where([data-pretable-badge][data-pretable-tone="warning"]) {
|
|
533
|
+
color: var(--pretable-warning);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
:where([data-pretable-badge][data-pretable-tone="info"]) {
|
|
537
|
+
color: var(--pretable-info);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/* A toned badge also carries a dot, so tone survives peripheral vision.
|
|
541
|
+
Dropping the tinted fill fixed the contrast but cost something real: with
|
|
542
|
+
every chip on the same neutral hairline and white ground, the only tone
|
|
543
|
+
channel left was ~12px of label ink, so scanning a column for "which rows
|
|
544
|
+
are flagged" became reading rather than spotting. The dot restores that as
|
|
545
|
+
shape AND colour without touching the label's contrast at all — it is a
|
|
546
|
+
graphical object, which owes 3:1, and the ramp's floor across the shipped
|
|
547
|
+
grounds is 4.71 (Material's #fcfcfc; 4.83 on the two white ones).
|
|
548
|
+
`currentColor` so it tracks the tone with no extra rule per tone, and the
|
|
549
|
+
base rule's `gap` already reserved the space.
|
|
550
|
+
Note the pseudo-element sits OUTSIDE :where() — `:where(x::before)` is
|
|
551
|
+
invalid and the engine silently keeps it as an empty :where() that matches
|
|
552
|
+
nothing, so it would look present in cssRules and never paint. */
|
|
553
|
+
:where([data-pretable-badge][data-pretable-tone])::before {
|
|
554
|
+
content: "";
|
|
555
|
+
flex: none;
|
|
556
|
+
width: 6px;
|
|
557
|
+
height: 6px;
|
|
558
|
+
border-radius: 50%;
|
|
559
|
+
background: currentColor;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/* Entity: a primary line with a quieter secondary beneath it — the identity
|
|
563
|
+
column pattern. The secondary takes --pretable-text-dim rather than an
|
|
564
|
+
opacity, because every hand-rolled version of this reached for opacity and
|
|
565
|
+
every one of them failed AA. */
|
|
566
|
+
:where([data-pretable-entity]) {
|
|
567
|
+
display: flex;
|
|
568
|
+
flex-direction: column;
|
|
569
|
+
justify-content: center;
|
|
570
|
+
min-width: 0;
|
|
571
|
+
line-height: 1.3;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
:where([data-pretable-entity-primary]) {
|
|
575
|
+
font-weight: 600;
|
|
576
|
+
min-width: 0;
|
|
577
|
+
overflow: hidden;
|
|
578
|
+
text-overflow: ellipsis;
|
|
579
|
+
white-space: nowrap;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
:where([data-pretable-entity-secondary]) {
|
|
583
|
+
color: var(--pretable-text-dim);
|
|
584
|
+
font-size: 0.85em;
|
|
585
|
+
min-width: 0;
|
|
586
|
+
overflow: hidden;
|
|
587
|
+
text-overflow: ellipsis;
|
|
588
|
+
white-space: nowrap;
|
|
589
|
+
}
|
|
590
|
+
|
|
370
591
|
/* Row-selection checkbox column (Phase 4) */
|
|
371
592
|
:where(
|
|
372
593
|
[data-pretable-cell][data-pretable-row-select-cell="true"],
|
package/dist/tailwind.css
CHANGED
package/dist/themes/excel.css
CHANGED
|
@@ -49,6 +49,24 @@
|
|
|
49
49
|
/* Accent */
|
|
50
50
|
--pretable-accent: #107c41; /* Excel brand green */
|
|
51
51
|
|
|
52
|
+
/* Semantic ramp — meaning, not decoration: a signed delta's direction, a
|
|
53
|
+
status dot's state. NOT copied from the reference designs. Their own hues
|
|
54
|
+
fail AA as text on a grid surface — their green #16a34a is 3.30:1 on this
|
|
55
|
+
theme's #ffffff grid ground and their amber #d97706 is 3.19:1, both under
|
|
56
|
+
the 4.5 floor. White is the most forgiving ground a dark hue gets, so a
|
|
57
|
+
tinted surface only makes it worse (3.21 and 3.11 on Material's #fcfcfc).
|
|
58
|
+
They read fine in the screenshots because they sit inside
|
|
59
|
+
chips and bold glyphs, not as 14px text. Re-derived at similar saturation
|
|
60
|
+
but darker, and verified against this theme's #ffffff grid surface:
|
|
61
|
+
positive 5.02:1 negative 4.83:1 warning 4.92:1 info 5.17:1
|
|
62
|
+
Held within 4.83–5.17 of each other on purpose, so no one colour reads
|
|
63
|
+
heavier than its neighbours down the same column. Excel is light-only, so
|
|
64
|
+
it takes the light set unmodified. */
|
|
65
|
+
--pretable-positive: #15803d;
|
|
66
|
+
--pretable-negative: #dc2626;
|
|
67
|
+
--pretable-warning: #a16207;
|
|
68
|
+
--pretable-info: #2563eb;
|
|
69
|
+
|
|
52
70
|
/* Grid controls — derived from this theme's tokens so they recolor coherently */
|
|
53
71
|
--pretable-selection-bg: color-mix(
|
|
54
72
|
in srgb,
|
package/dist/themes/material.css
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Material 3 — baseline scheme (
|
|
2
|
+
* Material 3 — baseline blue scheme (primary #0061a4), neutral surfaces.
|
|
3
|
+
*
|
|
4
|
+
* A compatibility skin: it exists to disappear into an application that already
|
|
5
|
+
* speaks Material, not to be the product's own voice. pretable.css is that.
|
|
6
|
+
*
|
|
7
|
+
* The seed is the M3 baseline blue rather than the purple #6750A4 this file
|
|
8
|
+
* once carried, and the surfaces are the untinted neutral steps (N99 for the
|
|
9
|
+
* grid, N96 one step up for chrome) rather than primary-tinted surface roles.
|
|
3
10
|
* Light at :root; dark at [data-theme="dark"]. Default density: standard.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
11
|
+
* Dark grid uses `surface-container-low` (raw `surface` reads as a void in dark
|
|
12
|
+
* mode per M3 guidance).
|
|
6
13
|
*/
|
|
7
14
|
|
|
8
15
|
:root {
|
|
@@ -56,6 +63,26 @@
|
|
|
56
63
|
/* Accent */
|
|
57
64
|
--pretable-accent: #0061a4; /* primary — M3 baseline blue */
|
|
58
65
|
|
|
66
|
+
/* Semantic ramp — meaning, not decoration: a signed delta's direction, a
|
|
67
|
+
status dot's state. NOT copied from the reference designs. Their own hues
|
|
68
|
+
fail AA as text on a grid surface — their green #16a34a is 3.21:1 on this
|
|
69
|
+
theme's #fcfcfc grid ground and their amber #d97706 is 3.11:1, both under
|
|
70
|
+
the 4.5 floor, and neither is rescued by a whiter ground (3.30 and 3.19 on
|
|
71
|
+
pure white, which is the best a dark hue ever gets). They read fine in the
|
|
72
|
+
screenshots because they sit inside chips and bold glyphs, not as 14px
|
|
73
|
+
text. Re-derived at similar saturation but darker. Contrast is a property
|
|
74
|
+
of the PAIR, so these are measured against this theme's own #fcfcfc grid
|
|
75
|
+
surface and not against the white the other two themes ship:
|
|
76
|
+
positive 4.89:1 negative 4.71:1 warning 4.80:1 info 5.04:1
|
|
77
|
+
Held within 4.71–5.04 of each other on purpose, so no one colour reads
|
|
78
|
+
heavier than its neighbours down the same column. The same four literals
|
|
79
|
+
measure 5.02 / 4.83 / 4.92 / 5.17 on white — the spread travels with the
|
|
80
|
+
ground, the ordering does not. */
|
|
81
|
+
--pretable-positive: #15803d;
|
|
82
|
+
--pretable-negative: #dc2626;
|
|
83
|
+
--pretable-warning: #a16207;
|
|
84
|
+
--pretable-info: #2563eb;
|
|
85
|
+
|
|
59
86
|
/* Grid controls — derived from this theme's tokens so they recolor coherently */
|
|
60
87
|
--pretable-selection-bg: color-mix(
|
|
61
88
|
in srgb,
|
|
@@ -158,6 +185,26 @@
|
|
|
158
185
|
|
|
159
186
|
--pretable-accent: #9ecaff;
|
|
160
187
|
|
|
188
|
+
/* The checked checkbox is the one control whose two halves are set in
|
|
189
|
+
different blocks: the :root block aliases its fill to --pretable-accent
|
|
190
|
+
(which this block moves to a pale #9ecaff) but writes its mark as a
|
|
191
|
+
literal #fff, which is inherited here unchanged. White on #9ecaff is
|
|
192
|
+
1.70:1 — under the 3:1 WCAG 1.4.11 floor for a graphical object, and the
|
|
193
|
+
mark is the entire signal that a row is selected. M3's on-primary (dark)
|
|
194
|
+
is the correct partner for primary (dark), and reads 7.65:1. */
|
|
195
|
+
--pretable-checkbox-checked-fg: #003258; /* on-primary (dark) */
|
|
196
|
+
|
|
197
|
+
/* Semantic ramp, dark. The light set inverts badly here: #15803d is 3.40:1
|
|
198
|
+
on this theme's #1c1c1c grid ground, under the 4.5 floor. These are the
|
|
199
|
+
light hues lightened until they clear that floor from the other side,
|
|
200
|
+
measured against #1c1c1c — on pretable's darker #141418 the same four
|
|
201
|
+
literals read 10.54 / 9.68 / 11.01 / 8.94 —
|
|
202
|
+
positive 9.78:1 negative 8.98:1 warning 10.21:1 info 8.29:1 */
|
|
203
|
+
--pretable-positive: #4ade80;
|
|
204
|
+
--pretable-negative: #fca5a5;
|
|
205
|
+
--pretable-warning: #fbbf24;
|
|
206
|
+
--pretable-info: #93b4ff;
|
|
207
|
+
|
|
161
208
|
/* A 12%-black shadow on a #1c1c1c surface is invisible, so every dark-mode
|
|
162
209
|
popover read as flat until this override existed. Deeper and more opaque
|
|
163
210
|
rather than lighter: M3 keeps shadows black in dark mode and gets the
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pretable — the house theme. The documented default.
|
|
3
|
+
*
|
|
4
|
+
* Excel and Material are imitations; this one is the product's own voice. Its
|
|
5
|
+
* identity is craft, not hue: hairline rules, horizontal-only separation,
|
|
6
|
+
* a quiet header, honest elevation, and colour admitted in two meanings only —
|
|
7
|
+
* interaction/selection and state — with every blue a system convention rather
|
|
8
|
+
* than a brand. See "The interaction hue" below for how the blues divide.
|
|
9
|
+
*
|
|
10
|
+
* THREE SURFACE TIERS. The reference designs get away with near-invisible
|
|
11
|
+
* hairlines because their cards sit on a grey page. pretable never paints the
|
|
12
|
+
* page, so it paints its own canvas instead — INSIDE the component:
|
|
13
|
+
*
|
|
14
|
+
* Tier 1 chrome / inset canvas --pretable-bg-header, --pretable-bg-toolbar
|
|
15
|
+
* The recessed plane. Everything that is not a record: the sticky
|
|
16
|
+
* header rail and the drag-to-group strip. Tinted so the hairlines
|
|
17
|
+
* drawn on it have something to read against.
|
|
18
|
+
* Tier 1.5 structure --pretable-bg-group-row
|
|
19
|
+
* Half a step off the canvas: group headers live inside the data
|
|
20
|
+
* plane but are chrome, so they must not flatten into the records
|
|
21
|
+
* they contain.
|
|
22
|
+
* Tier 2 paper / data --pretable-bg-grid, -grid-alt, -bg-pinned
|
|
23
|
+
* The records. Pure white, including the frozen columns — a pinned
|
|
24
|
+
* column is data, not chrome, and greying it was the old bug.
|
|
25
|
+
* Tier 3 lifted --pretable-bg-tooltip, --pretable-edit-bg
|
|
26
|
+
* Things that leave the plane: menus, popovers, the cell editor.
|
|
27
|
+
*
|
|
28
|
+
* How the tiers separate differs by mode, deliberately:
|
|
29
|
+
* light — tiers 1/2 separate by TONE, tier 3 by SHADOW (paper physics).
|
|
30
|
+
* dark — all three separate by TONE; shadows are invisible on dark ground,
|
|
31
|
+
* so tier 3 is the lightest surface in the theme.
|
|
32
|
+
*
|
|
33
|
+
* The container edge is a hairline plus --pretable-shadow-card, not a drawn
|
|
34
|
+
* frame. --pretable-rule-strong does three jobs at once (container edge,
|
|
35
|
+
* sticky-header seam, popover edge) and is the only thing separating a pinned
|
|
36
|
+
* header from rows scrolling under it, so it is held at >= 3:1 against BOTH
|
|
37
|
+
* the header it sits on and the grid it sits above. It is not near-white.
|
|
38
|
+
*
|
|
39
|
+
* Default density: standard. Designed against a #ffffff to #f4f4f6 page.
|
|
40
|
+
*
|
|
41
|
+
* Override any token at :root or a more specific scope:
|
|
42
|
+
* :root { --pretable-accent: hotpink; }
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
:root {
|
|
46
|
+
color-scheme: light;
|
|
47
|
+
|
|
48
|
+
/* --- Tier 1: chrome / the inset canvas ------------------------------- */
|
|
49
|
+
/* The header is TINTED on purpose. A white header would leave the sticky
|
|
50
|
+
rail separated from scrolling rows by tone alone at ~1.0:1, and would give
|
|
51
|
+
every hairline drawn on it nothing to read against. 1.14:1 off the data
|
|
52
|
+
surface is a whisper — enough to register as a plane, not as a fill. */
|
|
53
|
+
--pretable-bg-header: #eff0f4;
|
|
54
|
+
--pretable-bg-toolbar: #f1f1f4;
|
|
55
|
+
|
|
56
|
+
/* --- Tier 1.5: structure inside the data plane ----------------------- */
|
|
57
|
+
/* Group rows no longer borrow the header token. They sit between the canvas
|
|
58
|
+
and the paper: heavier than a record, lighter than the rail. */
|
|
59
|
+
--pretable-bg-group-row: #f7f7f9;
|
|
60
|
+
|
|
61
|
+
/* --- Tier 2: paper / the records ------------------------------------- */
|
|
62
|
+
--pretable-bg-grid: #ffffff;
|
|
63
|
+
--pretable-bg-grid-alt: #ffffff; /* No zebra — the hairline does the work */
|
|
64
|
+
--pretable-bg-pinned: #ffffff; /* Frozen columns are data, not chrome */
|
|
65
|
+
|
|
66
|
+
/* --- Tier 3: lifted -------------------------------------------------- */
|
|
67
|
+
/* Same white as the paper. In light mode elevation is a shadow, not a tone;
|
|
68
|
+
these surfaces are separated by --pretable-shadow-overlay and a hairline. */
|
|
69
|
+
--pretable-bg-tooltip: #ffffff;
|
|
70
|
+
--pretable-edit-bg: #f7f7fa;
|
|
71
|
+
|
|
72
|
+
/* --- Text ------------------------------------------------------------ */
|
|
73
|
+
/* A quiet header: the label is smaller AND greyer than the data beneath it.
|
|
74
|
+
text-dim is deliberately NOT a clone of text-header — the two shipped
|
|
75
|
+
themes set them to the same literal, which makes the header and the
|
|
76
|
+
secondary content impossible to tune apart. Here the header is the
|
|
77
|
+
quietest text in the grid (5.61:1 on the header it sits on) because it is
|
|
78
|
+
chrome; text-dim is secondary CONTENT (6.78:1 there, 7.72:1 on the grid) and includes a 9px sort-priority badge, so it
|
|
79
|
+
gets more contrast, not less. Both clear AA on every surface they touch. */
|
|
80
|
+
--pretable-text-cell: #1a1a1f;
|
|
81
|
+
--pretable-text-header: #5e5e6a;
|
|
82
|
+
--pretable-text-dim: #52525c;
|
|
83
|
+
|
|
84
|
+
/* --- Lines ----------------------------------------------------------- */
|
|
85
|
+
/* The row hairline. Decorative, so it is allowed to be faint (1.33:1). */
|
|
86
|
+
--pretable-rule: #dfdfe5;
|
|
87
|
+
/* Load-bearing. Container edge, sticky-header seam, popover edge, and the
|
|
88
|
+
boundary a pinned header presents to rows sliding underneath it.
|
|
89
|
+
3.52:1 on the header, 4.00:1 on the grid — clears the 3:1 non-text floor
|
|
90
|
+
against both of its backgrounds. Near-white here is the classic trap. */
|
|
91
|
+
--pretable-rule-strong: #7e7e8b;
|
|
92
|
+
/* No cage. This is the single biggest visual difference from a spreadsheet,
|
|
93
|
+
and it matters more as rows get taller: in a wrapped 90px row a vertical
|
|
94
|
+
divider becomes a long empty channel running through whitespace. */
|
|
95
|
+
--pretable-rule-vertical: transparent;
|
|
96
|
+
--pretable-rule-width: 1px;
|
|
97
|
+
|
|
98
|
+
/* --- Radii ----------------------------------------------------------- */
|
|
99
|
+
--pretable-radius: 10px;
|
|
100
|
+
--pretable-radius-control: 6px;
|
|
101
|
+
|
|
102
|
+
/* --- State ----------------------------------------------------------- */
|
|
103
|
+
/* Hover must stay translucent: it composites over the surface, so an opaque
|
|
104
|
+
value would erase the pinned fill and the group-row fill underneath it. */
|
|
105
|
+
--pretable-bg-hover: rgba(24, 24, 32, 0.05);
|
|
106
|
+
--pretable-bg-selected: #dfe6fb;
|
|
107
|
+
--pretable-text-selected: #131826;
|
|
108
|
+
--pretable-focus-ring: #2554cf;
|
|
109
|
+
--pretable-text-error: #c0271c;
|
|
110
|
+
|
|
111
|
+
/* --- The interaction hue ---------------------------------------------- */
|
|
112
|
+
/* The theme admits colour in two meanings only: "interactive / selected",
|
|
113
|
+
which is blue, and STATE, which is the semantic ramp below. This is the
|
|
114
|
+
QUIET blue of the interaction set — chrome text and icons, and nothing
|
|
115
|
+
else. The other two values live elsewhere in this block, because they do
|
|
116
|
+
different jobs and cannot be one literal:
|
|
117
|
+
#2554cf the loud one — focus ring, checked checkbox, resize
|
|
118
|
+
handle on hover, drop indicator, and at 10% the range
|
|
119
|
+
tint in --pretable-selection-bg.
|
|
120
|
+
--pretable-bg-selected (#dfe6fb) + --pretable-text-selected (#131826)
|
|
121
|
+
a pale blue SURFACE and its ink, behind a selected
|
|
122
|
+
enum option or calendar day. Opaque and a value of its
|
|
123
|
+
own rather than a tint of either blue above: it
|
|
124
|
+
replaces the surface under text instead of
|
|
125
|
+
compositing over it, which is why selection-bg — the
|
|
126
|
+
one that does composite — is the translucent member.
|
|
127
|
+
All of them are system blues rather than brand blues, so the grid reads
|
|
128
|
+
as part of the host app instead of competing with it.
|
|
129
|
+
grid.css reads this token in exactly three places and all three are
|
|
130
|
+
`color:` — the active filter funnel, the filter menu's Clear button, the
|
|
131
|
+
calendar's month arrows on hover. It never fills a surface, which is what
|
|
132
|
+
"and nothing else" above is guarding: the checked checkbox is painted by
|
|
133
|
+
--pretable-checkbox-checked-bg (#2554cf), and the white mark on it is
|
|
134
|
+
6.47:1 there without this token taking part. 7.11:1 as text on the
|
|
135
|
+
#ffffff popover the Clear button and the calendar sit on; 6.24:1 as the
|
|
136
|
+
funnel icon on the #eff0f4 header rail, where the floor is the 3:1
|
|
137
|
+
non-text one. */
|
|
138
|
+
--pretable-accent: #3f5a7a;
|
|
139
|
+
|
|
140
|
+
/* --- The semantic ramp ------------------------------------------------ */
|
|
141
|
+
/* The blues above mean "interactive / selected". These four mean STATE, and
|
|
142
|
+
they are the only other colours the theme admits: a signed delta's
|
|
143
|
+
direction, a status dot's state. They are meaning, never decoration — the
|
|
144
|
+
ramp only ever inks text or fills the status dot, and never a surface tier
|
|
145
|
+
or any piece of chrome. The dot's size is grid.css's to state and
|
|
146
|
+
deliberately not repeated here: a measurement duplicated across packages is
|
|
147
|
+
a measurement that drifts.
|
|
148
|
+
|
|
149
|
+
NOT copied from the reference designs. Their own hues fail AA as text on a
|
|
150
|
+
grid surface: their green #16a34a is 3.30:1 on this theme's #ffffff paper
|
|
151
|
+
and their amber #d97706 is 3.19:1, both under the 4.5 floor. Those are the
|
|
152
|
+
BEST numbers either hue can post — white is the most forgiving ground a
|
|
153
|
+
dark colour ever gets, so any tinted surface is worse (3.21 and 3.11 on
|
|
154
|
+
Material's #fcfcfc). They read fine in the screenshots because they sit
|
|
155
|
+
inside chips and bold glyphs, not as 14px text. Re-derived at similar
|
|
156
|
+
saturation but darker. Contrast is a property of the pair, so these are
|
|
157
|
+
measured against this theme's own paper and hold only there:
|
|
158
|
+
positive 5.02:1 negative 4.83:1 warning 4.92:1 info 5.17:1
|
|
159
|
+
Held within 4.83–5.17 of each other on purpose: spread them and one state
|
|
160
|
+
starts reading as more urgent than another purely because its hue is
|
|
161
|
+
darker, which is a lie the data did not tell. */
|
|
162
|
+
--pretable-positive: #15803d;
|
|
163
|
+
--pretable-negative: #dc2626;
|
|
164
|
+
--pretable-warning: #a16207;
|
|
165
|
+
--pretable-info: #2563eb;
|
|
166
|
+
|
|
167
|
+
/* --- Grid controls --------------------------------------------------- */
|
|
168
|
+
/* Written as literals rather than var() aliases so the dark block can move
|
|
169
|
+
them independently — aliasing checkbox-border to rule-strong is what lets
|
|
170
|
+
an affordance inherit a decorative value. */
|
|
171
|
+
--pretable-selection-bg: rgba(37, 84, 207, 0.1);
|
|
172
|
+
--pretable-checkbox-bg: #ffffff;
|
|
173
|
+
--pretable-checkbox-border: #787885;
|
|
174
|
+
--pretable-checkbox-checked-bg: #2554cf;
|
|
175
|
+
--pretable-checkbox-checked-fg: #ffffff;
|
|
176
|
+
--pretable-resize-handle: transparent;
|
|
177
|
+
--pretable-resize-handle-hover: #2554cf;
|
|
178
|
+
--pretable-reorder-ghost-bg: #ffffff;
|
|
179
|
+
--pretable-reorder-drop-indicator: #2554cf;
|
|
180
|
+
|
|
181
|
+
/* --- Elevation ------------------------------------------------------- */
|
|
182
|
+
/* Two layers each: a 1px contact shadow that grounds the edge, and a wide
|
|
183
|
+
negative-spread ambient that reads as distance. One-layer shadows are the
|
|
184
|
+
tell of a theme that was eyeballed. */
|
|
185
|
+
--pretable-shadow-overlay:
|
|
186
|
+
0 1px 2px rgba(16, 17, 26, 0.06), 0 8px 24px -6px rgba(16, 17, 26, 0.16);
|
|
187
|
+
/* The container. This theme does NOT draw a frame — a hairline plus real
|
|
188
|
+
elevation. Requires grid.css to apply it to the scroll viewport; without
|
|
189
|
+
that the token is inert. */
|
|
190
|
+
--pretable-shadow-card:
|
|
191
|
+
0 1px 2px rgba(16, 17, 26, 0.05), 0 2px 8px -4px rgba(16, 17, 26, 0.1);
|
|
192
|
+
/* The frozen-column edge, now that pinned cells no longer announce
|
|
193
|
+
themselves with a grey fill. Spread must be <= -blur/2 or the blur bleeds
|
|
194
|
+
above and below each pinned cell and bands every row boundary. */
|
|
195
|
+
--pretable-seam-color: rgba(16, 17, 26, 0.2);
|
|
196
|
+
|
|
197
|
+
/* --- Density — natural default = standard ---------------------------- */
|
|
198
|
+
/* Header 52 against rows 48: with the header nearly unfilled, separation
|
|
199
|
+
rests on one hairline, and the rail needs the extra air to read as chrome
|
|
200
|
+
rather than as a first data row. */
|
|
201
|
+
--pretable-row-height: 48px;
|
|
202
|
+
--pretable-header-height: 52px;
|
|
203
|
+
--pretable-group-panel-height: 44px;
|
|
204
|
+
--pretable-cell-padding-x: 16px;
|
|
205
|
+
--pretable-cell-padding-y: 12px;
|
|
206
|
+
--pretable-group-indent: 24px;
|
|
207
|
+
--pretable-font-size-cell: 14px;
|
|
208
|
+
--pretable-font-size-header: 12.5px; /* Smaller than the data it labels */
|
|
209
|
+
|
|
210
|
+
/* Every glyph draws at this size. 14px is the ceiling the chrome allows: the
|
|
211
|
+
glyph renders inside a 14x14 chip-remove button and inside a 16x16
|
|
212
|
+
checkbox minus its border. Not density-scoped — these are affordances,
|
|
213
|
+
not text. */
|
|
214
|
+
--pretable-icon-size: 14px;
|
|
215
|
+
|
|
216
|
+
/* --- Typography ------------------------------------------------------ */
|
|
217
|
+
/* No webfont. A house theme that ships a font dependency cannot disappear
|
|
218
|
+
into a host application, and it costs a network request before first
|
|
219
|
+
paint. The stack resolves to whatever the platform already renders UI in,
|
|
220
|
+
and grid.css supplies the tabular figures. */
|
|
221
|
+
--pretable-font-sans:
|
|
222
|
+
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
|
|
223
|
+
Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
224
|
+
--pretable-font-mono:
|
|
225
|
+
ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", Menlo, Consolas,
|
|
226
|
+
monospace;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* :root is already standard; only non-default tiers need explicit selectors.
|
|
230
|
+
The three height tokens are read by JavaScript and must stay `<n>px` and
|
|
231
|
+
strictly growing across tiers. */
|
|
232
|
+
|
|
233
|
+
[data-density="compact"] {
|
|
234
|
+
--pretable-row-height: 40px;
|
|
235
|
+
--pretable-header-height: 44px;
|
|
236
|
+
--pretable-group-panel-height: 40px;
|
|
237
|
+
--pretable-cell-padding-x: 12px;
|
|
238
|
+
--pretable-cell-padding-y: 8px;
|
|
239
|
+
--pretable-group-indent: 20px;
|
|
240
|
+
--pretable-font-size-cell: 13px;
|
|
241
|
+
--pretable-font-size-header: 12px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
[data-density="spacious"] {
|
|
245
|
+
--pretable-row-height: 56px;
|
|
246
|
+
--pretable-header-height: 60px;
|
|
247
|
+
--pretable-group-panel-height: 52px;
|
|
248
|
+
--pretable-cell-padding-x: 24px;
|
|
249
|
+
--pretable-cell-padding-y: 16px;
|
|
250
|
+
--pretable-group-indent: 32px;
|
|
251
|
+
--pretable-font-size-cell: 15px;
|
|
252
|
+
--pretable-font-size-header: 13px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* Dark mode — colour-only overrides; density inherits from light.
|
|
256
|
+
Every colour token is restated. Nothing is aliased, so nothing can be
|
|
257
|
+
silently forgotten: a white edit-bg or a white checkmark surviving into
|
|
258
|
+
dark mode is the failure this block exists to prevent.
|
|
259
|
+
The tier order inverts: on dark ground, elevation is tone, so the lifted
|
|
260
|
+
tier is the LIGHTEST surface and the data plane is the darkest. */
|
|
261
|
+
|
|
262
|
+
[data-theme="dark"] {
|
|
263
|
+
color-scheme: dark;
|
|
264
|
+
|
|
265
|
+
/* Tier 1 — chrome / the inset canvas */
|
|
266
|
+
--pretable-bg-header: #1e1e24;
|
|
267
|
+
--pretable-bg-toolbar: #1e1e24;
|
|
268
|
+
|
|
269
|
+
/* Tier 1.5 — structure */
|
|
270
|
+
--pretable-bg-group-row: #191920;
|
|
271
|
+
|
|
272
|
+
/* Tier 2 — paper / the records */
|
|
273
|
+
--pretable-bg-grid: #141418;
|
|
274
|
+
--pretable-bg-grid-alt: #141418;
|
|
275
|
+
--pretable-bg-pinned: #141418;
|
|
276
|
+
|
|
277
|
+
/* Tier 3 — lifted. Lighter than the plane below it, because a shadow cast
|
|
278
|
+
onto #141418 is not visible. */
|
|
279
|
+
--pretable-bg-tooltip: #22222a;
|
|
280
|
+
--pretable-edit-bg: #22222a;
|
|
281
|
+
|
|
282
|
+
/* Text */
|
|
283
|
+
--pretable-text-cell: #ededf2;
|
|
284
|
+
--pretable-text-header: #9a9aa8;
|
|
285
|
+
--pretable-text-dim: #adadbb;
|
|
286
|
+
|
|
287
|
+
/* Lines */
|
|
288
|
+
--pretable-rule: #2c2c34;
|
|
289
|
+
--pretable-rule-strong: #70707e; /* 3.40:1 on the header, 3.77:1 on the grid */
|
|
290
|
+
--pretable-rule-vertical: transparent;
|
|
291
|
+
|
|
292
|
+
/* State */
|
|
293
|
+
--pretable-bg-hover: rgba(255, 255, 255, 0.07);
|
|
294
|
+
--pretable-bg-selected: #1e2d52;
|
|
295
|
+
--pretable-text-selected: #dce6ff;
|
|
296
|
+
--pretable-focus-ring: #8ab0ff;
|
|
297
|
+
--pretable-text-error: #ffa19a;
|
|
298
|
+
|
|
299
|
+
/* The one hue */
|
|
300
|
+
--pretable-accent: #8fb2d9;
|
|
301
|
+
|
|
302
|
+
/* The semantic ramp, dark. The light set does not survive the inversion —
|
|
303
|
+
#15803d is 3.66:1 on this theme's #141418 paper, under the 4.5 floor it
|
|
304
|
+
cleared comfortably on white. These are the same hues lightened until
|
|
305
|
+
they clear that floor from the other side, and again held close together.
|
|
306
|
+
Measured against #141418, this theme's own dark paper — the same four
|
|
307
|
+
literals read 9.78 / 8.98 / 10.21 / 8.29 on Material's lighter #1c1c1c:
|
|
308
|
+
positive 10.54:1 negative 9.68:1 warning 11.01:1 info 8.94:1 */
|
|
309
|
+
--pretable-positive: #4ade80;
|
|
310
|
+
--pretable-negative: #fca5a5;
|
|
311
|
+
--pretable-warning: #fbbf24;
|
|
312
|
+
--pretable-info: #93b4ff;
|
|
313
|
+
|
|
314
|
+
/* Grid controls */
|
|
315
|
+
--pretable-selection-bg: rgba(138, 176, 255, 0.16);
|
|
316
|
+
--pretable-checkbox-bg: #141418;
|
|
317
|
+
--pretable-checkbox-border: #727281;
|
|
318
|
+
--pretable-checkbox-checked-bg: #8ab0ff;
|
|
319
|
+
/* Dark ink, not white. White on a light-blue chip is 1.70:1 — the defect
|
|
320
|
+
Material ships because it left this token out of its dark block. */
|
|
321
|
+
--pretable-checkbox-checked-fg: #10131c;
|
|
322
|
+
--pretable-resize-handle: transparent;
|
|
323
|
+
--pretable-resize-handle-hover: #8ab0ff;
|
|
324
|
+
--pretable-reorder-ghost-bg: #22222a;
|
|
325
|
+
--pretable-reorder-drop-indicator: #8ab0ff;
|
|
326
|
+
|
|
327
|
+
/* Elevation — black and deeper. Lightening a shadow in dark mode makes it a
|
|
328
|
+
glow; the separation comes from the tonal step above, not from the shadow. */
|
|
329
|
+
--pretable-shadow-overlay:
|
|
330
|
+
0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 28px -8px rgba(0, 0, 0, 0.7);
|
|
331
|
+
--pretable-shadow-card:
|
|
332
|
+
0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 10px -6px rgba(0, 0, 0, 0.5);
|
|
333
|
+
--pretable-seam-color: rgba(0, 0, 0, 0.62);
|
|
334
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pretable/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "CSS themes, tokens, and grid styles for Pretable.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
"types": "./dist/themes/material.css.d.ts",
|
|
42
42
|
"default": "./dist/themes/material.css"
|
|
43
43
|
},
|
|
44
|
+
"./themes/pretable.css": {
|
|
45
|
+
"types": "./dist/themes/pretable.css.d.ts",
|
|
46
|
+
"default": "./dist/themes/pretable.css"
|
|
47
|
+
},
|
|
44
48
|
"./grid.css": {
|
|
45
49
|
"types": "./dist/grid.css.d.ts",
|
|
46
50
|
"default": "./dist/grid.css"
|
|
@@ -60,7 +64,7 @@
|
|
|
60
64
|
"api:check": "api-extractor run --config api-extractor.json",
|
|
61
65
|
"build": "tsup && node ./scripts/copy-css-assets.mjs",
|
|
62
66
|
"lint": "eslint src --ext .ts",
|
|
63
|
-
"lint:packaging": "publint --strict && attw --pack --exclude-entrypoints ./themes/excel.css ./themes/material.css ./grid.css ./tailwind.css ./tokens.css",
|
|
67
|
+
"lint:packaging": "publint --strict && attw --pack --exclude-entrypoints ./themes/excel.css ./themes/material.css ./themes/pretable.css ./grid.css ./tailwind.css ./tokens.css",
|
|
64
68
|
"test": "vitest run",
|
|
65
69
|
"typecheck": "tsc -p tsconfig.typecheck.json --noEmit"
|
|
66
70
|
}
|