@slotted/styles 0.1.0-beta.36 → 0.1.0-beta.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slotted/styles",
3
- "version": "0.1.0-beta.36",
3
+ "version": "0.1.0-beta.37",
4
4
  "description": "Per-family stylesheets of Slotted, bundled by the React and Angular bindings.",
5
5
  "keywords": [
6
6
  "slotted",
@@ -164,17 +164,6 @@
164
164
  --_frame: var(--slotted-app-shell-frame, var(--slotted-surface-sunken, Canvas));
165
165
  --_canvas: var(--slotted-app-shell-canvas, var(--slotted-surface, Canvas));
166
166
  --_ink: var(--slotted-app-shell-color, var(--slotted-text, CanvasText));
167
- /**
168
- * The bar of a scrolling body: the thumb at the strong border step, which
169
- * is the step `scroll-area` gives it and the one the foundation holds to
170
- * 3:1 against every surface; the track the column's own ground, because a
171
- * groove down the side of a navigation column is a second column.
172
- */
173
- --_scrollbar-thumb: var(
174
- --slotted-app-shell-scrollbar-thumb-color,
175
- var(--slotted-border-strong, ButtonBorder)
176
- );
177
- --_scrollbar-track: var(--slotted-app-shell-scrollbar-track-color, transparent);
178
167
 
179
168
  /**
180
169
  * ── The palette, region by region ──────────────────────────────────────
@@ -563,7 +552,6 @@
563
552
  overflow-block: auto;
564
553
  overscroll-behavior: contain;
565
554
  padding-block: var(--slotted-space-4, 0.5rem);
566
- scrollbar-color: var(--_scrollbar-thumb) var(--_scrollbar-track);
567
555
  scrollbar-gutter: stable;
568
556
  scrollbar-width: thin;
569
557
  }
@@ -715,10 +703,25 @@
715
703
  overscroll-behavior: contain;
716
704
  padding-block: var(--slotted-space-5, 0.75rem);
717
705
  padding-inline: calc(var(--_row-inset) + var(--_row-gap));
718
- scrollbar-color: var(--_scrollbar-thumb) var(--_scrollbar-track);
719
706
  scrollbar-gutter: stable;
720
707
  scrollbar-width: thin;
721
708
  }
709
+ /**
710
+ * The bar of the two scrolling bodies: the thumb at the strong border step,
711
+ * which is the step `scroll-area` gives it and the one the foundation holds
712
+ * to 3:1 against every surface; the track the column's own ground, because a
713
+ * groove down the side of a navigation column is a second column. Read on
714
+ * the body, so a region's own token and its own scheme reach its bar.
715
+ */
716
+ [data-ui-app-shell]
717
+ > :is([data-part-nav], [data-part-aside])
718
+ > :is([data-part-nav-body], [data-part-aside-body]) {
719
+ scrollbar-color: var(
720
+ --slotted-app-shell-scrollbar-thumb-color,
721
+ var(--slotted-border-strong, ButtonBorder)
722
+ )
723
+ var(--slotted-app-shell-scrollbar-track-color, transparent);
724
+ }
722
725
  /* Content that brings its own inset — a page, a detail panel, a list to the edges. */
723
726
  [data-ui-app-shell] > [data-part-aside] > [data-part-aside-body][data-inset='none'] {
724
727
  padding: 0;
@@ -967,20 +967,44 @@
967
967
 
968
968
  /**
969
969
  * An icon-only control inside a line of text — a help trigger beside a term
970
- * — is that line tall, so the line does not grow. The box takes the text's
971
- * line height and stands on the line box's top, and a pseudo-element outside
972
- * layout keeps the target at the WCAG 2.2 minimum around it.
970
+ * — is a mark on the capital beside it. The icon is the capital height
971
+ * rounded to a pixel and two pixels more at each end, and it hangs those two
972
+ * below the baseline: text and icon snap to the pixel grid each on its own,
973
+ * and an icon a whole even number of pixels taller than the capital snaps
974
+ * with it wherever the line stands.
975
+ *
976
+ * The icon's box is the capital alone and the two pixels hang outside it, so
977
+ * the control's baseline is the text's in a line and in a flex row that aligns
978
+ * baselines. The ground is one line tall; margins take back what of it passes
979
+ * the capital, so the line keeps its height. A pseudo-element outside layout
980
+ * keeps the target at the WCAG 2.2 minimum.
973
981
  */
974
982
  [data-ui-button][data-shape][data-inline] {
983
+ --_capital: round(1cap, 1px);
975
984
  block-size: 1lh;
976
- font-size: inherit;
985
+ font: inherit;
977
986
  inline-size: 1lh;
978
- line-height: inherit;
987
+ margin-block: calc((var(--_capital) - 1lh) / 2);
979
988
  margin-inline-start: 0.25em;
980
989
  min-block-size: 0;
981
990
  min-inline-size: 0;
982
991
  position: relative;
983
- vertical-align: top;
992
+ vertical-align: baseline;
993
+ }
994
+
995
+ [data-ui-button][data-shape][data-inline] [data-part-icon] {
996
+ --_icon-size: calc(var(--_capital) + 4px);
997
+ block-size: var(--_capital);
998
+ font-size: inherit;
999
+ inline-size: var(--_capital);
1000
+ }
1001
+
1002
+ [data-ui-button][data-shape][data-inline] [data-part-icon] > *:not([data-part-indicator]) {
1003
+ block-size: calc(100% + 4px);
1004
+ inline-size: calc(100% + 4px);
1005
+ inset-block-start: -2px;
1006
+ inset-inline-start: -2px;
1007
+ position: absolute;
984
1008
  }
985
1009
 
986
1010
  [data-ui-button][data-shape][data-inline]::before {
@@ -903,6 +903,23 @@
903
903
  padding-block: var(--slotted-space-2, 0.25rem);
904
904
  }
905
905
 
906
+ /* Between the days and not around them: the lines divide a plane, they frame nothing. */
907
+ [data-ui-calendar][data-layout='fill'][data-lines]
908
+ [data-part-week]
909
+ > [data-part-cell]
910
+ + [data-part-cell] {
911
+ border-inline-start: var(--slotted-border-width-thin, 1px) solid
912
+ var(--slotted-calendar-line-color, var(--slotted-border-subtle, ButtonBorder));
913
+ }
914
+
915
+ [data-ui-calendar][data-layout='fill'][data-lines]
916
+ [data-part-week]
917
+ + [data-part-week]
918
+ > [data-part-cell] {
919
+ border-block-start: var(--slotted-border-width-thin, 1px) solid
920
+ var(--slotted-calendar-line-color, var(--slotted-border-subtle, ButtonBorder));
921
+ }
922
+
906
923
  [data-ui-calendar] [data-part-day-content] {
907
924
  align-items: center;
908
925
  display: flex;
@@ -12,6 +12,7 @@
12
12
  "--slotted-calendar-in-range-color",
13
13
  "--slotted-calendar-invalid-edge-width",
14
14
  "--slotted-calendar-invalid-focus-ring-color",
15
+ "--slotted-calendar-line-color",
15
16
  "--slotted-calendar-outside-color",
16
17
  "--slotted-calendar-preview-background",
17
18
  "--slotted-calendar-preview-border-color",
@@ -889,8 +889,9 @@
889
889
  visibility var(--slotted-duration-instant) linear var(--slotted-duration-short);
890
890
  }
891
891
 
892
- /* Content a consumer adds beside the parts takes the tooltip's full width. */
893
- [data-ui-chart] [data-part-tooltip] > :not([data-part]) {
892
+ /* Content a consumer adds beside the tooltip's parts, or in their place, takes
893
+ the full width; a family's root carries a `data-part` of its own. */
894
+ [data-ui-chart] [data-part-tooltip] > :not([data-part^='tooltip-']) {
894
895
  grid-column: 1 / -1;
895
896
  overflow-wrap: anywhere;
896
897
  }
@@ -532,7 +532,20 @@
532
532
  * duration. The content is drawn, clipped at the peek and faded at its end;
533
533
  * the binding keeps it inert, so nothing in the clipped part takes focus.
534
534
  * Forced colors drop the fade and keep the clip.
535
+ *
536
+ * A control drawn over the end (`more`) is keyed on an attribute of its own:
537
+ * a Button given through `render` names its own part. The content is gone
538
+ * under the part of it that stands over the panel, and the fade ends where
539
+ * that part starts, so no line is legible beneath it at any height.
535
540
  */
541
+ [data-ui-collapsible][data-peek] {
542
+ --_overlap: 0px;
543
+ }
544
+
545
+ [data-ui-collapsible][data-peek]:has(> [data-collapsible-more]) {
546
+ --_overlap: var(--slotted-collapsible-more-overlap, 1.5rem);
547
+ }
548
+
536
549
  [data-ui-collapsible][data-peek] > [data-part-panel] {
537
550
  grid-template-rows: minmax(var(--_peek), 0fr);
538
551
  }
@@ -545,8 +558,8 @@
545
558
  content-visibility: visible;
546
559
  mask-image: linear-gradient(
547
560
  to bottom,
548
- #000 calc(100% - var(--slotted-collapsible-peek-fade, 3rem)),
549
- transparent
561
+ #000 calc(100% - var(--_overlap) - var(--slotted-collapsible-peek-fade, 3rem)),
562
+ transparent calc(100% - var(--_overlap))
550
563
  );
551
564
  opacity: 1;
552
565
  padding-block-start: var(
@@ -555,12 +568,13 @@
555
568
  );
556
569
  }
557
570
 
558
- /* Over the fade, at the end of what is in view. */
559
- [data-ui-collapsible] > [data-part-more] {
571
+ /* Past the fade, at the end of what is in view. */
572
+ [data-ui-collapsible] > [data-collapsible-more] {
573
+ align-self: start;
560
574
  grid-column: 1 / -1;
561
575
  grid-row: 3;
562
576
  justify-self: center;
563
- margin-block: calc(-1 * var(--slotted-collapsible-peek-fade, 3rem) / 2) var(--_padding-block);
577
+ margin-block: calc(-1 * var(--_overlap)) var(--_padding-block);
564
578
  position: relative;
565
579
  z-index: 1;
566
580
  }
@@ -569,6 +583,10 @@
569
583
  [data-ui-collapsible][data-peek]:not([data-open]) > [data-part-panel] > [data-part-content] {
570
584
  mask-image: none;
571
585
  }
586
+
587
+ [data-ui-collapsible] > [data-collapsible-more] {
588
+ margin-block-start: var(--_padding-block);
589
+ }
572
590
  }
573
591
 
574
592
  /**
@@ -709,7 +727,7 @@
709
727
  grid-row: 3;
710
728
  }
711
729
 
712
- [data-ui-collapsible] > [data-part-more] {
730
+ [data-ui-collapsible] > [data-collapsible-more] {
713
731
  grid-row: 4;
714
732
  }
715
733
  }
@@ -9,6 +9,7 @@
9
9
  "--slotted-collapsible-hover-background",
10
10
  "--slotted-collapsible-hover-color",
11
11
  "--slotted-collapsible-indicator-color",
12
+ "--slotted-collapsible-more-overlap",
12
13
  "--slotted-collapsible-padding-inline",
13
14
  "--slotted-collapsible-panel-color",
14
15
  "--slotted-collapsible-panel-padding-block-start",
@@ -221,12 +221,19 @@
221
221
  overflow-wrap: anywhere;
222
222
  }
223
223
 
224
- /* The title and its help control on one row. The row takes the title's type,
225
- so the inline icon button is one line of the title tall and centers on the
226
- first of them without adding to the row's height. */
224
+ /* The title and its help control on one row, on the baseline of the title's
225
+ first line. The row takes the title's type, so the inline icon button is
226
+ drawn from the title's capital and adds nothing to the row's height. */
227
227
  [data-ui-dashboard-grid] [data-part-widget] [data-part-title-row] {
228
- align-items: flex-start;
228
+ align-items: baseline;
229
229
  display: flex;
230
+ font-family: var(
231
+ --slotted-dashboard-grid-title-font-family,
232
+ var(
233
+ --slotted-font-family-heading,
234
+ var(--slotted-font-family-sans, ui-sans-serif, system-ui, sans-serif)
235
+ )
236
+ );
230
237
  font-size: var(
231
238
  --slotted-dashboard-grid-title-font-size,
232
239
  var(--slotted-font-size-md, 0.8125rem)
@@ -1,16 +1,18 @@
1
1
  @layer slotted.components {
2
2
  /**
3
3
  * A tool that floats over the page and holds nobody: no scrim, no focus
4
- * trap, no inert page. It stands at the place the binding writes (`--_x`,
5
- * `--_y`, the top-left corner in viewport pixels) and the translation is
6
- * clamped by the viewport and its own size, so the whole panel stays in view
7
- * while it moves, when the window shrinks and when a stored place lies
8
- * outside it, with no script on resize.
4
+ * trap, no inert page. It opens in a corner (`data-corner`), and once it has
5
+ * a place it stands there (`--_x`, `--_y`, the top-left corner in viewport
6
+ * pixels, written by the binding); the translation is clamped by the viewport
7
+ * and its own size, so the whole panel stays in view while it moves, when the
8
+ * window shrinks and when a stored place lies outside it, with no script on
9
+ * resize.
9
10
  *
10
11
  * [data-ui-floating-panel] ▸ handle ▸ grip · title · close
11
12
  * ▸ body
12
13
  */
13
14
  [data-ui-floating-panel][data-part-root] {
15
+ --_inset: var(--slotted-floating-panel-inset, var(--slotted-space-6, 16px));
14
16
  background-color: var(--slotted-floating-panel-surface, var(--slotted-surface-raised, Canvas));
15
17
  border: var(--slotted-border-width-thin, 1px) solid
16
18
  var(--slotted-floating-panel-border-color, var(--slotted-border-strong, CanvasText));
@@ -28,8 +30,9 @@
28
30
  at the viewport's left edge in either direction before it moves. */
29
31
  inset-block-start: 0;
30
32
  inset-inline-start: 0;
31
- max-block-size: 100dvh;
32
- max-inline-size: 100vw;
33
+ /* One limit in a corner and at a place: a move never resizes the panel. */
34
+ max-block-size: calc(100dvh - 2 * var(--_inset));
35
+ max-inline-size: calc(100vw - 2 * var(--_inset));
33
36
  position: fixed;
34
37
  translate: clamp(0px, var(--_x, 0px), calc(100vw - 100%))
35
38
  clamp(0px, var(--_y, 0px), calc(100dvh - 100%));
@@ -42,6 +45,27 @@
42
45
  inset-inline-start: auto;
43
46
  }
44
47
 
48
+ [data-ui-floating-panel][data-part-root][data-corner] {
49
+ inset: auto;
50
+ translate: none;
51
+ }
52
+
53
+ [data-ui-floating-panel][data-part-root][data-corner^='top'] {
54
+ inset-block-start: var(--_inset);
55
+ }
56
+
57
+ [data-ui-floating-panel][data-part-root][data-corner^='bottom'] {
58
+ inset-block-end: var(--_inset);
59
+ }
60
+
61
+ [data-ui-floating-panel][data-part-root][data-corner$='start'] {
62
+ inset-inline-start: var(--_inset);
63
+ }
64
+
65
+ [data-ui-floating-panel][data-part-root][data-corner$='end'] {
66
+ inset-inline-end: var(--_inset);
67
+ }
68
+
45
69
  [data-ui-floating-panel] > [data-part-handle] {
46
70
  align-items: center;
47
71
  border-block-end: var(--slotted-border-width-thin, 1px) solid
@@ -5,6 +5,7 @@
5
5
  "--slotted-control-inner-size-md",
6
6
  "--slotted-floating-panel-backdrop-filter",
7
7
  "--slotted-floating-panel-border-color",
8
+ "--slotted-floating-panel-inset",
8
9
  "--slotted-floating-panel-radius",
9
10
  "--slotted-floating-panel-rule-color",
10
11
  "--slotted-floating-panel-shadow",
@@ -22,6 +23,7 @@
22
23
  "--slotted-space-2",
23
24
  "--slotted-space-3",
24
25
  "--slotted-space-5",
26
+ "--slotted-space-6",
25
27
  "--slotted-surface-raised",
26
28
  "--slotted-text",
27
29
  "--slotted-text-muted",
@@ -1277,6 +1277,15 @@
1277
1277
  line-height: round(up, calc(1em * var(--slotted-line-height-md, 1.5)), 1px);
1278
1278
  }
1279
1279
 
1280
+ /* On a rail, with no bubbles, a frame is a block floating in the turn. */
1281
+ :scope[data-variant='plain'] {
1282
+ padding: 0;
1283
+ border: 0;
1284
+ border-radius: 0;
1285
+ background-color: transparent;
1286
+ box-shadow: none;
1287
+ }
1288
+
1280
1289
  [data-part-activity-step] {
1281
1290
  display: flex;
1282
1291
  align-items: center;
package/src/page/page.css CHANGED
@@ -131,6 +131,16 @@
131
131
  * body that is not a list of blocks (a workspace, a split) to its own
132
132
  * layout.
133
133
  */
134
+ /**
135
+ * The two gaps as resolved here, the compact step taken: a stack of blocks
136
+ * deeper in the page (a tab panel, a column beside an aside) reads them. On
137
+ * the body, because a container query reaches the page's descendants only.
138
+ */
139
+ [data-ui-page] > [data-part-scroll] > [data-part-body] {
140
+ --slotted-page-gap: var(--_block-gap);
141
+ --slotted-page-section-space: var(--_section-gap);
142
+ }
143
+
134
144
  [data-ui-page]
135
145
  > [data-part-scroll]
136
146
  > [data-part-body]:not([data-flow='none'])
@@ -87,6 +87,12 @@ export const RUNTIME_PROPERTY_PREFIXES = [
87
87
  * file every one of them as unreachable by a theme.
88
88
  */
89
89
  '--slotted-tree-depth',
90
+ /**
91
+ * `table` — the rails of ancestors that cross one row of a hierarchy, as
92
+ * layers of a background: `@slotted/core/tree-branches` writes it from the
93
+ * order and the levels of the rows in the document.
94
+ */
95
+ '--slotted-tree-rails',
90
96
  /**
91
97
  * `tree` — where one row sits on a windowed canvas, in pixels. It is written
92
98
  * only on a row the window does not cover and the family renders anyway: the
@@ -366,4 +366,35 @@
366
366
  border-end-start-radius: var(--_inner-radius);
367
367
  margin-block-end: calc(-1 * var(--slotted-section-inset, var(--slotted-space-6, 1rem)));
368
368
  }
369
+
370
+ /**
371
+ * A child of the body that bleeds alone, for a body that holds more than its
372
+ * table: the same margins on the child, in the body or in the one stack the
373
+ * body holds, and the same corners when it is the last of the panel.
374
+ */
375
+ [data-ui-section][data-ground='surface'] > [data-part-body] > [data-part-bleed],
376
+ [data-ui-section][data-ground='surface'] > [data-part-body] > * > [data-part-bleed] {
377
+ --_inner-radius: calc(
378
+ var(--slotted-section-radius, var(--slotted-radius-lg, 8px)) -
379
+ var(--slotted-border-width-thin, 1px)
380
+ );
381
+
382
+ justify-self: stretch;
383
+ margin-inline: calc(-1 * var(--slotted-section-inset, var(--slotted-space-6, 1rem)));
384
+ max-inline-size: none;
385
+ min-inline-size: 0;
386
+ overflow: clip;
387
+ }
388
+
389
+ [data-ui-section][data-ground='surface']
390
+ > [data-part-body]:last-child
391
+ > [data-part-bleed]:last-child,
392
+ [data-ui-section][data-ground='surface']
393
+ > [data-part-body]:last-child
394
+ > :last-child
395
+ > [data-part-bleed]:last-child {
396
+ border-end-end-radius: var(--_inner-radius);
397
+ border-end-start-radius: var(--_inner-radius);
398
+ margin-block-end: calc(-1 * var(--slotted-section-inset, var(--slotted-space-6, 1rem)));
399
+ }
369
400
  }
@@ -1283,6 +1283,219 @@
1283
1283
  background-image: none;
1284
1284
  }
1285
1285
 
1286
+ /* A record's leading mark, an avatar or an icon: one box per level. The steps
1287
+ of an avatar that fit a row all measure the box. */
1288
+ [data-ui-table] [data-part-mark] {
1289
+ --_mark: round(var(--slotted-table-mark-size, 1.5rem), 1px);
1290
+ --slotted-avatar-size-xs: var(--_mark);
1291
+ --slotted-avatar-size-sm: var(--_mark);
1292
+ --slotted-avatar-size-md: var(--_mark);
1293
+ align-items: center;
1294
+ block-size: var(--_mark);
1295
+ display: inline-flex;
1296
+ inline-size: var(--_mark);
1297
+ justify-content: center;
1298
+ margin-block: calc((var(--_line) - var(--_mark)) / 2);
1299
+ margin-inline-end: var(--_gap);
1300
+ vertical-align: top;
1301
+ }
1302
+
1303
+ [data-ui-table] [data-part-row]:not([data-level='0'])[data-level] [data-part-mark] {
1304
+ --_mark: round(var(--slotted-table-mark-child-size, 1.25rem), 1px);
1305
+ }
1306
+
1307
+ /**
1308
+ * ── The branch of each child ───────────────────────────────────────────
1309
+ *
1310
+ * `guides="branch"`: a rail leaves the foot of the parent's mark and runs
1311
+ * down its center, each child has a branch from the rail to its own mark, and
1312
+ * the rail turns into the branch of the last child. The mark is the row's
1313
+ * `mark` part, or its expander where the cell holds none. Whether a row is
1314
+ * the last, starts a rail or is crossed by the rail of an ancestor is written
1315
+ * by the binding (`data-branch`, `data-branch-open`, `--slotted-tree-rails`).
1316
+ *
1317
+ * Every mark of a level stands in one column: what leads it, an expander or
1318
+ * the room of one, is taken out of the indent rather than added to it.
1319
+ * Positions are taken from the cell's padding box, so a rail is one line
1320
+ * through rows of any height.
1321
+ */
1322
+ [data-ui-table][data-guides='branch'] {
1323
+ --_lead: 0px;
1324
+ --_branch: var(--slotted-table-branch-size, 1.25rem);
1325
+ --_node: var(--slotted-target-min, 24px);
1326
+ --_node-child: var(--_node);
1327
+ }
1328
+
1329
+ [data-ui-table][data-guides='branch']:has([data-part-row][data-level] [data-part-mark]) {
1330
+ --_node: round(var(--slotted-table-mark-size, 1.5rem), 1px);
1331
+ --_node-child: round(var(--slotted-table-mark-child-size, 1.25rem), 1px);
1332
+ }
1333
+
1334
+ /* An expander written before the mark keeps its room in every row. */
1335
+ [data-ui-table][data-guides='branch']:has(
1336
+ [data-part-row][data-level] > * > [data-part-expander] + [data-part-mark]
1337
+ ) {
1338
+ --_lead: calc(var(--slotted-target-min, 24px) + var(--_gap));
1339
+ }
1340
+
1341
+ /* A child that folds too has its expander between its branch and its mark. */
1342
+ [data-ui-table][data-guides='branch']:has(
1343
+ [data-part-row][data-level]:not([data-level='0'])
1344
+ > *
1345
+ > [data-part-expander]
1346
+ + [data-part-mark]
1347
+ ) {
1348
+ --_branch: calc(var(--slotted-target-min, 24px) + var(--_gap) + var(--slotted-space-2, 4px));
1349
+ }
1350
+
1351
+ [data-ui-table][data-guides='branch'] [data-part-row][data-level] {
1352
+ --_guide: var(
1353
+ --slotted-table-guide-color,
1354
+ color-mix(in oklab, var(--slotted-text, CanvasText) 26%, var(--_surface))
1355
+ );
1356
+ /* The inline start of the first rail, and from one rail to the next. */
1357
+ --_rail: round(
1358
+ down,
1359
+ calc(var(--_pad-inline) + var(--_lead) + (var(--_node) - var(--_rule-width)) / 2),
1360
+ 1px
1361
+ );
1362
+ --_rail-step: calc(var(--_branch) + var(--_node-child) / 2);
1363
+ /* Where the row's own mark starts, and the rail it hangs from. */
1364
+ --_own: calc(var(--_pad-inline) + var(--_lead));
1365
+ --_from: 0px;
1366
+ --_mark-size: var(--_node);
1367
+ /* The middle of the mark: in the cell, and in the box of the lines, which
1368
+ starts a rule above it; the middle of a line placed there as a tile. */
1369
+ --_y: 50%;
1370
+ --_at: calc(50% + var(--_rule-width) / 2);
1371
+ --_tile: calc(50% + var(--_rule-width) / 2);
1372
+ }
1373
+
1374
+ [data-ui-table][data-guides='branch'] [data-part-row][data-level]:not([data-level='0']) {
1375
+ --_from: calc(var(--_rail) + (var(--slotted-table-depth) - 1) * var(--_rail-step));
1376
+ --_own: calc(var(--_from) + var(--_branch));
1377
+ --_mark-size: var(--_node-child);
1378
+ }
1379
+
1380
+ [data-ui-table][data-guides='branch'][data-cell-align='start'] [data-part-row][data-level] {
1381
+ --_y: calc(var(--_pad-block) + var(--_line) / 2);
1382
+ --_at: calc(var(--_y) + var(--_rule-width));
1383
+ --_tile: calc(var(--_y) + var(--_rule-width) / 2);
1384
+ }
1385
+
1386
+ [data-ui-table][data-guides='branch'][data-cell-align='end'] [data-part-row][data-level] {
1387
+ --_y: calc(100% - var(--_pad-block) - var(--_line) / 2);
1388
+ --_at: var(--_y);
1389
+ --_tile: calc(var(--_y) + var(--_rule-width) / 2);
1390
+ }
1391
+
1392
+ /* The row's lead: the mark stands out of flow at one place of its level, and
1393
+ the cell keeps its room. An expander before it is in flow, inside the indent. */
1394
+ [data-ui-table][data-guides='branch']
1395
+ [data-part-row][data-level]
1396
+ > :nth-child(1 of :not([data-part-selection])) {
1397
+ block-size: calc(var(--_node) + 2 * var(--slotted-space-1, 2px));
1398
+ box-sizing: border-box;
1399
+ padding-inline-start: var(--_own);
1400
+ }
1401
+
1402
+ [data-ui-table][data-guides='branch']
1403
+ [data-part-row][data-level]
1404
+ > :nth-child(1 of :not([data-part-selection])):has(> [data-part-mark]) {
1405
+ padding-inline-start: calc(var(--_own) + var(--_mark-size) + var(--_gap));
1406
+ }
1407
+
1408
+ [data-ui-table][data-guides='branch']
1409
+ [data-part-row][data-level]
1410
+ > :nth-child(1 of :not([data-part-selection])):not(
1411
+ :has(> :is([data-part-expander], [data-part-mark]))
1412
+ ) {
1413
+ padding-inline-start: calc(var(--_own) + var(--_mark-size) + var(--_gap));
1414
+ }
1415
+
1416
+ [data-ui-table][data-guides='branch']
1417
+ [data-part-row][data-level]
1418
+ > :nth-child(1 of :not([data-part-selection]))
1419
+ > [data-part-mark] {
1420
+ inset-block-start: calc(var(--_y) - var(--_mark-size) / 2);
1421
+ inset-inline-start: var(--_own);
1422
+ margin: 0;
1423
+ position: absolute;
1424
+ }
1425
+
1426
+ [data-ui-table][data-guides='branch']
1427
+ [data-part-row][data-level]
1428
+ > :nth-child(1 of :not([data-part-selection]))
1429
+ > [data-part-expander]:has(+ [data-part-mark]) {
1430
+ inset-block-start: calc(var(--_y) - var(--slotted-target-min, 24px) / 2);
1431
+ inset-inline-start: calc(var(--_own) - var(--_gap) - var(--slotted-target-min, 24px));
1432
+ margin: 0;
1433
+ position: absolute;
1434
+ }
1435
+
1436
+ [data-ui-table][data-guides='branch']
1437
+ [data-part-row][data-level]
1438
+ > :nth-child(1 of :not([data-part-selection]))::before {
1439
+ --_ink: linear-gradient(var(--_guide) 0 0);
1440
+ --_trunk: none;
1441
+ --_twig: none;
1442
+ --_root: none;
1443
+ background: var(--_root), var(--_twig), var(--_trunk), var(--slotted-tree-rails, none);
1444
+ inline-size: calc(var(--_own) + var(--_mark-size));
1445
+ inset-inline-start: 0;
1446
+ }
1447
+
1448
+ [data-ui-table][data-guides='branch']
1449
+ [data-part-row][data-level]:not([data-level='0'])
1450
+ > :nth-child(1 of :not([data-part-selection]))::before {
1451
+ --_reach: calc(var(--_branch) - var(--_rule-width) - var(--slotted-space-1, 2px));
1452
+ --_trunk: var(--_ink) var(--_from) 0 / var(--_rule-width) 100% no-repeat;
1453
+ --_twig: var(--_ink) var(--_from) var(--_tile) / calc(var(--_rule-width) + var(--_reach))
1454
+ var(--_rule-width) no-repeat;
1455
+ }
1456
+
1457
+ /* An expander between the branch and the mark takes the rest of the way. */
1458
+ [data-ui-table][data-guides='branch']
1459
+ [data-part-row][data-level]:not([data-level='0'])
1460
+ > :nth-child(1 of :not([data-part-selection])):has(
1461
+ > [data-part-expander] + [data-part-mark]
1462
+ )::before {
1463
+ --_reach: var(--slotted-space-2, 4px);
1464
+ }
1465
+
1466
+ [data-ui-table][data-guides='branch']
1467
+ [data-part-row][data-level]:not([data-level='0'])
1468
+ > :nth-child(1 of :not([data-part-selection])):not(
1469
+ :has(> :is([data-part-expander], [data-part-mark]))
1470
+ )::before {
1471
+ --_reach: calc(var(--_branch) + var(--_mark-size) - var(--_rule-width));
1472
+ }
1473
+
1474
+ [data-ui-table][data-guides='branch']
1475
+ [data-part-row][data-level][data-branch='last']:not([data-level='0'])
1476
+ > :nth-child(1 of :not([data-part-selection]))::before {
1477
+ --_trunk: var(--_ink) var(--_from) 0 / var(--_rule-width)
1478
+ calc(var(--_at) + var(--_rule-width) / 2) no-repeat;
1479
+ }
1480
+
1481
+ [data-ui-table][data-guides='branch']
1482
+ [data-part-row][data-level][data-branch-open]
1483
+ > :nth-child(1 of :not([data-part-selection]))::before {
1484
+ --_root: linear-gradient(
1485
+ to bottom,
1486
+ transparent calc(var(--_at) + var(--_mark-size) / 2),
1487
+ var(--_guide) calc(var(--_at) + var(--_mark-size) / 2)
1488
+ )
1489
+ calc(var(--_rail) + var(--slotted-table-depth) * var(--_rail-step)) 0 / var(--_rule-width)
1490
+ 100% no-repeat;
1491
+ }
1492
+
1493
+ [data-ui-table][data-guides='branch']
1494
+ [data-part-row][data-level]
1495
+ > :nth-child(1 of :not([data-part-selection])):dir(rtl)::before {
1496
+ scale: -1 1;
1497
+ }
1498
+
1286
1499
  /**
1287
1500
  * ── The expander ───────────────────────────────────────────────────────
1288
1501
  *
@@ -25,6 +25,7 @@
25
25
  "--slotted-radius-md",
26
26
  "--slotted-radius-sm",
27
27
  "--slotted-shadow-xs",
28
+ "--slotted-space-1",
28
29
  "--slotted-space-2",
29
30
  "--slotted-space-4",
30
31
  "--slotted-space-5",
@@ -33,6 +34,7 @@
33
34
  "--slotted-table-border-color",
34
35
  "--slotted-table-border-color-strong",
35
36
  "--slotted-table-border-width",
37
+ "--slotted-table-branch-size",
36
38
  "--slotted-table-caption-surface",
37
39
  "--slotted-table-cell-padding-block",
38
40
  "--slotted-table-cell-padding-inline",
@@ -52,6 +54,8 @@
52
54
  "--slotted-table-header-surface",
53
55
  "--slotted-table-header-surface-hover",
54
56
  "--slotted-table-icon-size",
57
+ "--slotted-table-mark-child-size",
58
+ "--slotted-table-mark-size",
55
59
  "--slotted-table-radius",
56
60
  "--slotted-table-row-color-selected",
57
61
  "--slotted-table-row-min-block-size",