@pretable/ui 0.15.2 → 0.15.3

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/grid.css CHANGED
@@ -2369,4 +2369,80 @@
2369
2369
  transform: translateX(-50%);
2370
2370
  }
2371
2371
  }
2372
+
2373
+ /* ---- Platform preferences --------------------------------------------
2374
+ Two settings the OS carries and a data grid has to answer for itself: a
2375
+ consumer cannot patch either from outside without re-implementing rules
2376
+ they do not own. */
2377
+
2378
+ /* Windows High Contrast and friends. Forced colours REPLACE every author
2379
+ background, border and text colour with a system pair, and drop
2380
+ background-image and box-shadow outright. Most of this grid survives that
2381
+ unaided — the cage of borders carries the structure, the row-select
2382
+ glyph is drawn in `currentColor`, and the focus ring is an outline the UA
2383
+ forces to CanvasText. The frozen edge loses its gradient, and needs
2384
+ nothing: the pinned cell's own border-right is forced to a system colour
2385
+ and marks the boundary.
2386
+
2387
+ SELECTION does not survive, and that is the one thing here that had to
2388
+ be answered. It is a translucent background-image over the cell (see the
2389
+ range-fill rule above), and forced colours drop the image and force the
2390
+ colour underneath to Canvas — so an eleven-cell range came out identical
2391
+ to no selection at all, with only the single FOCUSED cell marked. What
2392
+ the grid is about to copy became unreadable. System colours, not author
2393
+ ones: `Highlight`/`HighlightText` are the pair the platform guarantees
2394
+ against each other, and inside this block they are honoured rather than
2395
+ forced away. */
2396
+ @media (forced-colors: active) {
2397
+ :where([role="gridcell"][aria-selected="true"]) {
2398
+ /* `forced-color-adjust: none` is load-bearing, not an escape hatch, and
2399
+ it is safe only because the two colours below are the SYSTEM's: the
2400
+ cell still paints in the user's own palette, it is simply painting a
2401
+ state the UA would otherwise have erased.
2402
+ Without it Chromium draws a text BACKPLATE — an opaque Canvas
2403
+ rectangle behind text that sits over a background image, which this
2404
+ cell counts as (the range fill is one). The fill then arrived
2405
+ correctly and every word inside it came out as a solid white block.
2406
+ Computed styles looked right in both cases; only a screenshot told
2407
+ them apart. Dropping the background-image here does NOT lift the
2408
+ backplate — that was tried first. */
2409
+ forced-color-adjust: none;
2410
+ background-color: Highlight;
2411
+ color: HighlightText;
2412
+ }
2413
+ /* A cell opted out of forcing hands its descendants author colours again,
2414
+ so a P&L in red or a badge in amber would paint itself onto the
2415
+ Highlight fill at whatever contrast it happened to have. Inheriting the
2416
+ cell's HighlightText is the only pairing guaranteed against it. */
2417
+ :where([role="gridcell"][aria-selected="true"] *) {
2418
+ color: inherit;
2419
+ }
2420
+ /* On a Highlight ground the ring has to change with it: CanvasText is
2421
+ only guaranteed against Canvas, and this cell is no longer Canvas. */
2422
+ :where(
2423
+ [role="gridcell"][aria-selected="true"][data-pretable-focused="true"]
2424
+ ) {
2425
+ outline-color: HighlightText;
2426
+ }
2427
+ /* GrayText is the system's own disabled ink. Without it a disabled item
2428
+ is forced to CanvasText — the enabled colour — and the menu goes back
2429
+ to offering the one thing that cannot be chosen. */
2430
+ :where([data-pretable-menu-item]:disabled) {
2431
+ color: GrayText;
2432
+ }
2433
+ }
2434
+
2435
+ /* Reduced motion. Every animated declaration in this file is named here:
2436
+ they are all decoration — a twisty swinging, two icons fading in — so
2437
+ each is simply switched off rather than shortened. A consumer's own
2438
+ motion is theirs to handle; this is the grid answering for its own. */
2439
+ @media (prefers-reduced-motion: reduce) {
2440
+ :where(
2441
+ [data-pretable-group-twisty],
2442
+ [data-pretable-filter-funnel],
2443
+ [data-pretable-column-menu-button]
2444
+ ) {
2445
+ transition: none;
2446
+ }
2447
+ }
2372
2448
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pretable/ui",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "CSS themes, tokens, and grid styles for Pretable.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/themes/excel.css CHANGED
@@ -8,6 +8,14 @@
8
8
  */
9
9
 
10
10
  :root {
11
+ /* Declared for the same reason pretable.css does: the browser paints the
12
+ scroll viewport's scrollbars and every native control inside the grid —
13
+ the filter dialog's operator select, its popup list — from this, not from
14
+ the tokens. Without it a dark-mode host keeps this grid's scrollbars light and a light
15
+ select popup, which is the one part of the surface a theme cannot reach
16
+ with a custom property. */
17
+ color-scheme: light;
18
+
11
19
  /* Surfaces */
12
20
  --pretable-bg-grid: #ffffff;
13
21
  --pretable-bg-grid-alt: #ffffff; /* No striping by default — Excel doesn't band */
@@ -13,6 +13,14 @@
13
13
  */
14
14
 
15
15
  :root {
16
+ /* Declared for the same reason pretable.css does: the browser paints the
17
+ scroll viewport's scrollbars and every native control inside the grid —
18
+ the filter dialog's operator select, its popup list — from this, not from
19
+ the tokens. Without it a dark-mode grid keeps light scrollbars and a light
20
+ select popup, which is the one part of the surface a theme cannot reach
21
+ with a custom property. */
22
+ color-scheme: light;
23
+
16
24
  /* Surfaces — M3 neutral grayscale (untinted by primary seed) */
17
25
  --pretable-bg-grid: #fcfcfc; /* N99 */
18
26
  --pretable-bg-grid-alt: #fcfcfc; /* No striping by default — Material list pattern */
@@ -163,6 +171,8 @@
163
171
  /* Dark mode — M3 baseline dark; color-only overrides; density inherits from light. */
164
172
 
165
173
  [data-theme="dark"] {
174
+ color-scheme: dark;
175
+
166
176
  --pretable-bg-grid: #1c1c1c; /* surface-container-low */
167
177
  --pretable-bg-grid-alt: #1c1c1c;
168
178
  --pretable-bg-header: #212121; /* surface-container */