@pretable/ui 0.10.0 → 0.12.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.
@@ -646,10 +646,14 @@
646
646
  padding-top: var(--pretable-cell-padding-y);
647
647
  }
648
648
 
649
+ /* The tool panel's visibility toggle is enrolled here rather than restyled
650
+ in its own section: it IS this checkbox, and two hand-kept copies of the
651
+ same control are how a theme edit makes them drift apart. */
649
652
  :where(
650
653
  button[data-pretable-row-select],
651
654
  button[data-pretable-row-select-all],
652
- button[data-pretable-bool-cell]
655
+ button[data-pretable-bool-cell],
656
+ button[data-pretable-tool-column-toggle]
653
657
  ) {
654
658
  width: 16px;
655
659
  height: 16px;
@@ -668,7 +672,8 @@
668
672
  :where(
669
673
  button[data-pretable-row-select][aria-checked="true"],
670
674
  button[data-pretable-row-select-all][aria-checked="true"],
671
- button[data-pretable-bool-cell][aria-checked="true"]
675
+ button[data-pretable-bool-cell][aria-checked="true"],
676
+ button[data-pretable-tool-column-toggle][aria-checked="true"]
672
677
  ) {
673
678
  background: var(--pretable-checkbox-checked-bg);
674
679
  border-color: var(--pretable-checkbox-checked-bg);
@@ -702,12 +707,60 @@
702
707
  outline-offset: 1px;
703
708
  }
704
709
 
710
+ /* ---- Header overlay slot geometry ------------------------------------ */
711
+
712
+ /* Where each of the three header controls sits, counted back from a column's
713
+ trailing edge. @pretable/react reads these from the inline styles it writes
714
+ on the slots — `left: var(--pretable-header-funnel-slot)` — and that
715
+ indirection is the whole point: while the offsets were inline LITERALS
716
+ (`left: -4`, `left: -22`, `left: -40`) nothing in any stylesheet could move
717
+ them, since an inline style beats every rule, `!important` and `@layer`
718
+ included. The anchor arithmetic stays in JS; only the offsets are themeable.
719
+
720
+ A fine pointer, as half-open intervals back from the trailing edge at 0:
721
+
722
+ resize strip [ -4, 0) 4px, and that box is its whole target
723
+ funnel glyph [-22, -4) 18px drawn
724
+ funnel target [-28, -4) 24px reachable — the `::after` further down
725
+ menu glyph [-46, -28) 18px drawn, and that box is its whole target
726
+
727
+ The funnel's 18px glyph carries a 24px tap target (the transparent
728
+ `::after` below), so it reaches to -28 and the menu has to start there, not
729
+ at -22 + 18 = -40. At -40 the menu button — later in tree order, same
730
+ stacking context — painted over the six pixels of funnel target that ran
731
+ underneath it, and the funnel's REACHABLE width measured 17: narrower than
732
+ the glyph you can see, which is the part that reads as broken. (Measured by
733
+ hit-test sweep, all three densities, both engines: -40 -> 17.0px reachable,
734
+ -46 -> 24.0px.) The six pixels come out of the header cell's sort area,
735
+ which is hundreds of px wide, instead of out of the funnel, which is 18.
736
+
737
+ WCAG 2.5.8 exempts pointer inputs from its 24px minimum, so 24 is not the
738
+ bar here — "not clipped by a sibling" is. That is also why the menu keeps
739
+ its 18px glyph as its whole target on a desktop rather than growing an
740
+ `::after` of its own: it is unclipped at 18, and a fourth 6px would be
741
+ spent on a control that is not failing anything.
742
+
743
+ There is no fourth token: a column that has a menu but no funnel puts the
744
+ menu in the funnel's slot, so @pretable/react reads the funnel token for
745
+ that case rather than declaring a duplicate. That case is deliberately NOT
746
+ re-spaced — with no funnel beside it there is nothing to clip. */
747
+ :where([data-pretable-header-overlays]) {
748
+ --pretable-header-resize-slot: -4px;
749
+ --pretable-header-funnel-slot: -22px;
750
+ --pretable-header-menu-slot: -46px;
751
+ }
752
+
705
753
  /* Column resize handle (sub-project C) */
706
754
  :where([data-pretable-resize-handle]) {
707
755
  position: absolute;
708
756
  top: 0;
709
- right: 0;
710
- width: 4px;
757
+ /* The strip spans from its slot to the column's trailing edge, so its width
758
+ is that offset and not an independent number: a theme that moved the slot
759
+ while the width stayed at a literal 4px would detach the strip from the
760
+ edge it exists to hug. Derived here rather than in @pretable/react
761
+ because a width written inline could not be re-derived by a theme either
762
+ — the same trap the offsets themselves were in. */
763
+ width: calc(-1 * var(--pretable-header-resize-slot));
711
764
  height: 100%;
712
765
  cursor: col-resize;
713
766
  background: var(--pretable-resize-handle);
@@ -745,7 +798,13 @@
745
798
  pointer-events: none;
746
799
  }
747
800
 
748
- /* Built-in column filter menu (sub-project 2/3) */
801
+ /* Built-in column filter menu (sub-project 2/3).
802
+ This family shares the `data-pretable-filter-` prefix with the tool
803
+ panel's filter BUILDER further down, whose guards ban `opacity` outright.
804
+ The funnel's `opacity: 0/1` below reveals a control rather than dimming
805
+ one, so the family is exempt BY NAME in `LEGACY_FILTER_ATTRS`
806
+ (css-cascade.test.ts). A new funnel-family attribute belongs on that
807
+ list; a new builder attribute does not. */
749
808
  :where([data-pretable-filter-funnel]) {
750
809
  display: inline-flex;
751
810
  align-items: center;
@@ -775,9 +834,9 @@
775
834
  the header box cannot change size — @pretable/ui's `readDensity` and the
776
835
  surface's virtualisation geometry both measure header/row height in JS,
777
836
  and a change there would desynchronise painted from measured layout.
778
- `right: 0`, NOT centred: the funnel's right edge is flush against the 4px
779
- resize strip (the slots are parked at left:-22 and left:-4 off the
780
- column's trailing edge — see pretable-surface.tsx). The strip is not at
837
+ `right: 0`, NOT centred: on a fine pointer the funnel's right edge is flush
838
+ against the 4px resize strip (--pretable-header-funnel-slot puts it 22px
839
+ back from the column's trailing edge, the strip at 4). The strip is not at
781
840
  risk — it carries z-index: 2 inside the overlay anchor's stacking context,
782
841
  so it hit-tests above the funnel either way, and a centred box measurably
783
842
  steals none of it. What a centred box costs is the FUNNEL: 3 of its 24px
@@ -789,12 +848,14 @@
789
848
  Height is a flat 24px, not 100%: the tightest shipped header is Excel's
790
849
  compact tier at exactly 24px, so 24 fits every tier without spilling into
791
850
  the first data row.
792
- KNOWN GAP: with the drag-to-group panel on, @pretable/react also renders an
793
- 18px column-menu button immediately left of the funnel, and it paints above
794
- the funnel's hit area (later in tree order, same stacking context). The
795
- funnel then measures 24 tall but only ~17 wide. Three controls in the 40px
796
- the overlay anchor allots cannot each have 24; closing that one needs the
797
- slot offsets in pretable-surface.tsx to move, not another CSS rule. */
851
+ This box is 24px wide on EVERY pointer, and the slot geometry above is what
852
+ keeps it reachable rather than merely declared. With the drag-to-group
853
+ panel on there is an 18px column-menu button immediately left of the
854
+ funnel; while its slot sat at -40 it painted over the six pixels of this
855
+ box that ran underneath it and the funnel measured 24 tall but 17 wide. The
856
+ fix is spacing, not size — the menu slot moved to -46 — because shrinking
857
+ this box to 18 to stop the collision would have taken the same six pixels
858
+ off every panel-less grid, which was never clipped. */
798
859
  :where([data-pretable-filter-funnel])::after {
799
860
  content: "";
800
861
  position: absolute;
@@ -1011,6 +1072,13 @@
1011
1072
  cursor: pointer;
1012
1073
  opacity: 0;
1013
1074
  transition: opacity 0.1s ease;
1075
+ /* Containing block for the coarse-pointer hit area at the end of the file.
1076
+ Declared here rather than beside it so the two cannot drift apart, and
1077
+ unconditional because it changes nothing on its own: the button is
1078
+ already inside an absolutely positioned slot, so making it `relative`
1079
+ moves no pixel and reorders no paint — both slots were already in the
1080
+ positioned phase, ordered by tree order. */
1081
+ position: relative;
1014
1082
  }
1015
1083
  :where([data-pretable-header-row]:hover [data-pretable-column-menu-button]),
1016
1084
  :where([data-pretable-column-menu-button]:focus-visible),
@@ -1050,6 +1118,17 @@
1050
1118
  outline: 2px solid var(--pretable-focus-ring);
1051
1119
  outline-offset: -2px;
1052
1120
  }
1121
+ /* A checkbox item (the row menu's auto-width toggle) lays its check glyph
1122
+ out on the trailing edge; the label keeps the block items' left
1123
+ alignment in both states, so no leading slot is reserved. The glyph is
1124
+ a CheckIcon — [data-pretable-icon] already sizes it. Selected by role,
1125
+ not a new data attribute: aria is the checkbox contract's own marker. */
1126
+ :where([data-pretable-menu-item][role="menuitemcheckbox"]) {
1127
+ display: flex;
1128
+ align-items: center;
1129
+ justify-content: space-between;
1130
+ gap: 8px;
1131
+ }
1053
1132
 
1054
1133
  /* Enum combobox listbox (cell editor) */
1055
1134
  :where([data-pretable-enum-editor]) {
@@ -1293,4 +1372,869 @@
1293
1372
  border-top-left-radius: 0;
1294
1373
  border-top-right-radius: 0;
1295
1374
  }
1375
+
1376
+ /* ---- Tool panel (SP1) ------------------------------------------------- */
1377
+
1378
+ /* The horizontal composite the surface renders while the panel is enabled:
1379
+ [grid stack][pane?][rail] in one flex row (the flex itself is inline
1380
+ layout math in @pretable/react). The card chrome — border, radius,
1381
+ shadow — moves UP onto this wrapper so it wraps the docked rail and
1382
+ pane; the boxes inside surrender their own copies and meet at hairlines.
1383
+ This is the same border redistribution the group-panel wrapper performs
1384
+ vertically, one axis over. */
1385
+ :where([data-pretable-tool-layout]) {
1386
+ border: 1px solid var(--pretable-rule-strong);
1387
+ border-radius: var(--pretable-radius);
1388
+ box-shadow: var(--pretable-shadow-card);
1389
+ /* The children keep square corners and the wrapper's radius clips them.
1390
+ Safe to clip: every floating grid child (menus, editors, the reorder
1391
+ ghost) portals to <body>, and the viewport scrolls inside itself. */
1392
+ overflow: hidden;
1393
+ }
1394
+ :where([data-pretable-tool-layout]) :where([data-pretable-scroll-viewport]) {
1395
+ border: 0;
1396
+ border-radius: 0;
1397
+ box-shadow: none;
1398
+ }
1399
+ /* The seam the viewport's own top border used to draw beneath the group
1400
+ panel and the error strip moves onto those boxes' bottom edge. */
1401
+ :where([data-pretable-tool-layout]) :where([data-pretable-group-panel]),
1402
+ :where([data-pretable-tool-layout])
1403
+ :where([data-pretable-body-state="error-strip"]) {
1404
+ border: 0;
1405
+ border-radius: 0;
1406
+ border-bottom: 1px solid var(--pretable-rule-strong);
1407
+ }
1408
+
1409
+ /* A rail of section tabs at the grid's right edge plus a full-height pane.
1410
+ The rail borrows the header's surface and the pane the toolbar's, so the
1411
+ panel reads as chrome, not content — the same plane vocabulary as the
1412
+ rest of the grid. Docked planes meet at hairlines, not shadows: a shadow
1413
+ is elevation, and nothing here floats. */
1414
+ :where([data-pretable-tool-rail]) {
1415
+ display: flex;
1416
+ /* A flex item of the layout row. `flex: none`, or the row's shrink math
1417
+ splits negative space between the grid area and this strip — measured:
1418
+ a 640px card squeezed the pane 264 -> 224 before these were pinned. */
1419
+ flex: none;
1420
+ flex-direction: column;
1421
+ align-items: center;
1422
+ gap: 4px;
1423
+ inline-size: 36px;
1424
+ padding-block-start: 6px;
1425
+ background: var(--pretable-bg-header);
1426
+ border-inline-start: var(--pretable-rule-width) solid var(--pretable-rule);
1427
+ }
1428
+ :where([data-pretable-tool-tab]) {
1429
+ display: flex;
1430
+ align-items: center;
1431
+ justify-content: center;
1432
+ inline-size: 28px;
1433
+ block-size: 28px;
1434
+ padding: 0;
1435
+ border: 0;
1436
+ border-radius: var(--pretable-radius-control);
1437
+ background: transparent;
1438
+ color: var(--pretable-text-header);
1439
+ cursor: pointer;
1440
+ }
1441
+ /* A background-IMAGE, not the `background` shorthand most hovers in this
1442
+ file can safely use: the selected rule below paints this same tab with a
1443
+ background-COLOR, and the shorthand would reset the image-or-color the
1444
+ earlier rule left behind. The idiom belongs to the hovers that compose
1445
+ over an existing fill, which is why it is argued here and not everywhere. */
1446
+ :where([data-pretable-tool-tab]:hover) {
1447
+ background-image: linear-gradient(
1448
+ var(--pretable-bg-hover),
1449
+ var(--pretable-bg-hover)
1450
+ );
1451
+ }
1452
+ /* The open tab takes the PANE's surface, so tab and pane read as one
1453
+ continuous plane — the notebook-divider trick. Accent carries "current"
1454
+ because on the header surface a fill difference alone is one tone step.
1455
+ background-COLOR, never the shorthand: this rule follows the hover rule
1456
+ at equal (0,0,0) specificity, and the shorthand resets background-image
1457
+ to `none` — which would erase the hover tint on exactly the tab a
1458
+ pointer rests on most. Same hazard the selection-fill rules document at
1459
+ the top of the file. */
1460
+ :where([data-pretable-tool-tab][aria-selected="true"]) {
1461
+ background-color: var(--pretable-bg-toolbar);
1462
+ color: var(--pretable-accent);
1463
+ }
1464
+ :where([data-pretable-tool-tab]:focus-visible) {
1465
+ outline: 2px solid var(--pretable-focus-ring);
1466
+ outline-offset: -2px;
1467
+ }
1468
+
1469
+ /* Pane width is a plain px, not a token: nothing themes it yet, and the
1470
+ flattened (0,0,0) specificity means a consumer can override it with any
1471
+ single attribute selector. It becomes a token when a theme needs it. */
1472
+ :where([data-pretable-tool-pane]) {
1473
+ display: flex;
1474
+ /* Same pin as the rail's: the pane's width is a fixed budget the grid
1475
+ area yields, never a negotiation. */
1476
+ flex: none;
1477
+ flex-direction: column;
1478
+ /* Containing block for the resize handle below, which straddles the
1479
+ pane/grid seam with a negative inline offset. */
1480
+ position: relative;
1481
+ inline-size: 264px;
1482
+ min-block-size: 0;
1483
+ background: var(--pretable-bg-toolbar);
1484
+ border-inline-start: var(--pretable-rule-width) solid var(--pretable-rule);
1485
+ /* The pane docks BESIDE the scroll viewport, not inside it, so nothing
1486
+ is inherited from the viewport's font or color declarations. */
1487
+ font-family: var(--pretable-font-sans);
1488
+ font-size: var(--pretable-font-size-cell);
1489
+ color: var(--pretable-text-cell);
1490
+ }
1491
+ /* The pane's width-resize handle (SP5): a slim strip straddling the
1492
+ pane/grid seam — 3px each side of the border the pane already draws, so
1493
+ the grab target sits ON the visible seam rather than beside it. Zero new
1494
+ tokens (spec A1): the affordances below reuse the hover fill and the
1495
+ focus ring every control in this file already wears. `touch-action:
1496
+ none` for the drag's reason everywhere else: the browser must not
1497
+ translate a captured pointer's movement into a scroll. */
1498
+ :where([data-pretable-pane-resize]) {
1499
+ position: absolute;
1500
+ inset-block: 0;
1501
+ inset-inline-start: -3px;
1502
+ inline-size: 7px;
1503
+ cursor: col-resize;
1504
+ touch-action: none;
1505
+ user-select: none;
1506
+ }
1507
+ /* A hover/focus TINT, not a painted bar: the seam's rule stays the visible
1508
+ line, and the strip announces itself only when pointed at — the
1509
+ hover-reveal register the row controls in this section follow. */
1510
+ :where([data-pretable-pane-resize]:hover),
1511
+ :where([data-pretable-pane-resize]:active) {
1512
+ background: var(--pretable-bg-hover);
1513
+ }
1514
+ :where([data-pretable-pane-resize]:focus-visible) {
1515
+ outline: 2px solid var(--pretable-focus-ring);
1516
+ outline-offset: -2px;
1517
+ }
1518
+ :where([data-pretable-tool-section]) {
1519
+ display: flex;
1520
+ flex-direction: column;
1521
+ flex: 1;
1522
+ min-block-size: 0;
1523
+ padding: 8px;
1524
+ overflow-y: auto;
1525
+ }
1526
+
1527
+ /* The filter menu's input treatment, restated rather than shared: the menus
1528
+ portal into <body> and this input does not, and coupling their selectors
1529
+ would make the next popover edit silently restyle the panel. */
1530
+ :where([data-pretable-tool-search]) {
1531
+ box-sizing: border-box;
1532
+ inline-size: 100%;
1533
+ margin-block-end: 6px;
1534
+ padding: 5px 7px;
1535
+ border: 1px solid var(--pretable-rule);
1536
+ border-radius: var(--pretable-radius-control);
1537
+ background: var(--pretable-bg-grid);
1538
+ color: var(--pretable-text-cell);
1539
+ font: inherit;
1540
+ }
1541
+
1542
+ /* Group labels split the list by pin state. Size and tracking do the
1543
+ subordinating alongside --pretable-text-dim — same recipe as the entity
1544
+ secondary, and for the same AA reason: never opacity. */
1545
+ :where([data-pretable-tool-group-label]) {
1546
+ padding: 8px 2px 4px;
1547
+ font-size: 0.72em;
1548
+ letter-spacing: 0.07em;
1549
+ text-transform: uppercase;
1550
+ color: var(--pretable-text-dim);
1551
+ }
1552
+
1553
+ /* One row per column: grip, checkbox, label, kebab. `flex: none` because
1554
+ the section is a definite-height flex column that scrolls: the default
1555
+ `0 1 auto` lets a LONG list SHRINK its rows to fit rather than overflow,
1556
+ so 28px quietly becomes 22 and the scrollbar stays away until the rows
1557
+ bottom out at their content height. Nothing here ever stretches —
1558
+ flex-grow is 0 on both sides of that default; shrink is the entire
1559
+ difference. */
1560
+ /* [data-pretable-tool-group-row] (the grouping section's group-by rows)
1561
+ rides every selector list here: same anatomy, same states, one set of
1562
+ rules — the grouping block below adds nothing of its own.
1563
+ [data-pretable-aggregate-row] (the aggregates block's rows) rides the
1564
+ BASE rule only: same box, but nothing in it hovers, drags or takes row
1565
+ focus — its select carries its own states via the filter-field lists. */
1566
+ :where(
1567
+ [data-pretable-tool-column-row],
1568
+ [data-pretable-tool-group-row],
1569
+ [data-pretable-aggregate-row]
1570
+ ) {
1571
+ display: flex;
1572
+ align-items: center;
1573
+ gap: 7px;
1574
+ flex: none;
1575
+ block-size: 28px;
1576
+ padding-inline: 7px;
1577
+ border-radius: var(--pretable-radius-control);
1578
+ }
1579
+ :where(
1580
+ [data-pretable-tool-column-row]:hover,
1581
+ [data-pretable-tool-group-row]:hover
1582
+ ) {
1583
+ background-image: linear-gradient(
1584
+ var(--pretable-bg-hover),
1585
+ var(--pretable-bg-hover)
1586
+ );
1587
+ }
1588
+ /* Rows are keyboard-reorderable the way group chips are, so they carry the
1589
+ same ring. */
1590
+ :where(
1591
+ [data-pretable-tool-column-row]:focus-visible,
1592
+ [data-pretable-tool-group-row]:focus-visible
1593
+ ) {
1594
+ outline: 2px solid var(--pretable-focus-ring);
1595
+ outline-offset: -2px;
1596
+ }
1597
+ /* Drag feedback rides the selection tint, not the chip strip's opacity
1598
+ fade: Excel sets --pretable-bg-hover to `transparent`, so hover cannot
1599
+ carry it — and a faded row is also a dimmed label, which is the exact
1600
+ presentation a hidden column owns further down. */
1601
+ :where(
1602
+ [data-pretable-tool-column-row][data-pretable-tool-row-dragging],
1603
+ [data-pretable-tool-group-row][data-pretable-tool-row-dragging]
1604
+ ) {
1605
+ background-image: linear-gradient(
1606
+ var(--pretable-selection-bg),
1607
+ var(--pretable-selection-bg)
1608
+ );
1609
+ cursor: grabbing;
1610
+ }
1611
+ /* The grip is a GripIcon from the set — [data-pretable-icon] already sizes
1612
+ it, so only the tint and the affordance are left here. */
1613
+ :where([data-pretable-tool-row-grip]) {
1614
+ flex: none;
1615
+ display: inline-flex;
1616
+ color: var(--pretable-text-dim);
1617
+ cursor: grab;
1618
+ touch-action: none;
1619
+ /* Containing block for the coarse-pointer hit area at the end of the
1620
+ file — declared here so the two cannot drift apart, exactly as the
1621
+ header's ⋮ does. */
1622
+ position: relative;
1623
+ }
1624
+ :where([data-pretable-tool-column-label]) {
1625
+ flex: 1;
1626
+ min-inline-size: 0;
1627
+ overflow: hidden;
1628
+ text-overflow: ellipsis;
1629
+ white-space: nowrap;
1630
+ }
1631
+ /* Hidden columns dim by COLOR, never by opacity: --pretable-text-dim holds
1632
+ a contrast that was computed against the surface, and an opacity
1633
+ multiplies it away below AA — the failure every hand-rolled secondary in
1634
+ this repo has shipped at least once. */
1635
+ :where([data-pretable-tool-column-row][data-pretable-column-hidden="true"]) {
1636
+ color: var(--pretable-text-dim);
1637
+ }
1638
+ /* The kebab is the header's ⋮ minus the hover-reveal. The header hides its
1639
+ ⋮ because it overlays a sort target hundreds of px wide; here the button
1640
+ owns its own slot in the row, and hover-reveal would just make it absent
1641
+ on every coarse pointer. Its menu is the SAME popover contract the
1642
+ header's opens — [data-pretable-column-menu] holding
1643
+ [data-pretable-menu-item]s — so the menu needs no rules of its own. */
1644
+ :where([data-pretable-tool-row-menu-button]) {
1645
+ flex: none;
1646
+ display: inline-flex;
1647
+ align-items: center;
1648
+ justify-content: center;
1649
+ inline-size: 18px;
1650
+ block-size: 18px;
1651
+ padding: 0;
1652
+ border: 0;
1653
+ border-radius: var(--pretable-radius-control);
1654
+ background: transparent;
1655
+ color: var(--pretable-text-dim);
1656
+ cursor: pointer;
1657
+ /* Containing block for the coarse-pointer hit area at the end of the
1658
+ file, like the grip's. */
1659
+ position: relative;
1660
+ }
1661
+ :where([data-pretable-tool-row-menu-button]:hover),
1662
+ :where([data-pretable-tool-row-menu-button][aria-expanded="true"]) {
1663
+ background: var(--pretable-selection-bg);
1664
+ color: var(--pretable-text-cell);
1665
+ }
1666
+
1667
+ /* The gap a drop would land in: the chip strip's zero-content indicator
1668
+ turned horizontal, because this list stacks instead of flowing. */
1669
+ :where([data-pretable-tool-drop-indicator]) {
1670
+ flex: none;
1671
+ block-size: 2px;
1672
+ border-radius: 1px;
1673
+ background: var(--pretable-reorder-drop-indicator);
1674
+ }
1675
+
1676
+ /* The escape hatch under the list. Same voice as the filter menu's clear
1677
+ action — a quiet text button in the accent — because a bordered button
1678
+ at the foot of the pane would outweigh every row above it. */
1679
+ :where([data-pretable-tool-reset]) {
1680
+ align-self: flex-end;
1681
+ padding: 2px 4px;
1682
+ border: 0;
1683
+ background: transparent;
1684
+ color: var(--pretable-accent);
1685
+ cursor: pointer;
1686
+ font: inherit;
1687
+ }
1688
+
1689
+ /* ---- Filter builder (SP2b) -------------------------------------------- */
1690
+
1691
+ /* Nesting is an indented run behind a vertical rule — NOT a bordered card.
1692
+ The pane is 264px and the rows inside it hold three controls plus a
1693
+ remove button, so every pixel a level costs comes out of the value
1694
+ input. A card costs ~14px a level (border + padding on both sides); this
1695
+ costs 8 — the 1px rule plus the 7px that keeps the rows off it. Depth
1696
+ three still leaves a usable row.
1697
+ The rule IS the nesting cue. It is the whole visual difference between a
1698
+ group and its parent, which is why it takes --pretable-rule (the
1699
+ hairline seam vocabulary the docked planes above already speak) rather
1700
+ than a shadow: nothing here floats.
1701
+ No `flex: none` here, unlike the rows: a nested rail's automatic minimum
1702
+ size resolves to min-content and its children are already unshrinkable,
1703
+ so the run cannot be squeezed out of shape by the column it sits in. */
1704
+ :where([data-pretable-filter-rail]) {
1705
+ display: flex;
1706
+ flex-direction: column;
1707
+ gap: 4px;
1708
+ padding-inline-start: 7px;
1709
+ border-inline-start: var(--pretable-rule-width) solid var(--pretable-rule);
1710
+ }
1711
+
1712
+ /* One leaf: join · column · operator · value · remove, all in this one flex
1713
+ box — the connective is placed INSIDE the row it introduces rather than
1714
+ beside it, which is what lets the two line up as the pane wraps.
1715
+ It WRAPS, unlike the columns section's fixed-height row: five controls
1716
+ do not fit across 264px minus the rails, and `nowrap` would push the
1717
+ trailing control past the pane's edge, where the pane's own
1718
+ `overflow-y: auto` gives no way to reach it. `flex: none` for the reason
1719
+ the column rows carry it — a scrolling, definite-height section shrinks
1720
+ its rows to fit unless told not to.
1721
+ THE TWO HAZARDS THIS COMMENT USED TO WARN THE CONTROLS TASK ABOUT, and
1722
+ what the rules below did about them. Neither drop-in was taken. The
1723
+ nearest reusable remove control, [data-pretable-chip-remove] further up,
1724
+ is 14x14 — below WCAG 2.5.8, in a section that bought 24px for every
1725
+ control it owns — so the remove button takes this section's box instead
1726
+ and states the size in its own guarded rule. And .pretable-cell-editor is
1727
+ CELL geometry: its `width/height: 100%` would force the value onto a line
1728
+ of its own in this wrapping row, and its `[aria-busy="true"] { opacity:
1729
+ 0.7 }` would defeat this section's no-opacity rule through a selector the
1730
+ guard cannot see — so the value control is a primitive with a box of its
1731
+ own here, and @pretable/react's FilterRow carries the rest of that
1732
+ argument (the cell editors' commit-on-blur lifecycle, and an enum
1733
+ combobox that cannot express `isAnyOf`). */
1734
+ :where([data-pretable-filter-row]) {
1735
+ display: flex;
1736
+ flex-wrap: wrap;
1737
+ align-items: center;
1738
+ gap: 4px;
1739
+ flex: none;
1740
+ padding: 4px;
1741
+ border-radius: var(--pretable-radius-control);
1742
+ }
1743
+ /* A background-IMAGE, the way the tool tabs' hover does it and for the
1744
+ reason argued there. Nothing paints this row before the hover today —
1745
+ the hidden-column rule below sets `color` only — so this is house
1746
+ consistency and future-proofing rather than a fix: the day this row
1747
+ grows a fill of its own, a `background` shorthand here would erase it,
1748
+ silently and only on hover. */
1749
+ :where([data-pretable-filter-row]:hover) {
1750
+ background-image: linear-gradient(
1751
+ var(--pretable-bg-hover),
1752
+ var(--pretable-bg-hover)
1753
+ );
1754
+ }
1755
+ /* A filter on a hidden column still applies, and the row says so by COLOR,
1756
+ never by opacity: --pretable-text-dim holds a contrast computed against
1757
+ the surface and an opacity multiplies it away below AA — the failure the
1758
+ columns section's hidden row documents one section up. */
1759
+ :where(
1760
+ [data-pretable-filter-row][data-pretable-filter-column-hidden="true"]
1761
+ ) {
1762
+ color: var(--pretable-text-dim);
1763
+ }
1764
+ /* The grouped-away marking (SP3b spec decision 11): a filter on a column
1765
+ that grouping removed from the header — grouped AND hide-grouped on —
1766
+ dims the same way and for the same reason. Its own rule rather than a
1767
+ selector list in the hidden one, so the two markings can diverge without
1768
+ an edit that re-reads both; the distinction a screen reader needs is in
1769
+ the picker's name, which says "grouped" there and "hidden" here. */
1770
+ :where(
1771
+ [data-pretable-filter-row][data-pretable-filter-column-grouped="true"]
1772
+ ) {
1773
+ color: var(--pretable-text-dim);
1774
+ }
1775
+
1776
+ /* The two pickers and the single-value field, in ONE rule: they are the same
1777
+ box, and the difference between "which column", "which operator" and
1778
+ "what value" is the words inside it, not the frame around them.
1779
+ `flex: 1 1 auto` WITH an explicit `min-inline-size`, which is the pair
1780
+ that makes the wrapping row above work: a <select>'s automatic minimum
1781
+ size is its longest option, so one long header name would hold the row
1782
+ wider than the pane and push the value onto a line of its own no matter
1783
+ how the row wraps. ANY explicit value overrides that automatic minimum,
1784
+ so 24px shrinks and ellipsizes exactly as 0 would — and unlike 0 it does
1785
+ not hand back, on the inline axis, the WCAG 2.5.8 floor the block-size
1786
+ below is claiming. A rule that states a 24px target and then permits a
1787
+ 4px-wide one states nothing.
1788
+ 24px is the height this section bought for the join and the add actions,
1789
+ so the whole row clears 2.5.8 on every pointer rather than only where a
1790
+ coarse-pointer block applies.
1791
+ `font: inherit` as the SHORTHAND — the add action's choice, not the
1792
+ join's longhands: UA stylesheets set their own font on form controls, and
1793
+ this rule sets no size of its own, so there is nothing for the shorthand
1794
+ to overwrite. */
1795
+ /* [data-pretable-aggregate-row] select (the grouping section's aggregate
1796
+ picker) rides this list and the focus ring below: it is the same box as
1797
+ the builder's pickers, and the shared rule is what keeps the two panes'
1798
+ selects from drifting apart. Appended AFTER the pinned head — the
1799
+ cascade guard anchors on [data-pretable-filter-row-column] leading. */
1800
+ :where(
1801
+ [data-pretable-filter-row-column],
1802
+ [data-pretable-filter-row-operator],
1803
+ input[data-pretable-filter-row-value],
1804
+ [data-pretable-aggregate-row] select
1805
+ ) {
1806
+ box-sizing: border-box;
1807
+ flex: 1 1 auto;
1808
+ min-inline-size: 24px;
1809
+ block-size: 24px;
1810
+ padding-inline: 6px;
1811
+ border: 1px solid var(--pretable-rule);
1812
+ border-radius: var(--pretable-radius-control);
1813
+ background: var(--pretable-bg-grid);
1814
+ color: var(--pretable-text-cell);
1815
+ font: inherit;
1816
+ }
1817
+
1818
+ /* The set shape's checklist, which is not a field: it takes its own line
1819
+ (`flex-basis: 100%` in a wrapping row) because a column of checkboxes
1820
+ beside three 24px controls would set the row's height to the number of
1821
+ choices. Declared AFTER the rule above and matching a different element,
1822
+ so nothing here is overriding anything — every selector in this file is
1823
+ :where()-flattened to (0,0,0) and source order is the only lever. */
1824
+ :where(div[data-pretable-filter-row-value]) {
1825
+ display: flex;
1826
+ flex-direction: column;
1827
+ gap: 2px;
1828
+ flex-basis: 100%;
1829
+ }
1830
+ :where(div[data-pretable-filter-row-value]) label {
1831
+ display: flex;
1832
+ align-items: center;
1833
+ gap: 6px;
1834
+ }
1835
+
1836
+ /* Remove. NOT [data-pretable-chip-remove], which is 14x14 — under WCAG
1837
+ 2.5.8's 24px minimum, in a section where every other control is 24. The
1838
+ chip strip can argue its own case (a chip is a label with a glyph on the
1839
+ end); this row cannot, because it sits beside two 24px controls that
1840
+ already made the opposite choice. What IS taken from the chip is the
1841
+ quiet-until-hover idea — dim by --pretable-text-dim, full text colour on
1842
+ hover — and not its paint: the hover fill is this section's own
1843
+ background-IMAGE gradient, the same one the row and the join use, rather
1844
+ than the chip's --pretable-selection-bg.
1845
+ `flex: none` and a square inline-size: it holds a glyph, so it must not
1846
+ stretch the way the fields either side of it do. The glyph itself is a
1847
+ CloseIcon from the set, sized by --pretable-icon-size through
1848
+ [data-pretable-icon] — no font-size here, unlike the chip's Unicode. */
1849
+ /* [data-pretable-tool-group-remove] (the group-by row's ✕) shares every
1850
+ rule: same glyph, same quiet treatment, one set of declarations. */
1851
+ :where([data-pretable-filter-row-remove], [data-pretable-tool-group-remove]) {
1852
+ box-sizing: border-box;
1853
+ flex: none;
1854
+ display: inline-flex;
1855
+ align-items: center;
1856
+ justify-content: center;
1857
+ inline-size: 24px;
1858
+ block-size: 24px;
1859
+ padding: 0;
1860
+ border: 0;
1861
+ border-radius: var(--pretable-radius-control);
1862
+ background: transparent;
1863
+ color: var(--pretable-text-dim);
1864
+ cursor: pointer;
1865
+ }
1866
+ :where(
1867
+ [data-pretable-filter-row-remove]:hover,
1868
+ [data-pretable-tool-group-remove]:hover
1869
+ ) {
1870
+ background-image: linear-gradient(
1871
+ var(--pretable-bg-hover),
1872
+ var(--pretable-bg-hover)
1873
+ );
1874
+ color: var(--pretable-text-cell);
1875
+ }
1876
+ /* One ring for every control in the row, an OUTLINE like every other ring
1877
+ in this file: a box-shadow would spend the one shadow slot these controls
1878
+ might later want for elevation, and whichever declaration lost would lose
1879
+ silently.
1880
+ `input[...-value]`, not the bare attribute: the set shape wears the same
1881
+ attribute on a <div> wrapper, which takes no focus. A rule that matched it
1882
+ would be inert today and would paint a ring around the whole checklist the
1883
+ day anything made that wrapper focusable — a state nobody would have
1884
+ designed. The FIELDS are what focus, so the field is what the selector
1885
+ names. */
1886
+ :where(
1887
+ [data-pretable-filter-row-column]:focus-visible,
1888
+ [data-pretable-filter-row-operator]:focus-visible,
1889
+ input[data-pretable-filter-row-value]:focus-visible,
1890
+ [data-pretable-filter-row-remove]:focus-visible,
1891
+ [data-pretable-tool-group-remove]:focus-visible,
1892
+ [data-pretable-aggregate-row] select:focus-visible
1893
+ ) {
1894
+ outline: 2px solid var(--pretable-focus-ring);
1895
+ outline-offset: -2px;
1896
+ }
1897
+ /* The checklist's checkboxes, which the rule above deliberately does not
1898
+ reach — they are inside the wrapper, not the wrapper. Without this they
1899
+ keep the UA's own focus ring, so tabbing through a set filter would change
1900
+ ring colour and shape halfway down a row that is otherwise entirely this
1901
+ section's. A POSITIVE offset, unlike every other ring here: a checkbox is
1902
+ ~13px and paints to its own edge, so an inset ring would sit on top of the
1903
+ box instead of around it. */
1904
+ :where(div[data-pretable-filter-row-value]) input:focus-visible {
1905
+ outline: 2px solid var(--pretable-focus-ring);
1906
+ outline-offset: 1px;
1907
+ }
1908
+
1909
+ /* The connective, which is the thing users misread — so it sits between
1910
+ rows carrying the run's join rather than hiding in a group header. Two
1911
+ shapes share the attribute: a plain `Where` on the run's first row, and
1912
+ a <button> on every later one. Both take this box so the rows below the
1913
+ first line up with the one above; min-inline-size is what holds that
1914
+ column, and it doubles as half of the button's hit target.
1915
+ font-family/font-size as LONGHANDS, never the `font` shorthand a bordered
1916
+ control in this file usually reaches for: a <button> does not inherit the
1917
+ pane's font, so the family has to be restored here — and `font: inherit`
1918
+ would restore the SIZE too, overwriting the 0.9em that subordinates the
1919
+ connective to the row it sits beside. Two longhands say exactly the two
1920
+ things meant; the shorthand says a third. */
1921
+ :where([data-pretable-filter-join]) {
1922
+ display: inline-flex;
1923
+ align-items: center;
1924
+ flex: none;
1925
+ min-inline-size: 44px;
1926
+ block-size: 24px;
1927
+ color: var(--pretable-text-dim);
1928
+ font-family: inherit;
1929
+ font-size: 0.9em;
1930
+ }
1931
+ /* The interactive half. 24px tall and at least 44px wide in its own rule,
1932
+ not in the coarse-pointer block at the end of the file: this control's
1933
+ LABEL is its target, so it can simply be big enough on every pointer,
1934
+ and there is no glyph-sized box for a transparent ::after to grow. */
1935
+ :where(button[data-pretable-filter-join]) {
1936
+ /* grid.css has no universal reset — every bordered control declares its
1937
+ own box, the search input above included. Without it this button's
1938
+ 1px border lands OUTSIDE the shared 24px in a content-box host, so it
1939
+ stands 26px beside a 24px `Where` and the promise the rule above makes
1940
+ about rows lining up holds only on some pages. */
1941
+ box-sizing: border-box;
1942
+ justify-content: space-between;
1943
+ gap: 4px;
1944
+ padding-inline: 6px;
1945
+ border: 1px solid var(--pretable-rule);
1946
+ border-radius: var(--pretable-radius-control);
1947
+ background: var(--pretable-bg-grid);
1948
+ color: var(--pretable-text-cell);
1949
+ cursor: pointer;
1950
+ }
1951
+ :where(button[data-pretable-filter-join]:hover) {
1952
+ background-image: linear-gradient(
1953
+ var(--pretable-bg-hover),
1954
+ var(--pretable-bg-hover)
1955
+ );
1956
+ }
1957
+ /* Focus is an OUTLINE, like every ring in this file. A box-shadow ring
1958
+ would occupy the one shadow slot the control might later want for
1959
+ elevation, and whichever declaration lost would lose silently. */
1960
+ :where([data-pretable-filter-join]:focus-visible) {
1961
+ outline: 2px solid var(--pretable-focus-ring);
1962
+ outline-offset: -2px;
1963
+ }
1964
+
1965
+ /* `+ filter` / `+ group`: the reset action's quiet-text-button voice,
1966
+ because a bordered pair under the tree would outweigh the rows they add
1967
+ to. 24px tall so the pair clears WCAG 2.5.8 on the same terms as the
1968
+ join. */
1969
+ /* [data-pretable-add-group] (the grouping section's `+ Add group`) rides
1970
+ these four rules: same quiet-text-button voice, same disabled dimming
1971
+ (there: tree depth; here: every column already grouped) — and so do the
1972
+ expansion pair, [data-pretable-expand-all] / [data-pretable-collapse-all]
1973
+ (disabled there: no groups to act on). One list per rule, extended in
1974
+ place, so the sections cannot drift apart part by part. */
1975
+ :where(
1976
+ [data-pretable-filter-add],
1977
+ [data-pretable-add-group],
1978
+ [data-pretable-expand-all],
1979
+ [data-pretable-collapse-all]
1980
+ ) {
1981
+ display: inline-flex;
1982
+ align-items: center;
1983
+ gap: 4px;
1984
+ block-size: 24px;
1985
+ padding-inline: 6px;
1986
+ border: 0;
1987
+ border-radius: var(--pretable-radius-control);
1988
+ background: transparent;
1989
+ color: var(--pretable-accent);
1990
+ cursor: pointer;
1991
+ /* The shorthand, unlike the join's longhands: this rule sets no size of
1992
+ its own, so there is nothing for `font: inherit` to overwrite. */
1993
+ font: inherit;
1994
+ }
1995
+ :where(
1996
+ [data-pretable-filter-add]:hover:not(:disabled),
1997
+ [data-pretable-add-group]:hover:not(:disabled),
1998
+ [data-pretable-expand-all]:hover:not(:disabled),
1999
+ [data-pretable-collapse-all]:hover:not(:disabled)
2000
+ ) {
2001
+ background-image: linear-gradient(
2002
+ var(--pretable-bg-hover),
2003
+ var(--pretable-bg-hover)
2004
+ );
2005
+ }
2006
+ :where(
2007
+ [data-pretable-filter-add]:focus-visible,
2008
+ [data-pretable-add-group]:focus-visible,
2009
+ [data-pretable-expand-all]:focus-visible,
2010
+ [data-pretable-collapse-all]:focus-visible
2011
+ ) {
2012
+ outline: 2px solid var(--pretable-focus-ring);
2013
+ outline-offset: -2px;
2014
+ }
2015
+
2016
+ /* `+ group` refuses at the engine's 64-level bound — a deeper tree throws
2017
+ `invalid-query` out of setQuery, which no consumer catches. Disabled
2018
+ dims by token like the hidden row does, and drops the pointer
2019
+ affordance; the REASON is the button's business (a title/aria-disabled
2020
+ description), not the stylesheet's. */
2021
+ :where(
2022
+ [data-pretable-filter-add]:disabled,
2023
+ [data-pretable-add-group]:disabled,
2024
+ [data-pretable-expand-all]:disabled,
2025
+ [data-pretable-collapse-all]:disabled
2026
+ ) {
2027
+ color: var(--pretable-text-dim);
2028
+ cursor: default;
2029
+ }
2030
+
2031
+ /* What renders INSTEAD of the tree, so it sits with the actions that end
2032
+ it rather than opening the section. The group-label's voice: a dim line,
2033
+ not an empty box. A bordered placeholder would draw more attention than the
2034
+ rows it stands in for. */
2035
+ /* [data-pretable-tool-empty] is the same statement in the other sections'
2036
+ voice — the columns section's no-match line and the grouping section's
2037
+ "No groups" — so the three share the one rule. */
2038
+ :where([data-pretable-filter-empty], [data-pretable-tool-empty]) {
2039
+ padding: 8px 2px;
2040
+ color: var(--pretable-text-dim);
2041
+ }
2042
+
2043
+ /* ---- Grouping section (SP3b) ------------------------------------------ */
2044
+
2045
+ /* The section's four blocks — group-by, expansion, hide-grouped,
2046
+ aggregates — stacked with the filter rail's 4px rhythm inside the
2047
+ section's own 8px frame ([data-pretable-tool-section] carries the
2048
+ padding and the scroll; this container only spaces its blocks). The
2049
+ blocks' own rules land with the blocks — the group-by block's rows,
2050
+ grip, drop indicator, remove button, add button and empty line all ride
2051
+ the columns/filters sections' selector lists above (each extended in
2052
+ place), so the three sections cannot drift apart part by part. What is
2053
+ left to say here is only stacking: the blocks stack with the 4px
2054
+ rhythm, a block's own children stack TIGHT (the columns section's
2055
+ no-gap row run), and the add button shrink-wraps like `+ filter` does
2056
+ in its block-flow home instead of stretching to the column's width. */
2057
+ :where([data-pretable-tool-grouping]) {
2058
+ display: flex;
2059
+ flex-direction: column;
2060
+ gap: 4px;
2061
+ }
2062
+ :where([data-pretable-tool-grouping] > div) {
2063
+ display: flex;
2064
+ flex-direction: column;
2065
+ }
2066
+ :where([data-pretable-tool-grouping] [data-pretable-add-group]) {
2067
+ align-self: flex-start;
2068
+ }
2069
+ /* The expansion block: its two buttons sit side by side — a pair, acting
2070
+ on the same thing — against the container rule above that stacks every
2071
+ block's children. :has() keys the exception on the block's content
2072
+ rather than minting a wrapper attribute for a purely stylistic
2073
+ distinction (the wrap rows already use :has() this way). */
2074
+ :where([data-pretable-tool-grouping] > div:has([data-pretable-expand-all])) {
2075
+ flex-direction: row;
2076
+ gap: 4px;
2077
+ }
2078
+ /* The hide-grouped switch: a native checkbox and its clickable label on
2079
+ one line, sized to the add button's 24px row so the stack keeps the
2080
+ rail's rhythm. */
2081
+ :where([data-pretable-tool-grouping] label) {
2082
+ display: inline-flex;
2083
+ align-items: center;
2084
+ align-self: flex-start;
2085
+ gap: 6px;
2086
+ block-size: 24px;
2087
+ cursor: pointer;
2088
+ }
2089
+ /* The checklist checkboxes' ring (its comment argues the POSITIVE offset:
2090
+ a ~13px box painting to its own edge would be covered by an inset
2091
+ ring), restated here because that rule is scoped to the filter rows. */
2092
+ :where(input[data-pretable-hide-grouped]:focus-visible) {
2093
+ outline: 2px solid var(--pretable-focus-ring);
2094
+ outline-offset: 1px;
2095
+ }
2096
+
2097
+ /* ---- Coarse pointers -------------------------------------------------- */
2098
+
2099
+ /* A finger, not a mouse. The header's overlay controls were built on three
2100
+ mouse assumptions that all fail together here: they are 18px, they are
2101
+ revealed by hover, and they are packed overlapping into the 40px the slots
2102
+ above allot. Vertical space is not the constraint: the tightest header
2103
+ any shipped theme draws is Excel's compact tier at exactly 24px, which is
2104
+ why 24 is also the height of every hit area below — it is the largest
2105
+ target that fits every tier without spilling into the first data row.
2106
+ HORIZONTAL is the constraint.
2107
+ DECLARED LAST ON PURPOSE. Every selector in this file is :where()-flattened
2108
+ to (0,0,0), so source order is the only cascade lever there is: put this
2109
+ block above the rules it overrides and a phone silently keeps the desktop
2110
+ treatment, with nothing else in the suite any the wiser. */
2111
+ @media (pointer: coarse) {
2112
+ /* No resize strip. 4px is not a target a finger can acquire at any size,
2113
+ and dragging a column edge inside a ~324px viewport is a poor interaction
2114
+ even with a large one — so this clears a WCAG 2.5.8 failure by REMOVING
2115
+ the control rather than by inflating it, and hands back the trailing edge
2116
+ that was squeezing the funnel. Resizing stays a pointer affordance; if
2117
+ touch resizing is ever wanted it belongs in a menu, not in an invisible
2118
+ strip.
2119
+ `display: none` rather than a `matchMedia` guard in @pretable/react, for
2120
+ two reasons. It generates no boxes at all, so the strip is neither
2121
+ painted nor hit-testable — the property that matters to a finger, which
2122
+ `pointer-events: none` or `visibility: hidden` would only half give. And
2123
+ a media query is evaluated by the engine on both sides of a stream, so
2124
+ there is no client/server disagreement for hydration to reconcile; a JS
2125
+ media query has no correct SSR default here, only a less bad one. */
2126
+ :where([data-pretable-resize-handle]) {
2127
+ display: none;
2128
+ }
2129
+
2130
+ /* The 48px the strip freed, spent as two 24px targets that ABUT rather than
2131
+ overlap: the menu's hit area runs [-54, -30] off the trailing edge and
2132
+ the funnel's [-30, -6], so neither can steal from the other. 48px is 34%
2133
+ of a 140px column — against the 72px that three compliant targets would
2134
+ have needed, which is 51% and would have covered the label they sit
2135
+ beside. */
2136
+ :where([data-pretable-header-overlays]) {
2137
+ --pretable-header-funnel-slot: -24px;
2138
+ --pretable-header-menu-slot: -48px;
2139
+ }
2140
+
2141
+ /* There is no hover on a phone, so a hover-revealed control is not subtle,
2142
+ it is absent: measured on an iPhone 13, the funnel computes `opacity: 0`
2143
+ on every filterable column of every grid, which makes the 24px target it
2144
+ already carries a target nobody can see.
2145
+ This changes how every grid LOOKS on a phone. That is the intended
2146
+ change, not a side effect. The fine-pointer hover-reveal further up is
2147
+ deliberately untouched. */
2148
+ :where([data-pretable-filter-funnel]) {
2149
+ opacity: 1;
2150
+ }
2151
+
2152
+ /* WCAG 2.5.8 for the ⋮, bought exactly the way the funnel buys its own 250
2153
+ lines up: the GLYPH stays 18x18 and the missing 6px comes from a
2154
+ transparent, out-of-flow ::after. Not padding — padding grows the
2155
+ button's border box, and the button is what the hover fill and the focus
2156
+ ring paint on, so an 18px ⋮ would suddenly wear a 24px chip. Out of flow
2157
+ is also what keeps the promise the whole header rests on: `readDensity`
2158
+ and @pretable/react's virtualisation both measure header and row height
2159
+ in JavaScript, and a rule that grew the painted header would
2160
+ desynchronise painted layout from measured layout.
2161
+ `right: 0` mirrors the funnel, and here that is load-bearing rather than
2162
+ symmetric: anchored to the button's trailing edge the box grows leftward
2163
+ into the header cell — a sort target hundreds of px wide — instead of
2164
+ back over the funnel. Centred, the two 24px boxes would overlap by 6px,
2165
+ and the menu (later in tree order, same stacking context) would take
2166
+ those pixels off the funnel. That is precisely the ~17px-wide funnel this
2167
+ block exists to fix; a centred box would have re-created it one slot
2168
+ over.
2169
+ Scoped to coarse pointers, unlike the funnel's, and that is a decision
2170
+ rather than an omission. WCAG 2.5.8 exempts pointer inputs, so a desktop
2171
+ menu is not failing anything at 18px: its glyph is its whole target and
2172
+ nothing clips it once the slots above are spaced for the funnel's 24. A
2173
+ fine-pointer `::after` here would buy no reachable pixel the mouse did
2174
+ not already have, and would spend 6px more of the header cell's sort
2175
+ area to do it. */
2176
+ :where([data-pretable-column-menu-button])::after {
2177
+ content: "";
2178
+ position: absolute;
2179
+ top: 50%;
2180
+ right: 0;
2181
+ width: 24px;
2182
+ height: 24px;
2183
+ transform: translateY(-50%);
2184
+ }
2185
+
2186
+ /* Visible, for the same reason the funnel above is: the rest state is
2187
+ `opacity: 0` revealed on `:hover`, and a coarse pointer never hovers. The
2188
+ hit area directly above would otherwise be a 24px target with nothing
2189
+ drawn in it — a mystery region that opens a menu.
2190
+
2191
+ The design spec's A2 names only the funnel, because the measurement that
2192
+ prompted it was taken on a grid without the group panel, where no menu
2193
+ renders. It is the same defect one control over. */
2194
+ :where([data-pretable-column-menu-button]) {
2195
+ opacity: 1;
2196
+ }
2197
+
2198
+ /* WCAG 2.5.8 for the tool panel's row controls, bought the way the ⋮
2199
+ above buys it: the glyphs stay put and the missing pixels come from a
2200
+ transparent, out-of-flow ::after, so the 28px row cannot change size.
2201
+ CENTRED, unlike the header's right-anchored boxes, because here there
2202
+ is no neighbouring target to steal from — the label beside the kebab
2203
+ and the row padding beside the grip are not tap targets, and the
2204
+ grip's box runs out inside the 7px gap before it can reach the
2205
+ checkbox. */
2206
+ :where([data-pretable-tool-row-grip])::after,
2207
+ :where([data-pretable-tool-row-menu-button])::after {
2208
+ content: "";
2209
+ position: absolute;
2210
+ top: 50%;
2211
+ left: 50%;
2212
+ width: 24px;
2213
+ height: 24px;
2214
+ transform: translate(-50%, -50%);
2215
+ }
2216
+
2217
+ /* WCAG 2.5.8 for the pane's resize seam, bought with the same
2218
+ transparent out-of-flow ::after as the row controls above — the drawn
2219
+ strip stays 7px so the seam reads as a seam, and the missing 17px
2220
+ come from a box centred on it. CENTRED, unlike the header's
2221
+ right-anchored menu box, and that is a judged trade rather than an
2222
+ oversight: the ~8px that land pane-side overlap only the section's
2223
+ padding gutter (the row grips start 8px in and carry 24px targets of
2224
+ their own), and the grid-side pixels cover no target at all on a
2225
+ coarse pointer, where the scrollbar is an overlay. The header REMOVED
2226
+ its 4px column-resize strip on coarse pointers; this one is kept and
2227
+ inflated instead because a full-height seam can actually be acquired
2228
+ by a finger — the header strip's problem was 4px inside a column, not
2229
+ resizing itself. */
2230
+ :where([data-pretable-pane-resize])::after {
2231
+ content: "";
2232
+ position: absolute;
2233
+ top: 0;
2234
+ bottom: 0;
2235
+ left: 50%;
2236
+ width: 24px;
2237
+ transform: translateX(-50%);
2238
+ }
2239
+ }
1296
2240
  }