@slotted/styles 0.1.0-beta.14 → 0.1.0-beta.16

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.14",
3
+ "version": "0.1.0-beta.16",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -504,6 +504,46 @@
504
504
  background-color: currentcolor;
505
505
  }
506
506
 
507
+ /**
508
+ * What falls on the day (`marks`): a dot in the row today's dot reserves, in
509
+ * the mark's tone. A marked day draws its mark there instead, and today
510
+ * keeps its colour and weight; on a chosen day the dot takes the day's ink.
511
+ */
512
+ [data-ui-calendar] [data-part-day]:has(> [data-part-mark])::before {
513
+ display: none;
514
+ }
515
+
516
+ [data-ui-calendar] [data-part-mark] {
517
+ --_mark: var(--slotted-tone-accent-solid, currentcolor);
518
+
519
+ background-color: var(--_mark);
520
+ block-size: var(--slotted-space-2, 0.25rem);
521
+ border-radius: var(--slotted-radius-full, 9999px);
522
+ flex: 0 0 auto;
523
+ inline-size: var(--slotted-space-2, 0.25rem);
524
+ order: 1;
525
+ }
526
+
527
+ [data-ui-calendar] [data-part-mark][data-tone='info'] {
528
+ --_mark: var(--slotted-tone-info-solid, currentcolor);
529
+ }
530
+
531
+ [data-ui-calendar] [data-part-mark][data-tone='success'] {
532
+ --_mark: var(--slotted-tone-success-solid, currentcolor);
533
+ }
534
+
535
+ [data-ui-calendar] [data-part-mark][data-tone='warning'] {
536
+ --_mark: var(--slotted-tone-warning-solid, currentcolor);
537
+ }
538
+
539
+ [data-ui-calendar] [data-part-mark][data-tone='danger'] {
540
+ --_mark: var(--slotted-tone-danger-solid, currentcolor);
541
+ }
542
+
543
+ [data-ui-calendar] [data-part-cell][data-selected] [data-part-mark] {
544
+ --_mark: currentcolor;
545
+ }
546
+
507
547
  /**
508
548
  * A day of the month either side. Quiet enough to read as context and legible
509
549
  * enough to press, because a reader who wants 1 October while looking at
@@ -62,6 +62,10 @@
62
62
  "--slotted-tone-accent-subtle-active",
63
63
  "--slotted-tone-accent-subtle-hover",
64
64
  "--slotted-tone-accent-text",
65
+ "--slotted-tone-danger-solid",
66
+ "--slotted-tone-info-solid",
65
67
  "--slotted-tone-secondary-subtle-active",
66
- "--slotted-tone-secondary-subtle-hover"
68
+ "--slotted-tone-secondary-subtle-hover",
69
+ "--slotted-tone-success-solid",
70
+ "--slotted-tone-warning-solid"
67
71
  ]
@@ -249,6 +249,9 @@
249
249
  }
250
250
 
251
251
  [data-ui-chart] > [data-part-header] > [data-part-actions] {
252
+ /* An action slot states one size for the links it holds. */
253
+ --slotted-link-font-size: var(--slotted-font-size-sm, 0.8125rem);
254
+
252
255
  align-items: center;
253
256
  display: flex;
254
257
  flex: none;
@@ -68,37 +68,69 @@
68
68
  * The medium class flows the same order, each widget a half or the whole
69
69
  * of the row; its height stays in rows. The compact class is one
70
70
  * column whose widgets are as tall as their content, the way a phone reads a
71
- * dashboard. The thresholds are the size classes of §2.7, literal because
72
- * CSS refuses a custom property in a container condition.
71
+ * dashboard. Once the binding has measured the grid it writes the class on
72
+ * the root (`data-size-class`, from `expandedFrom`), and the rules follow
73
+ * the attribute. Before that the container queries draw the classes at the
74
+ * thresholds of §2.7, literal because CSS refuses a custom property in a
75
+ * container condition.
73
76
  */
74
77
  @container dashboard-grid (width < 1024px) {
75
- [data-ui-dashboard-grid] > [data-part-grid] {
78
+ [data-ui-dashboard-grid]:not([data-size-class]) > [data-part-grid] {
76
79
  --_cols: var(--_dg-columns-medium, 6);
77
80
  }
78
81
 
79
- [data-ui-dashboard-grid] :is([data-part-widget], [data-part-placeholder]) {
82
+ [data-ui-dashboard-grid]:not([data-size-class])
83
+ :is([data-part-widget], [data-part-placeholder]) {
80
84
  grid-column: auto / span var(--_dg-span-medium, 3);
81
85
  grid-row: auto / span var(--_dg-h, 2);
82
86
  }
83
87
  }
84
88
 
89
+ [data-ui-dashboard-grid]:is([data-size-class='medium'], [data-size-class='compact'])
90
+ > [data-part-grid] {
91
+ --_cols: var(--_dg-columns-medium, 6);
92
+ }
93
+
94
+ [data-ui-dashboard-grid]:is([data-size-class='medium'], [data-size-class='compact'])
95
+ :is([data-part-widget], [data-part-placeholder]) {
96
+ grid-column: auto / span var(--_dg-span-medium, 3);
97
+ grid-row: auto / span var(--_dg-h, 2);
98
+ }
99
+
85
100
  @container dashboard-grid (width < 600px) {
86
- [data-ui-dashboard-grid] > [data-part-grid] {
101
+ [data-ui-dashboard-grid]:not([data-size-class]) > [data-part-grid] {
87
102
  --_cols: var(--_dg-columns-compact, 1);
88
103
 
89
104
  grid-auto-rows: auto;
90
105
  }
91
106
 
92
- [data-ui-dashboard-grid] :is([data-part-widget], [data-part-placeholder]) {
107
+ [data-ui-dashboard-grid]:not([data-size-class])
108
+ :is([data-part-widget], [data-part-placeholder]) {
93
109
  grid-column: 1 / -1;
94
110
  grid-row: auto;
95
111
  }
96
112
 
97
- [data-ui-dashboard-grid] [data-part-placeholder] {
113
+ [data-ui-dashboard-grid]:not([data-size-class]) [data-part-placeholder] {
98
114
  min-block-size: calc(var(--_row) * 2);
99
115
  }
100
116
  }
101
117
 
118
+ [data-ui-dashboard-grid][data-size-class='compact'] > [data-part-grid] {
119
+ --_cols: var(--_dg-columns-compact, 1);
120
+
121
+ grid-auto-rows: auto;
122
+ }
123
+
124
+ [data-ui-dashboard-grid][data-size-class='compact']
125
+ :is([data-part-widget], [data-part-placeholder]) {
126
+ grid-column: 1 / -1;
127
+ grid-row: auto;
128
+ }
129
+
130
+ [data-ui-dashboard-grid][data-size-class='compact'] [data-part-placeholder] {
131
+ min-block-size: calc(var(--_row) * 2);
132
+ }
133
+
102
134
  /* ── The widget ──────────────────────────────────────────────────────── */
103
135
 
104
136
  /**
@@ -361,11 +393,16 @@
361
393
  /* Below the expanded class the widgets flow, so no cell is a place to drop
362
394
  on and the lattice would be specks in the gaps. */
363
395
  @container dashboard-grid (width < 1024px) {
364
- [data-ui-dashboard-grid] > [data-part-grid]::before {
396
+ [data-ui-dashboard-grid]:not([data-size-class]) > [data-part-grid]::before {
365
397
  display: none;
366
398
  }
367
399
  }
368
400
 
401
+ [data-ui-dashboard-grid]:is([data-size-class='medium'], [data-size-class='compact'])
402
+ > [data-part-grid]::before {
403
+ display: none;
404
+ }
405
+
369
406
  /* ── Editing: the widget ─────────────────────────────────────────────── */
370
407
 
371
408
  /* The whole card is a place to pick the widget up from; its controls keep
@@ -638,21 +675,33 @@
638
675
  /* The medium class flows the widgets, so a widget's start is where the one
639
676
  before it ends: there is no start edge to pull. */
640
677
  @container dashboard-grid (width < 1024px) {
641
- [data-ui-dashboard-grid]
678
+ [data-ui-dashboard-grid]:not([data-size-class])
642
679
  [data-part-widget]
643
680
  > [data-part-resize-handle]:is([data-edge='start'], [data-edge='bottom-start']) {
644
681
  display: none;
645
682
  }
646
683
  }
647
684
 
685
+ [data-ui-dashboard-grid]:is([data-size-class='medium'], [data-size-class='compact'])
686
+ [data-part-widget]
687
+ > [data-part-resize-handle]:is([data-edge='start'], [data-edge='bottom-start']) {
688
+ display: none;
689
+ }
690
+
648
691
  /* A phone reads a dashboard as one column as tall as its content: there is
649
692
  no size to pull, only an order to change. */
650
693
  @container dashboard-grid (width < 600px) {
651
- [data-ui-dashboard-grid] [data-part-widget] > [data-part-resize-handle] {
694
+ [data-ui-dashboard-grid]:not([data-size-class]) [data-part-widget] > [data-part-resize-handle] {
652
695
  display: none;
653
696
  }
654
697
  }
655
698
 
699
+ [data-ui-dashboard-grid][data-size-class='compact']
700
+ [data-part-widget]
701
+ > [data-part-resize-handle] {
702
+ display: none;
703
+ }
704
+
656
705
  /* ── Editing: a widget in hand ───────────────────────────────────────── */
657
706
 
658
707
  /**
@@ -954,6 +954,8 @@
954
954
 
955
955
  [data-ui-dialog] > [data-part-viewport] > [data-part-content] > form > [data-part-body],
956
956
  [data-ui-dialog] > [data-part-viewport] > [data-part-content] > [data-part-body] {
957
+ /* The row that stretches, with or without a header above it. */
958
+ grid-row: 2;
957
959
  min-block-size: 0;
958
960
  overflow-x: hidden;
959
961
  overflow-y: auto;
@@ -1005,6 +1007,8 @@
1005
1007
  */
1006
1008
  [data-ui-dialog] > [data-part-viewport] > [data-part-content] > form > [data-part-footer],
1007
1009
  [data-ui-dialog] > [data-part-viewport] > [data-part-content] > [data-part-footer] {
1010
+ /* The last row, with or without a body above it: without one it took the row that stretches. */
1011
+ grid-row: 3;
1008
1012
  display: flex;
1009
1013
  flex-wrap: wrap;
1010
1014
  align-items: center;
@@ -136,7 +136,8 @@
136
136
  * decide. A property is resolved on the element instead, and the three
137
137
  * states below read as what they are.
138
138
  */
139
- --_slide: var(--slotted-duration-long) var(--slotted-easing-enter);
139
+ --_slide: var(--slotted-drawer-slide-duration, var(--slotted-duration-long))
140
+ var(--slotted-easing-enter);
140
141
  --_move: var(--slotted-duration-medium) var(--slotted-easing-enter);
141
142
  /**
142
143
  * `allow-discrete` is the whole of it. Without it the rule that hides a
@@ -155,7 +156,8 @@
155
156
  * it had finished leaving — which is a hundred and fifty milliseconds
156
157
  * before `closed` fires.
157
158
  */
158
- --_reveal: content-visibility var(--slotted-duration-medium) allow-discrete;
159
+ --_reveal: content-visibility
160
+ var(--slotted-drawer-slide-exit-duration, var(--slotted-duration-medium)) allow-discrete;
159
161
 
160
162
  /**
161
163
  * The repository has no global reset, so a family that gives a box an
@@ -177,7 +179,8 @@
177
179
 
178
180
  /** Leaving is shorter than arriving: a reader who has decided is waiting. */
179
181
  [data-ui-drawer]:not([data-open]) {
180
- --_slide: var(--slotted-duration-medium) var(--slotted-easing-exit);
182
+ --_slide: var(--slotted-drawer-slide-exit-duration, var(--slotted-duration-medium))
183
+ var(--slotted-easing-exit);
181
184
  --_move: var(--slotted-duration-medium) var(--slotted-easing-exit);
182
185
  }
183
186
 
@@ -575,8 +578,9 @@
575
578
  /**
576
579
  * A sheet on a wide layer is a card over the page, not a strip across it:
577
580
  * forty rems, Material 3's 640 dp, centred, with the scrim on both sides. The
578
- * edge then shows on three sides, so the panel draws it on three; on a phone
579
- * the two side edges sit on the screen's own and read as nothing.
581
+ * edge then shows on three sides, so the panel draws it on three. An overlay
582
+ * layer is the viewport, so at the sheet's measure or under it — a phone —
583
+ * the side edges would sit on the screen's own and are not drawn.
580
584
  */
581
585
  [data-ui-drawer][data-mode='overlay'][data-side='top'] > [data-part-panel],
582
586
  [data-ui-drawer][data-mode='overlay'][data-side='bottom'] > [data-part-panel] {
@@ -585,7 +589,12 @@
585
589
  100%,
586
590
  var(--slotted-drawer-sheet-inline-size, var(--slotted-drawer-extent-xl, 40rem))
587
591
  );
588
- border-inline-width: var(--_rule-size);
592
+ border-inline-width: clamp(
593
+ 0px,
594
+ (100vw - var(--slotted-drawer-sheet-inline-size, var(--slotted-drawer-extent-xl, 40rem))) *
595
+ 1000,
596
+ var(--_rule-size)
597
+ );
589
598
  }
590
599
 
591
600
  /**
@@ -689,7 +698,7 @@
689
698
  * step, because a container condition cannot hold a custom property — buy one
690
699
  * hairline at the extreme edge of the viewport.
691
700
  */
692
- [data-ui-drawer][data-size='full'] > [data-part-panel] {
701
+ [data-ui-drawer][data-mode][data-size='full'] > [data-part-panel] {
693
702
  border-width: 0;
694
703
  border-radius: 0;
695
704
  }
@@ -1112,6 +1121,20 @@
1112
1121
  color: var(--slotted-drawer-title-color, var(--slotted-text, CanvasText));
1113
1122
  }
1114
1123
 
1124
+ /* Actions take a column between the words and the close button, on the title's row. */
1125
+ [data-ui-drawer] > [data-part-panel] > [data-part-header]:has(> [data-part-actions]) {
1126
+ grid-template-columns: minmax(0, 1fr) auto auto;
1127
+ }
1128
+
1129
+ [data-ui-drawer] > [data-part-panel] > [data-part-header] > [data-part-actions] {
1130
+ grid-column: 2;
1131
+ grid-row: 1 / span 2;
1132
+ align-self: start;
1133
+ display: flex;
1134
+ align-items: center;
1135
+ gap: var(--slotted-space-2, 0.25rem);
1136
+ }
1137
+
1115
1138
  [data-ui-drawer] > [data-part-panel] > [data-part-header] > [data-part-description] {
1116
1139
  grid-column: 1;
1117
1140
  grid-row: 2;
@@ -1136,7 +1159,8 @@
1136
1159
  [data-ui-drawer] > [data-part-panel] > [data-part-header] > [data-part-close] {
1137
1160
  --slotted-icon-size: var(--_icon-size);
1138
1161
 
1139
- grid-column: 2;
1162
+ /* The last column, beside the actions when there are any. */
1163
+ grid-column: -2;
1140
1164
  grid-row: 1 / span 2;
1141
1165
  align-self: start;
1142
1166
  display: inline-grid;
@@ -1305,4 +1329,271 @@
1305
1329
  border-color: CanvasText;
1306
1330
  }
1307
1331
  }
1332
+
1333
+ /* ── The sheet on the platform's scroll ─────────────────────────────── */
1334
+
1335
+ /**
1336
+ * An overlay sheet from the bottom that a hand moves (`data-drag`) is moved by
1337
+ * the platform's own scroll: the layer scrolls, a spacer the height of the
1338
+ * layer comes before the panel, and `scrollTop` is how much of the panel is
1339
+ * in sight. The stops are snap points that `attachSheetScroll` in
1340
+ * `@slotted/core/extent` lays out, so the finger, the fling and the landing
1341
+ * are the compositor's. The layer takes no press of its own: the scrim and
1342
+ * the panel do, and a touch on the panel scrolls the layer.
1343
+ */
1344
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag] {
1345
+ display: block;
1346
+ overflow-x: hidden;
1347
+ overflow-y: auto;
1348
+ overscroll-behavior: contain;
1349
+ scroll-snap-type: y mandatory;
1350
+ scroll-padding-block-end: var(--slotted-keyboard-inset, 0px);
1351
+ scrollbar-width: none;
1352
+ scroll-timeline: --slotted-drawer-sheet block;
1353
+ pointer-events: none;
1354
+ }
1355
+
1356
+ /**
1357
+ * Opening and closing are the same scroll a hand ends with: the binding
1358
+ * scrolls the layer to the resting stop or to nothing on the platform's
1359
+ * smooth scroll, so a sheet sent away by a press outside leaves the way a
1360
+ * dragged one does. The panel does not slide on its own, and the layer is
1361
+ * kept for as long as that scroll takes (Chrome: about 440 ms across a
1362
+ * phone's height). Leaving, nothing re-snaps: a re-snap would lift the panel
1363
+ * back into view on its way out.
1364
+ */
1365
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag] {
1366
+ --_reveal: content-visibility
1367
+ calc(var(--slotted-duration-long) + var(--slotted-duration-medium)) allow-discrete;
1368
+ }
1369
+
1370
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag]:not([data-open]) {
1371
+ scroll-snap-type: none;
1372
+ }
1373
+
1374
+ /* Nor before the stops are laid out: the opening scrolls up from out of sight, not from the panel's end. */
1375
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag]:not([data-sheet-ready]) {
1376
+ scroll-snap-type: none;
1377
+ }
1378
+
1379
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag]:not([data-open])
1380
+ > [data-part-panel] {
1381
+ translate: 0 0;
1382
+ }
1383
+
1384
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag]::-webkit-scrollbar {
1385
+ display: none;
1386
+ }
1387
+
1388
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag]::before {
1389
+ content: '';
1390
+ display: block;
1391
+ block-size: 100%;
1392
+ }
1393
+
1394
+ /* Fixed, so a touch on it scrolls nothing and a press on it is a press outside. */
1395
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag] > [data-part-backdrop] {
1396
+ position: fixed;
1397
+ inset: 0;
1398
+ }
1399
+
1400
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag]:not([data-undimmed])
1401
+ > [data-part-backdrop] {
1402
+ pointer-events: auto;
1403
+ }
1404
+
1405
+ /**
1406
+ * The panel clips its corners without being a scroll container, so what
1407
+ * sticks inside it sticks to the layer's scrollport: the screen. The measure
1408
+ * does not ease; nothing animates it, the scroll moves the panel. The second
1409
+ * shadow is the panel's surface below its edge, which a rubber band past the
1410
+ * highest stop shows instead of a gap.
1411
+ */
1412
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag] > [data-part-panel] {
1413
+ pointer-events: auto;
1414
+ scroll-snap-align: end;
1415
+ margin-inline: auto;
1416
+ overflow: clip;
1417
+ max-block-size: none;
1418
+ box-shadow:
1419
+ var(--slotted-shadow-lg),
1420
+ 0 50vh 0 0 var(--slotted-drawer-surface, var(--slotted-surface-raised, Canvas));
1421
+ transition:
1422
+ translate var(--_slide),
1423
+ border-start-start-radius var(--_move),
1424
+ border-start-end-radius var(--_move);
1425
+ }
1426
+
1427
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag]
1428
+ > [data-part-panel]
1429
+ > [data-part-footer] {
1430
+ position: sticky;
1431
+ inset-block-end: var(--slotted-keyboard-inset, 0px);
1432
+ z-index: 1;
1433
+ background: var(--slotted-drawer-surface, var(--slotted-surface-raised, Canvas));
1434
+ }
1435
+
1436
+ /**
1437
+ * `drag="panel"`: one scroll for the sheet and what it holds, Android's
1438
+ * nested scrolling in a single scroller. The panel is as tall as its content;
1439
+ * the body does not scroll on its own. A hand pushing up from a lower stop
1440
+ * lifts the sheet to the top of the screen and, without letting go, goes on
1441
+ * scrolling the content under the header that sticks there; pulling down
1442
+ * from the top of the content brings the sheet down. A panel taller than the
1443
+ * layer is a snap area larger than the snapport, so every position inside it
1444
+ * is a resting one. Content at rest past the top is read with the snap off
1445
+ * (`data-sheet-content`); going back below the top turns it on, and that
1446
+ * re-snap stops a fling out of the content at the top.
1447
+ */
1448
+ /* The rows take their content and a last one what is left, so the content's end is read off its parts. */
1449
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel'] > [data-part-panel] {
1450
+ block-size: auto;
1451
+ min-block-size: var(--slotted-drawer-sheet-height, 0px);
1452
+ grid-template-rows: auto auto auto auto minmax(0, 1fr);
1453
+ }
1454
+
1455
+ /* `size="full"` is the screen: the footer rests at its bottom, in the row that takes what is left. */
1456
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel'][data-size='full']
1457
+ > [data-part-panel]
1458
+ > [data-part-footer] {
1459
+ grid-row: 5;
1460
+ align-self: end;
1461
+ }
1462
+
1463
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel'][data-sheet-scrolls]
1464
+ > [data-part-panel] {
1465
+ scroll-snap-align: start;
1466
+ }
1467
+
1468
+ /* Content at rest past the top: the snap is off so a layout does not re-snap it to the top. */
1469
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel'][data-sheet-content] {
1470
+ scroll-snap-type: none;
1471
+ }
1472
+
1473
+ /* No finger on content at rest: the spacer folds, and the top of the content is an edge. */
1474
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel'][data-sheet-anchored]::before {
1475
+ block-size: 0;
1476
+ }
1477
+
1478
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1479
+ > [data-part-panel]
1480
+ > [data-part-body] {
1481
+ overflow: visible;
1482
+ overscroll-behavior: auto;
1483
+ }
1484
+
1485
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1486
+ > [data-part-panel]
1487
+ > [data-part-resizer] {
1488
+ position: sticky;
1489
+ inset-block-start: 0;
1490
+ z-index: 2;
1491
+ background: var(--slotted-drawer-surface, var(--slotted-surface-raised, Canvas));
1492
+ }
1493
+
1494
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1495
+ > [data-part-panel]
1496
+ > [data-part-header] {
1497
+ position: sticky;
1498
+ inset-block-start: 0;
1499
+ z-index: 1;
1500
+ background: var(--slotted-drawer-surface, var(--slotted-surface-raised, Canvas));
1501
+ }
1502
+
1503
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1504
+ > [data-part-panel]:has(> [data-part-resizer])
1505
+ > [data-part-header] {
1506
+ inset-block-start: var(--_resizer-thickness);
1507
+ }
1508
+
1509
+ /**
1510
+ * `drag="resizer"`: only the grabber moves the sheet. The panel is laid out at
1511
+ * the highest stop and the body scrolls inside it, at the highest stop only.
1512
+ */
1513
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='resizer']
1514
+ > [data-part-panel] {
1515
+ block-size: var(--slotted-drawer-sheet-height, auto);
1516
+ touch-action: none;
1517
+ }
1518
+
1519
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='resizer']
1520
+ > [data-part-panel]
1521
+ > [data-part-body] {
1522
+ touch-action: pan-y;
1523
+ }
1524
+
1525
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='resizer']:not(
1526
+ [data-top-stop]
1527
+ )
1528
+ > [data-part-panel]
1529
+ > [data-part-body] {
1530
+ overflow: hidden;
1531
+ }
1532
+
1533
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag]
1534
+ > [data-part-panel]
1535
+ > [data-part-resizer] {
1536
+ touch-action: pan-y;
1537
+ }
1538
+
1539
+ /* Every region inside the sheet passes its block-axis overscroll on to the sheet, a family's own `contain` included. */
1540
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1541
+ > [data-part-panel]
1542
+ * {
1543
+ overscroll-behavior-y: auto;
1544
+ }
1545
+
1546
+ /* A region the consumer keeps from the sheet: its own scroll never passes on to it. */
1547
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag] [data-drawer-drag='none'] {
1548
+ overscroll-behavior: contain;
1549
+ }
1550
+
1551
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag]
1552
+ > [data-part-stops]
1553
+ [data-part-stop] {
1554
+ position: absolute;
1555
+ inset-inline: 0;
1556
+ block-size: 0;
1557
+ scroll-snap-align: start;
1558
+ pointer-events: none;
1559
+ }
1560
+
1561
+ /**
1562
+ * The scrim dims with the sheet: out of sight it is clear, at the lowest stop
1563
+ * it is whole. The element keeps the fade it opens and closes with; the
1564
+ * scroll drives a layer inside it, and the two multiply.
1565
+ */
1566
+ @supports (animation-timeline: scroll()) {
1567
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag] > [data-part-backdrop] {
1568
+ background: none;
1569
+ }
1570
+
1571
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag]
1572
+ > [data-part-backdrop]::before {
1573
+ content: '';
1574
+ position: absolute;
1575
+ inset: 0;
1576
+ /* A decoration: unthemed, it is not painted rather than painted in a system colour. */
1577
+ background: var(--slotted-drawer-scrim, var(--slotted-scrim));
1578
+ animation: slotted-drawer-sheet-dim linear both;
1579
+ animation-timeline: --slotted-drawer-sheet;
1580
+ animation-range: 0px var(--slotted-drawer-sheet-floor, 100%);
1581
+ }
1582
+
1583
+ /* Reading content, the sheet is at the top: the scrim is whole, wherever the scroll is. */
1584
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag][data-sheet-content]
1585
+ > [data-part-backdrop]::before {
1586
+ animation: none;
1587
+ }
1588
+ }
1589
+
1590
+ @keyframes slotted-drawer-sheet-dim {
1591
+ from {
1592
+ opacity: 0;
1593
+ }
1594
+
1595
+ to {
1596
+ opacity: 1;
1597
+ }
1598
+ }
1308
1599
  }
@@ -29,7 +29,11 @@
29
29
  "--slotted-drawer-resizer-line-color",
30
30
  "--slotted-drawer-rule-color",
31
31
  "--slotted-drawer-scrim",
32
+ "--slotted-drawer-sheet-floor",
33
+ "--slotted-drawer-sheet-height",
32
34
  "--slotted-drawer-sheet-inline-size",
35
+ "--slotted-drawer-slide-duration",
36
+ "--slotted-drawer-slide-exit-duration",
33
37
  "--slotted-drawer-surface",
34
38
  "--slotted-drawer-title-color",
35
39
  "--slotted-drawer-title-font-family",
package/src/link/link.css CHANGED
@@ -80,6 +80,27 @@
80
80
  * pointer. Fluent calls it `subtle`, Primer `muted`, Polaris `monochrome`,
81
81
  * and all three describe the same two colours.
82
82
  */
83
+ /**
84
+ * The text size. Unset, a link takes the size an action slot states for the
85
+ * controls it holds (`--slotted-link-font-size`), or else its parent's; a
86
+ * `size` states its own.
87
+ */
88
+ [data-ui-link] {
89
+ font-size: var(--slotted-link-font-size, inherit);
90
+ }
91
+
92
+ [data-ui-link][data-size='xs'] {
93
+ font-size: var(--slotted-font-size-xs, 0.75rem);
94
+ }
95
+
96
+ [data-ui-link][data-size='sm'] {
97
+ font-size: var(--slotted-font-size-sm, 0.8125rem);
98
+ }
99
+
100
+ [data-ui-link][data-size='md'] {
101
+ font-size: var(--slotted-font-size-md, 0.875rem);
102
+ }
103
+
83
104
  [data-ui-link][data-variant='neutral'] {
84
105
  --_rest: var(--slotted-link-color, currentColor);
85
106
  --_hover: var(--slotted-link-color-hover, var(--slotted-tone-accent-text, LinkText));
@@ -5,6 +5,9 @@
5
5
  "--slotted-easing-standard",
6
6
  "--slotted-focus-ring-color",
7
7
  "--slotted-focus-ring-width",
8
+ "--slotted-font-size-md",
9
+ "--slotted-font-size-sm",
10
+ "--slotted-font-size-xs",
8
11
  "--slotted-link-color",
9
12
  "--slotted-link-color-active",
10
13
  "--slotted-link-color-current",
@@ -14,6 +17,7 @@
14
17
  "--slotted-link-external-icon-gap",
15
18
  "--slotted-link-external-icon-size",
16
19
  "--slotted-link-focus-ring-offset",
20
+ "--slotted-link-font-size",
17
21
  "--slotted-link-radius",
18
22
  "--slotted-link-underline-color",
19
23
  "--slotted-link-underline-offset",
@@ -617,6 +617,16 @@
617
617
  unicode-bidi: plaintext;
618
618
  }
619
619
 
620
+ /**
621
+ * A bubble is as wide as its words. Prose — markdown's typography — is a size
622
+ * container for its narrow-column rules, and a size container contributes no
623
+ * width, so the bubble shrank to its padding. Inside a bubble prose sizes to
624
+ * its text and its narrow-column rules do not apply.
625
+ */
626
+ [data-ui-message][data-part-bubble] > [data-part-content] [data-ui-prose] {
627
+ container-type: normal;
628
+ }
629
+
620
630
  [data-ui-message][data-part-bubble][data-variant='solid'] > [data-part-content] {
621
631
  --_ground: var(--_solid);
622
632
  --_ink: var(--_on-solid);
@@ -237,7 +237,7 @@
237
237
  */
238
238
  [data-ui-prompt-composer]
239
239
  > :is([data-part-header], [data-part-footer])
240
- > :is([data-part-action], [data-part-attach]) {
240
+ > :is([data-part-action], [data-part-attach], [data-part-dictate]) {
241
241
  align-items: center;
242
242
  appearance: none;
243
243
  background-color: transparent;
@@ -313,7 +313,7 @@
313
313
  finger, and never across the edge two buttons share. */
314
314
  [data-ui-prompt-composer]
315
315
  > :is([data-part-header], [data-part-footer])
316
- > :is([data-part-action], [data-part-attach], [data-part-submit])::after {
316
+ > :is([data-part-action], [data-part-attach], [data-part-dictate], [data-part-submit])::after {
317
317
  content: '';
318
318
  inset: min(0px, calc((100% - var(--slotted-target-min, 24px)) / 2));
319
319
  position: absolute;
@@ -322,27 +322,41 @@
322
322
  @media (pointer: coarse) {
323
323
  [data-ui-prompt-composer]
324
324
  > :is([data-part-header], [data-part-footer])
325
- > :is([data-part-action], [data-part-attach], [data-part-submit])::after {
325
+ > :is(
326
+ [data-part-action],
327
+ [data-part-attach],
328
+ [data-part-dictate],
329
+ [data-part-submit]
330
+ )::after {
326
331
  inset: min(0px, calc((100% - var(--slotted-target-comfortable, 44px)) / 2));
327
332
  }
328
333
 
329
334
  [data-ui-prompt-composer]
330
335
  > :is([data-part-header], [data-part-footer])
331
- > :is([data-part-action], [data-part-attach]):has(+ *)::after {
336
+ > :is([data-part-action], [data-part-attach], [data-part-dictate]):has(+ *)::after {
332
337
  inset-inline-end: 0;
333
338
  }
334
339
 
335
340
  [data-ui-prompt-composer]
336
341
  > :is([data-part-header], [data-part-footer])
337
342
  > *
338
- + :is([data-part-action], [data-part-attach], [data-part-submit])::after {
343
+ + :is(
344
+ [data-part-action],
345
+ [data-part-attach],
346
+ [data-part-dictate],
347
+ [data-part-submit]
348
+ )::after {
339
349
  inset-inline-start: 0;
340
350
  }
341
351
  }
342
352
 
343
353
  [data-ui-prompt-composer]
344
354
  > :is([data-part-header], [data-part-footer])
345
- > :is([data-part-action], [data-part-attach]):hover:not(:disabled, [aria-expanded='true']) {
355
+ > :is([data-part-action], [data-part-attach], [data-part-dictate]):hover:not(
356
+ :disabled,
357
+ [aria-expanded='true'],
358
+ [aria-pressed='true']
359
+ ) {
346
360
  background-color: var(
347
361
  --slotted-prompt-composer-action-hover-background,
348
362
  var(--slotted-tone-secondary-subtle-hover)
@@ -351,9 +365,11 @@
351
365
 
352
366
  [data-ui-prompt-composer]
353
367
  > :is([data-part-header], [data-part-footer])
354
- > :is([data-part-action], [data-part-attach]):is(:active, [aria-expanded='true']):not(
355
- :disabled
356
- ) {
368
+ > :is([data-part-action], [data-part-attach], [data-part-dictate]):is(
369
+ :active,
370
+ [aria-expanded='true'],
371
+ [aria-pressed='true']
372
+ ):not(:disabled) {
357
373
  background-color: var(
358
374
  --slotted-prompt-composer-action-active-background,
359
375
  var(--slotted-tone-secondary-subtle-active)
@@ -362,7 +378,7 @@
362
378
 
363
379
  [data-ui-prompt-composer]
364
380
  > :is([data-part-header], [data-part-footer])
365
- > :is([data-part-action], [data-part-attach]):disabled {
381
+ > :is([data-part-action], [data-part-attach], [data-part-dictate]):disabled {
366
382
  color: var(--slotted-disabled-foreground);
367
383
  cursor: not-allowed;
368
384
  }
@@ -535,7 +551,7 @@
535
551
  ring stands against the frame's ground rather than against the accent. */
536
552
  [data-ui-prompt-composer]
537
553
  > :is([data-part-header], [data-part-footer])
538
- > :is([data-part-action], [data-part-attach]):focus-visible {
554
+ > :is([data-part-action], [data-part-attach], [data-part-dictate]):focus-visible {
539
555
  outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
540
556
  outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
541
557
  }
@@ -576,8 +592,8 @@
576
592
  * outline and its raised shadow; the controls inside keep their own focus
577
593
  * rings. Two marks the binding draws, both `aria-hidden`: the ring, a band
578
594
  * the width of `--slotted-prompt-composer-ring-width` cut out of a turning
579
- * conic gradient, and the glow, the same gradient blurred and cut to what
580
- * lies outside the frame. Each turns a square larger than its box by a
595
+ * conic gradient, and the glow, the same gradient blurred under the frame's
596
+ * surface, so only its halo outside the frame shows. Each turns a square larger than its box by a
581
597
  * `transform`, which the compositor runs at a constant speed.
582
598
  */
583
599
  [data-ui-prompt-composer][data-part-root][data-emphasis='ring'] {
@@ -627,19 +643,31 @@
627
643
  z-index: 1;
628
644
  }
629
645
 
646
+ /**
647
+ * The glow is the frame's own box, blurred: the halo is the blur's ink, which
648
+ * fades to nothing past the edge, and ink adds no overflow to a scrolling
649
+ * ancestor. A box the reach larger, cut by a mask, gave both a hard edge and
650
+ * that overflow. The frame's surface is restated on `::after`, which paints
651
+ * above the glow, so the halo shows outside the frame only.
652
+ */
630
653
  [data-ui-prompt-composer] > [data-part-glow] {
631
- border-radius: calc(var(--_radius) + var(--_ring-reach));
632
654
  filter: blur(calc(var(--_ring-reach) / 2));
633
- inset: calc(-1 * var(--_ring-reach));
634
- mask:
635
- linear-gradient(#000 0 0) content-box exclude,
636
- linear-gradient(#000 0 0);
655
+ inset: calc(-1 * var(--slotted-control-border-width, 1px));
637
656
  opacity: var(--_glow);
638
- padding: var(--_ring-reach);
639
657
  transition: opacity var(--slotted-duration-medium) var(--slotted-easing-standard);
640
658
  z-index: -1;
641
659
  }
642
660
 
661
+ [data-ui-prompt-composer][data-part-root][data-emphasis='ring']::after {
662
+ background-color: inherit;
663
+ border-radius: inherit;
664
+ content: '';
665
+ inset: 0;
666
+ pointer-events: none;
667
+ position: absolute;
668
+ z-index: -1;
669
+ }
670
+
643
671
  [data-ui-prompt-composer] > :is([data-part-ring], [data-part-glow])::before {
644
672
  animation: slotted-prompt-composer-turn
645
673
  var(--slotted-prompt-composer-ring-duration, var(--slotted-duration-loop-slow)) linear
@@ -276,6 +276,9 @@
276
276
 
277
277
  /* An implicit column: a header with no actions has one column and no gap. */
278
278
  [data-ui-section] > [data-part-header] > [data-part-actions] {
279
+ /* An action slot states one size for the links it holds. */
280
+ --slotted-link-font-size: var(--slotted-font-size-sm, 0.8125rem);
281
+
279
282
  align-items: center;
280
283
  display: flex;
281
284
  gap: var(--slotted-control-gap-md, 8px);
@@ -406,6 +406,9 @@
406
406
  and a corner is where a control is looked for. */
407
407
  @scope ([data-ui-stat-card]) to (:scope [data-ui] > *) {
408
408
  :scope [data-part-action] {
409
+ /* An action slot states one size for the links it holds. */
410
+ --slotted-link-font-size: var(--slotted-font-size-sm, 0.8125rem);
411
+
409
412
  flex: none;
410
413
  /* The label's line, so a link here is as tall in the fallback face as in
411
414
  the web face and the header does not grow when the font arrives. */
@@ -259,6 +259,9 @@
259
259
  column's digits ended at one edge and their name at the other. */
260
260
  [data-ui-table] [data-part-column-header],
261
261
  [data-ui-table] [data-part-head] [data-part-selection] {
262
+ /* What a pinned header cell paints, in place of its row's ground. */
263
+ --_pinned-ground: var(--_head-surface);
264
+
262
265
  background-color: var(--_head-surface);
263
266
  border-block-end: var(--_rule-width) solid var(--_rule-strong);
264
267
  color: var(--_text);
@@ -279,6 +282,8 @@
279
282
  }
280
283
 
281
284
  [data-ui-table][data-variant='plain'] [data-part-column-header] {
285
+ --_pinned-ground: transparent;
286
+
282
287
  background-color: transparent;
283
288
  }
284
289
 
@@ -286,7 +291,10 @@
286
291
  * ── Rows and cells ─────────────────────────────────────────────────────
287
292
  */
288
293
  [data-ui-table] [data-part-row] {
289
- background-color: var(--_surface);
294
+ /* Published for a pinned cell, which paints it over an opaque ground. */
295
+ --_row-ground: var(--_surface);
296
+
297
+ background-color: var(--_row-ground);
290
298
  }
291
299
 
292
300
  /**
@@ -470,7 +478,7 @@
470
478
  the same body, so the stripe follows the record it belongs to rather than
471
479
  alternating around it — see the detail rule below. */
472
480
  [data-ui-table][data-striped] [data-part-body] > [data-part-row]:nth-child(even) {
473
- background-color: var(--_stripe);
481
+ --_row-ground: var(--_stripe);
474
482
  }
475
483
 
476
484
  /**
@@ -482,7 +490,7 @@
482
490
  * disabled does not answer the pointer at all.
483
491
  */
484
492
  [data-ui-table] [data-part-body] > [data-part-row]:not([data-disabled]):hover {
485
- background-color: var(--_hover);
493
+ --_row-ground: var(--_hover);
486
494
  }
487
495
 
488
496
  /**
@@ -498,12 +506,12 @@
498
506
  * requirement anyway.
499
507
  */
500
508
  [data-ui-table] [data-part-body] > [data-part-row][data-selected] {
501
- background-color: var(--_selected);
509
+ --_row-ground: var(--_selected);
502
510
  color: var(--_selected-text);
503
511
  }
504
512
 
505
513
  [data-ui-table] [data-part-body] > [data-part-row][data-selected]:not([data-disabled]):hover {
506
- background-color: var(--_selected-hover);
514
+ --_row-ground: var(--_selected-hover);
507
515
  }
508
516
 
509
517
  [data-ui-table] [data-part-row][data-disabled] {
@@ -518,7 +526,7 @@
518
526
  * scrolled cells through it. Selection is stronger and paints over it.
519
527
  */
520
528
  [data-ui-table] [data-part-body] > [data-part-row][data-current]:not([data-selected]) {
521
- background-color: var(
529
+ --_row-ground: var(
522
530
  --slotted-table-row-surface-current,
523
531
  var(--slotted-tone-secondary-subtle-active, ButtonFace)
524
532
  );
@@ -729,11 +737,20 @@
729
737
  z-index: calc(var(--slotted-z-index-sticky, 100) + 2);
730
738
  }
731
739
 
740
+ /* The ground the row is painted with, whatever state it is in, so a
741
+ hovered, striped or selected row keeps one colour across the seam — over
742
+ the page's own surface, so a row on a transparent table surface still
743
+ covers what scrolls under it. `inherit` copied a transparent row as is. */
744
+ [data-ui-table] [data-sticky] {
745
+ background:
746
+ linear-gradient(
747
+ var(--_pinned-ground, var(--_row-ground)),
748
+ var(--_pinned-ground, var(--_row-ground))
749
+ ),
750
+ var(--slotted-surface, Canvas);
751
+ }
752
+
732
753
  [data-ui-table] [data-sticky='start'] {
733
- /* The ground the row is painted with, whatever state it is in: `inherit`
734
- takes the row's own computed value, so a hovered, striped or selected row
735
- keeps one colour across the seam. */
736
- background-color: inherit;
737
754
  /**
738
755
  * Where the column stops, and it is stated rather than measured. Two
739
756
  * columns pinned to the same edge both resolve against the scroller, so
@@ -748,7 +765,6 @@
748
765
  }
749
766
 
750
767
  [data-ui-table] [data-sticky='end'] {
751
- background-color: inherit;
752
768
  inset-inline-end: var(--slotted-table-sticky-inset, 0);
753
769
  position: sticky;
754
770
  z-index: var(--slotted-z-index-sticky, 100);
@@ -1550,6 +1566,8 @@
1550
1566
  * table holding the consumer's own controls.
1551
1567
  */
1552
1568
  [data-ui-table] [data-part-summary] > [data-part-row] > * {
1569
+ --_pinned-ground: var(--_head-surface);
1570
+
1553
1571
  background-color: var(--_head-surface);
1554
1572
  border-block-start: var(--_rule-width) solid var(--_rule-strong);
1555
1573
  font-weight: var(--slotted-font-weight-medium, 500);
@@ -1558,6 +1576,8 @@
1558
1576
  }
1559
1577
 
1560
1578
  [data-ui-table][data-variant='plain'] [data-part-summary] > [data-part-row] > * {
1579
+ --_pinned-ground: transparent;
1580
+
1561
1581
  background-color: transparent;
1562
1582
  }
1563
1583