@slotted/styles 0.1.0-beta.1 → 0.1.0-beta.10

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.
Files changed (176) hide show
  1. package/package.json +1 -1
  2. package/src/accordion/accordion.css +10 -10
  3. package/src/action-bar/action-bar.css +31 -32
  4. package/src/action-sheet/action-sheet.css +36 -36
  5. package/src/alert/alert.css +43 -35
  6. package/src/alert/alert.tokens.json +5 -0
  7. package/src/app-shell/app-shell.css +356 -301
  8. package/src/aspect-ratio/aspect-ratio.css +9 -9
  9. package/src/attachment/attachment.css +91 -99
  10. package/src/avatar/avatar.css +71 -41
  11. package/src/avatar/avatar.tokens.json +7 -0
  12. package/src/avatar-group/avatar-group.css +21 -22
  13. package/src/badge/badge.css +45 -37
  14. package/src/badge/badge.tokens.json +5 -0
  15. package/src/breadcrumb/breadcrumb.css +37 -37
  16. package/src/button/button.css +139 -64
  17. package/src/button/button.tokens.json +10 -0
  18. package/src/button-group/button-group.css +76 -72
  19. package/src/button-group/button-group.tokens.json +2 -0
  20. package/src/calendar/calendar.css +93 -103
  21. package/src/card/card.css +54 -61
  22. package/src/carousel/carousel.css +150 -161
  23. package/src/cascader/cascader.css +152 -153
  24. package/src/cascader/cascader.tokens.json +1 -0
  25. package/src/chart/chart.css +242 -239
  26. package/src/chart/chart.tokens.json +1 -0
  27. package/src/checkbox/checkbox.css +119 -124
  28. package/src/checkbox-group/checkbox-group.css +7 -7
  29. package/src/code-block/code-block.css +81 -85
  30. package/src/collapsible/collapsible.css +69 -76
  31. package/src/color-picker/color-picker.css +83 -91
  32. package/src/column-manager/column-manager.css +106 -114
  33. package/src/combobox/combobox.css +132 -107
  34. package/src/combobox/combobox.tokens.json +1 -0
  35. package/src/command-palette/command-palette.css +84 -90
  36. package/src/container/container.css +24 -24
  37. package/src/context-menu/context-menu.css +8 -8
  38. package/src/currency-field/currency-field.css +210 -88
  39. package/src/currency-field/currency-field.tokens.json +13 -0
  40. package/src/dashboard-grid/dashboard-grid.css +148 -116
  41. package/src/data-grid/data-grid.css +504 -469
  42. package/src/data-grid/data-grid.tokens.json +2 -0
  43. package/src/data-list/data-list.css +81 -70
  44. package/src/data-list/data-list.tokens.json +2 -1
  45. package/src/date-field/date-field.css +55 -52
  46. package/src/date-field/date-field.tokens.json +1 -0
  47. package/src/date-picker/date-picker.css +40 -42
  48. package/src/date-range-picker/date-range-picker.css +114 -118
  49. package/src/datetime-field/datetime-field.css +78 -80
  50. package/src/datetime-field/datetime-field.tokens.json +1 -0
  51. package/src/datetime-picker/datetime-picker.css +61 -63
  52. package/src/datetime-range-picker/datetime-range-picker.css +149 -156
  53. package/src/description-list/description-list.css +61 -64
  54. package/src/detail-panel/detail-panel.css +70 -70
  55. package/src/dialog/dialog.css +334 -153
  56. package/src/dialog/dialog.tokens.json +5 -0
  57. package/src/divider/divider.css +18 -18
  58. package/src/drawer/drawer.css +186 -209
  59. package/src/entity-picker/entity-picker.css +238 -241
  60. package/src/entity-picker/entity-picker.tokens.json +1 -0
  61. package/src/event-calendar/event-calendar.css +343 -385
  62. package/src/field/field.css +74 -78
  63. package/src/field-group/field-group.css +22 -25
  64. package/src/filter-bar/filter-bar.css +193 -209
  65. package/src/form/form.css +34 -24
  66. package/src/form/form.tokens.json +1 -0
  67. package/src/fullscreen/fullscreen.css +24 -25
  68. package/src/grid/grid.css +28 -28
  69. package/src/highlight/highlight.css +6 -6
  70. package/src/hover-card/hover-card.css +6 -6
  71. package/src/icon/icon.css +19 -15
  72. package/src/icon/icon.tokens.json +1 -0
  73. package/src/image/image.css +39 -39
  74. package/src/import-export-center/import-export-center.css +135 -156
  75. package/src/inline/inline.css +27 -27
  76. package/src/inline-message/inline-message.css +52 -28
  77. package/src/inline-message/inline-message.tokens.json +4 -0
  78. package/src/kbd/kbd.css +30 -26
  79. package/src/link/link.css +15 -15
  80. package/src/list/list.css +44 -17
  81. package/src/list/list.tokens.json +4 -0
  82. package/src/list-item/list-item.css +80 -66
  83. package/src/list-item/list-item.tokens.json +7 -0
  84. package/src/listbox/listbox.css +56 -59
  85. package/src/loading-overlay/loading-overlay.css +75 -92
  86. package/src/markdown/markdown.css +17 -17
  87. package/src/menu/menu.css +83 -63
  88. package/src/menubar/menubar.css +13 -13
  89. package/src/message/message.css +182 -202
  90. package/src/message/message.tokens.json +5 -0
  91. package/src/message-scroller/message-scroller.css +41 -42
  92. package/src/multi-select/multi-select.css +152 -145
  93. package/src/multi-select/multi-select.tokens.json +1 -0
  94. package/src/navigation-menu/navigation-menu.css +167 -188
  95. package/src/notification-center/notification-center.css +140 -148
  96. package/src/notification-center/notification-center.tokens.json +3 -0
  97. package/src/number-field/number-field.css +84 -83
  98. package/src/number-field/number-field.tokens.json +1 -0
  99. package/src/otp-input/otp-input.css +67 -57
  100. package/src/otp-input/otp-input.tokens.json +1 -0
  101. package/src/page/page.css +23 -23
  102. package/src/page-header/page-header.css +268 -281
  103. package/src/page-header/page-header.tokens.json +1 -0
  104. package/src/pagination/pagination.css +68 -72
  105. package/src/popover/popover.css +40 -49
  106. package/src/progress-indicator/progress-indicator.css +177 -120
  107. package/src/progress-indicator/progress-indicator.tokens.json +1 -1
  108. package/src/prompt-composer/prompt-composer.css +221 -102
  109. package/src/prompt-composer/prompt-composer.tokens.json +15 -0
  110. package/src/prose/prose.css +71 -75
  111. package/src/radio-group/radio-group.css +98 -103
  112. package/src/rating/rating.css +136 -132
  113. package/src/rating/rating.tokens.json +1 -0
  114. package/src/result-state/result-state.css +74 -77
  115. package/src/runtime-properties.mjs +2 -0
  116. package/src/saved-views/saved-views.css +41 -47
  117. package/src/scroll-area/scroll-area.css +39 -32
  118. package/src/section/section.css +161 -41
  119. package/src/section/section.tokens.json +7 -2
  120. package/src/segmented-control/segmented-control.css +254 -97
  121. package/src/segmented-control/segmented-control.tokens.json +15 -11
  122. package/src/select/select.css +118 -117
  123. package/src/select/select.tokens.json +1 -0
  124. package/src/side-navigation/side-navigation.css +179 -182
  125. package/src/side-navigation/side-navigation.tokens.json +1 -0
  126. package/src/skeleton/skeleton.css +47 -48
  127. package/src/slider/slider.css +86 -88
  128. package/src/sparkline/sparkline.css +62 -40
  129. package/src/sparkline/sparkline.tokens.json +2 -0
  130. package/src/spinner/spinner.css +39 -182
  131. package/src/spinner/spinner.tokens.json +0 -2
  132. package/src/split-button/split-button.css +30 -31
  133. package/src/split-button/split-button.tokens.json +1 -0
  134. package/src/splitter/splitter.css +35 -35
  135. package/src/stack/stack.css +24 -24
  136. package/src/stat-card/stat-card.css +341 -224
  137. package/src/stat-card/stat-card.tokens.json +3 -0
  138. package/src/status-indicator/status-indicator.css +28 -28
  139. package/src/stepper/stepper.css +58 -62
  140. package/src/switch/switch.css +86 -92
  141. package/src/table/table.css +310 -165
  142. package/src/table/table.tokens.json +6 -0
  143. package/src/table-of-contents/table-of-contents.css +51 -54
  144. package/src/tabs/tabs.css +330 -302
  145. package/src/tabs/tabs.tokens.json +8 -5
  146. package/src/tag/tag.css +79 -71
  147. package/src/tag/tag.tokens.json +9 -0
  148. package/src/tags-input/tags-input.css +145 -82
  149. package/src/tags-input/tags-input.tokens.json +7 -1
  150. package/src/text-field/text-field.css +132 -136
  151. package/src/text-field/text-field.tokens.json +1 -0
  152. package/src/textarea/textarea.css +31 -28
  153. package/src/textarea/textarea.tokens.json +1 -0
  154. package/src/time-field/time-field.css +72 -69
  155. package/src/time-field/time-field.tokens.json +1 -0
  156. package/src/time-picker/time-picker.css +56 -58
  157. package/src/time-range-picker/time-range-picker.css +126 -133
  158. package/src/timeline/timeline.css +254 -266
  159. package/src/timeline/timeline.tokens.json +5 -0
  160. package/src/toast/toast.css +89 -90
  161. package/src/toast/toast.tokens.json +5 -0
  162. package/src/toggle/toggle.css +62 -25
  163. package/src/toggle/toggle.tokens.json +8 -0
  164. package/src/toggle-group/toggle-group.css +106 -60
  165. package/src/toggle-group/toggle-group.tokens.json +10 -0
  166. package/src/toolbar/toolbar.css +30 -35
  167. package/src/tooltip/tooltip.css +26 -26
  168. package/src/top-navigation/top-navigation.css +243 -259
  169. package/src/tour/tour.css +51 -60
  170. package/src/transfer/transfer.css +160 -164
  171. package/src/tree/tree.css +103 -111
  172. package/src/typography/typography.css +40 -36
  173. package/src/typography/typography.tokens.json +1 -0
  174. package/src/upload/upload.css +224 -224
  175. package/src/visually-hidden/visually-hidden.css +1 -1
  176. package/src/wizard/wizard.css +185 -197
package/src/tabs/tabs.css CHANGED
@@ -16,7 +16,7 @@
16
16
  * │ panel │
17
17
  * └──────────────────────────────────────────────────┘
18
18
  */
19
- [data-ui='tabs'] {
19
+ [data-ui-tabs] {
20
20
  /**
21
21
  * The control scales, read once at the root, so `size` and the three
22
22
  * densities are one decision each rather than one per rule.
@@ -47,23 +47,35 @@
47
47
  min(calc(var(--_icon-size) + 2 * var(--slotted-space-2, 0.25rem)), var(--_inner-size))
48
48
  );
49
49
  --_dismiss-overhang: calc((var(--_dismiss-size) - var(--_icon-size)) / 2);
50
- --_marker-size: var(--slotted-border-width-thick, 2px);
50
+ /**
51
+ * The marker: one bar the list draws under the selected tab, and the hover
52
+ * bar under the tab the pointer is on, in the same geometry — the tab's
53
+ * content box, a pill just above the list's edge. It is never thinner than the
54
+ * thick border width, the floor the high-contrast scheme keeps for a mark
55
+ * that carries state, and its thickness, its rounding and its inset are
56
+ * tokens of their own: tied to the thick border width, a theme could not
57
+ * thicken the marker without thickening sixty other rules.
58
+ */
59
+ --_marker-size: max(
60
+ var(--slotted-tabs-marker-size, 3px),
61
+ var(--slotted-border-width-thick, 2px)
62
+ );
63
+ --_marker-radius: var(--slotted-tabs-marker-radius, var(--slotted-radius-full, 9999px));
64
+ --_marker-inset: var(--slotted-tabs-marker-inset, var(--_padding-inline));
65
+ /**
66
+ * The gap between the bars and the list's edge: the selected marker and the
67
+ * hover bar stand this far above the track, so the line reads as a line and
68
+ * the bar as a mark on it. An inset rather than a transform, because the
69
+ * marker's `translate` is its slide between tabs.
70
+ */
71
+ --_marker-offset: var(--slotted-tabs-marker-offset, 1px);
72
+ --_track-color: var(--slotted-tabs-track-color, var(--slotted-border-subtle, ButtonBorder));
51
73
  /**
52
74
  * The length of the fade a scrolling list takes at an edge that has more
53
75
  * behind it, read once here so the five mask gradients below state a
54
76
  * length and no public property of their own.
55
77
  */
56
78
  --_fade: var(--slotted-tabs-fade-size, var(--slotted-space-6, 1rem));
57
- /**
58
- * Which way the selection travelled, resolved into a transform origin. The
59
- * marker of the tab being left collapses toward the direction of travel
60
- * and the marker of the tab being entered grows from the side the reader
61
- * came from, so the pair reads as one bar moving. Nothing is measured:
62
- * every surveyed indicator reads the active tab's box, which is why Base UI
63
- * ships `renderBeforeHydration` and Ark UI a `setIndicatorRect`.
64
- */
65
- --_marker-origin: 50%;
66
- --_marker-origin-selected: 50%;
67
79
 
68
80
  /**
69
81
  * No column gap on the grid itself: three gaps stood around two empty
@@ -83,7 +95,7 @@
83
95
  row-gap: var(--slotted-tabs-gap, var(--slotted-space-6, 1rem));
84
96
  }
85
97
 
86
- [data-ui='tabs'][data-size='sm'] {
98
+ [data-ui-tabs][data-size='sm'] {
87
99
  --_height: var(--slotted-control-height-sm, 30px);
88
100
  --_font-size: var(--slotted-control-font-size-sm, 0.8125rem);
89
101
  --_padding-inline: var(--slotted-control-padding-inline-sm, 0.625rem);
@@ -92,7 +104,7 @@
92
104
  --_inner-size: var(--slotted-control-inner-size-sm, 22px);
93
105
  }
94
106
 
95
- [data-ui='tabs'][data-size='lg'] {
107
+ [data-ui-tabs][data-size='lg'] {
96
108
  --_height: var(--slotted-control-height-lg, 40px);
97
109
  --_font-size: var(--slotted-control-font-size-lg, 1rem);
98
110
  --_padding-inline: var(--slotted-control-padding-inline-lg, 1rem);
@@ -111,7 +123,10 @@
111
123
  * the panel: the distance the row gap keeps in a horizontal family. Without
112
124
  * it the panel's first letter touched the track on the list's end edge.
113
125
  */
114
- [data-ui='tabs'][data-orientation='vertical'] {
126
+ [data-ui-tabs][data-orientation='vertical'] {
127
+ /* The inset runs along the block axis, where a tab has no padding. */
128
+ --_marker-inset: var(--slotted-tabs-marker-inset, 0px);
129
+
115
130
  column-gap: var(--slotted-tabs-gap, var(--slotted-space-6, 1rem));
116
131
  grid-template-columns: auto minmax(0, 1fr);
117
132
  grid-template-rows: auto auto;
@@ -124,7 +139,7 @@
124
139
  * which is on the border box and therefore does not scroll with the tabs —
125
140
  * a track drawn on the content would slide away with the first tab.
126
141
  */
127
- [data-ui='tabs'] > [data-part='list'] {
142
+ [data-ui-tabs] > [data-part-list] {
128
143
  align-items: stretch;
129
144
  display: flex;
130
145
  gap: var(--slotted-tabs-list-gap, var(--_list-gap));
@@ -140,6 +155,8 @@
140
155
  overflow-x: auto;
141
156
  overflow-y: hidden;
142
157
  overscroll-behavior-inline: contain;
158
+ /* The containing block of the marker, which scrolls with the tabs. */
159
+ position: relative;
143
160
  /**
144
161
  * The platform's scrollbar is the affordance until the family draws its
145
162
  * own. It is hidden only once `data-overflowing` says the paging controls
@@ -149,13 +166,23 @@
149
166
  scrollbar-width: thin;
150
167
  }
151
168
 
152
- [data-ui='tabs'][data-overflowing] > [data-part='list'] {
169
+ [data-ui-tabs][data-overflowing] > [data-part-list] {
153
170
  scrollbar-width: none;
154
171
  }
155
172
 
156
- [data-ui='tabs'][data-variant='line'][data-track='line'] > [data-part='list'] {
157
- border-block-end: var(--_track-size) solid
158
- var(--slotted-tabs-track-color, var(--slotted-border-subtle, ButtonBorder));
173
+ /**
174
+ * The track is an inset shadow on the list's own padding rather than its
175
+ * border. The list is a scroll container, which clips what it draws to its
176
+ * padding box, so a marker standing over a border was cut along it; inside
177
+ * the padding the marker lies over the line, flush with the list's edge. The
178
+ * shadow is the box's, so the line does not scroll with the tabs.
179
+ */
180
+ [data-ui-tabs][data-variant='line'][data-track='line'] > [data-part-list] {
181
+ /* How far the hover bar reaches past an item to stand on the track. */
182
+ --_track-reach: var(--_track-size);
183
+
184
+ box-shadow: inset 0 calc(-1 * var(--_track-size)) 0 var(--_track-color);
185
+ padding-block-end: var(--_track-size);
159
186
  }
160
187
 
161
188
  /**
@@ -169,39 +196,25 @@
169
196
  * variant for the same case, which is a second family's worth of paint to
170
197
  * remove one line.
171
198
  *
172
- * The marker then sits on the item's own edge rather than a track's width
173
- * below it, so it lands on the line the page already drew. Where that line is
174
- * is the page's business: the family stops at its own box.
199
+ * The marker then sits on the list's own edge, which is the items' edge, so
200
+ * it lands on the line the page already drew. Where that line is is the
201
+ * page's business: the family stops at its own box.
175
202
  */
176
- [data-ui='tabs'][data-track='none'] > :where([data-part='list']) > [data-part='item']::before,
177
- [data-ui='tabs'][data-track='none'] > :where([data-part='list']) > [data-part='item']::after {
178
- inset-block-end: 0;
179
- }
180
-
181
- [data-ui='tabs'][data-track='none'][data-orientation='vertical']
182
- > :where([data-part='list'])
183
- > [data-part='item']::before,
184
- [data-ui='tabs'][data-track='none'][data-orientation='vertical']
185
- > :where([data-part='list'])
186
- > [data-part='item']::after {
187
- inset-block-end: auto;
188
- inset-inline-end: 0;
189
- }
190
203
 
191
204
  /**
192
205
  * A column of labels reads down its own start edge. Centring them is what the
193
206
  * horizontal rule wants — a row of equal shares has a middle — and in a
194
207
  * column it produces a ragged left edge nobody can scan.
195
208
  */
196
- [data-ui='tabs'][data-orientation='vertical']
197
- > :where([data-part='list'])
198
- > :where([data-part='item'])
199
- > [data-part='tab'] {
209
+ [data-ui-tabs][data-orientation='vertical']
210
+ > :where([data-part-list])
211
+ > :where([data-part-item])
212
+ > [data-part-tab] {
200
213
  justify-content: start;
201
214
  text-align: start;
202
215
  }
203
216
 
204
- [data-ui='tabs'][data-orientation='vertical'] > [data-part='list'] {
217
+ [data-ui-tabs][data-orientation='vertical'] > [data-part-list] {
205
218
  flex-direction: column;
206
219
  grid-column: 1;
207
220
  grid-row: 1;
@@ -209,11 +222,17 @@
209
222
  overflow-y: auto;
210
223
  }
211
224
 
212
- [data-ui='tabs'][data-orientation='vertical'][data-variant='line'][data-track='line']
213
- > [data-part='list'] {
214
- border-block-end: 0;
215
- border-inline-end: var(--_track-size) solid
216
- var(--slotted-tabs-track-color, var(--slotted-border-subtle, ButtonBorder));
225
+ /* A shadow takes no logical offset, so the line's side is mirrored by hand. */
226
+ [data-ui-tabs][data-orientation='vertical'][data-variant='line'][data-track='line']
227
+ > [data-part-list] {
228
+ box-shadow: inset calc(-1 * var(--_track-size)) 0 0 var(--_track-color);
229
+ padding-block-end: 0;
230
+ padding-inline-end: var(--_track-size);
231
+ }
232
+
233
+ [data-ui-tabs][data-orientation='vertical'][data-variant='line'][data-track='line']:dir(rtl)
234
+ > [data-part-list] {
235
+ box-shadow: inset var(--_track-size) 0 0 var(--_track-color);
217
236
  }
218
237
 
219
238
  /**
@@ -225,7 +244,7 @@
225
244
  * label is what gives way, and it is the only place a horizontal label ever
226
245
  * truncates.
227
246
  */
228
- [data-ui='tabs'][data-fit='equal'] > [data-part='list'] {
247
+ [data-ui-tabs][data-fit='equal'] > [data-part-list] {
229
248
  display: grid;
230
249
  grid-auto-columns: minmax(0, 1fr);
231
250
  grid-auto-flow: column;
@@ -234,15 +253,15 @@
234
253
  }
235
254
 
236
255
  /** Equal shares are shares of the line, so each item takes the one it is given. */
237
- [data-ui='tabs'][data-fit='equal'] > :where([data-part='list']) > [data-part='item'] {
256
+ [data-ui-tabs][data-fit='equal'] > :where([data-part-list]) > [data-part-item] {
238
257
  min-inline-size: 0;
239
258
  }
240
259
 
241
- [data-ui='tabs'][data-fit='equal']
242
- > :where([data-part='list'])
243
- > :where([data-part='item'])
244
- > :where([data-part='tab'])
245
- > [data-part='label'] {
260
+ [data-ui-tabs][data-fit='equal']
261
+ > :where([data-part-list])
262
+ > :where([data-part-item])
263
+ > :where([data-part-tab])
264
+ > [data-part-label] {
246
265
  overflow: hidden;
247
266
  text-overflow: ellipsis;
248
267
  white-space: nowrap;
@@ -251,12 +270,11 @@
251
270
  /* ── One tab, and the box that holds it ───────────────────────────────── */
252
271
 
253
272
  /**
254
- * The item is presentational, and it exists for two reasons a `button`
255
- * cannot answer: a `button` may not contain a `button`, so a dismissible tab
256
- * needs a box for its second control, and the marker has to span the pair
257
- * rather than only the label.
273
+ * The item is presentational, and it exists because a `button` may not
274
+ * contain a `button`: a dismissible tab needs a box for its second control.
275
+ * It also carries the hover bar, under the tab and not the control.
258
276
  */
259
- [data-ui='tabs'] > :where([data-part='list']) > [data-part='item'] {
277
+ [data-ui-tabs] > :where([data-part-list]) > [data-part-item] {
260
278
  align-items: stretch;
261
279
  display: grid;
262
280
  grid-auto-flow: column;
@@ -270,7 +288,7 @@
270
288
  position: relative;
271
289
  }
272
290
 
273
- [data-ui='tabs'] > :where([data-part='list']) > :where([data-part='item']) > [data-part='tab'] {
291
+ [data-ui-tabs] > :where([data-part-list]) > :where([data-part-item]) > [data-part-tab] {
274
292
  align-items: center;
275
293
  appearance: none;
276
294
  background-color: transparent;
@@ -302,10 +320,10 @@
302
320
  * inset there: the control carries it instead, measured from the mark rather
303
321
  * than from the box.
304
322
  */
305
- [data-ui='tabs']
306
- > :where([data-part='list'])
307
- > [data-part='item']:has(> [data-part='dismiss'])
308
- > [data-part='tab'] {
323
+ [data-ui-tabs]
324
+ > :where([data-part-list])
325
+ > [data-part-item]:has(> [data-part-dismiss])
326
+ > [data-part-tab] {
309
327
  padding-inline-end: 0;
310
328
  }
311
329
 
@@ -315,11 +333,11 @@
315
333
  * needs something to be aligned against, and a label in another script needs
316
334
  * to read its own way inside a page that reads the other.
317
335
  */
318
- [data-ui='tabs']
319
- > :where([data-part='list'])
320
- > :where([data-part='item'])
321
- > :where([data-part='tab'])
322
- > [data-part='label'] {
336
+ [data-ui-tabs]
337
+ > :where([data-part-list])
338
+ > :where([data-part-item])
339
+ > :where([data-part-tab])
340
+ > [data-part-label] {
323
341
  min-inline-size: 0;
324
342
  unicode-bidi: plaintext;
325
343
  }
@@ -331,11 +349,11 @@
331
349
  * gives way. An icon box reads `--slotted-icon-size` from the slot, so it
332
350
  * takes the tab's icon step.
333
351
  */
334
- [data-ui='tabs']
335
- > :where([data-part='list'])
336
- > :where([data-part='item'])
337
- > :where([data-part='tab'])
338
- > :is([data-part='start'], [data-part='end']) {
352
+ [data-ui-tabs]
353
+ > :where([data-part-list])
354
+ > :where([data-part-item])
355
+ > :where([data-part-tab])
356
+ > :is([data-part-start], [data-part-end]) {
339
357
  --slotted-icon-size: var(--_icon-size);
340
358
 
341
359
  align-items: center;
@@ -354,10 +372,10 @@
354
372
  * meeting a line that runs under all of them. What that variant says on
355
373
  * hover is where the mark would go, and it says it on the item, below.
356
374
  */
357
- [data-ui='tabs']
358
- > :where([data-part='list'])
359
- > :where([data-part='item'])
360
- > [data-part='tab']:not(:disabled):not([aria-selected='true']):hover {
375
+ [data-ui-tabs]
376
+ > :where([data-part-list])
377
+ > :where([data-part-item])
378
+ > [data-part-tab]:not(:disabled):not([aria-selected='true']):hover {
361
379
  color: var(--slotted-tabs-hover-color, var(--slotted-text, CanvasText));
362
380
  }
363
381
 
@@ -367,20 +385,20 @@
367
385
  * and goes one step further on press is what a segmented control does —
368
386
  * the fill has a box to belong to and no line to meet.
369
387
  */
370
- [data-ui='tabs'][data-variant='contained']
371
- > :where([data-part='list'])
372
- > :where([data-part='item'])
373
- > [data-part='tab']:not(:disabled):not([aria-selected='true']):hover {
388
+ [data-ui-tabs][data-variant='contained']
389
+ > :where([data-part-list])
390
+ > :where([data-part-item])
391
+ > [data-part-tab]:not(:disabled):not([aria-selected='true']):hover {
374
392
  background-color: var(
375
393
  --slotted-tabs-hover-background,
376
394
  var(--slotted-tone-secondary-subtle-hover)
377
395
  );
378
396
  }
379
397
 
380
- [data-ui='tabs'][data-variant='contained']
381
- > :where([data-part='list'])
382
- > :where([data-part='item'])
383
- > [data-part='tab']:not(:disabled):active {
398
+ [data-ui-tabs][data-variant='contained']
399
+ > :where([data-part-list])
400
+ > :where([data-part-item])
401
+ > [data-part-tab]:not(:disabled):active {
384
402
  background-color: var(
385
403
  --slotted-tabs-active-background,
386
404
  var(--slotted-tone-secondary-subtle-active)
@@ -398,10 +416,10 @@
398
416
  * focus became one blue shape that said neither of the two things — the
399
417
  * capture is what showed it.
400
418
  */
401
- [data-ui='tabs']
402
- > :where([data-part='list'])
403
- > :where([data-part='item'])
404
- > [data-part='tab']:focus-visible {
419
+ [data-ui-tabs]
420
+ > :where([data-part-list])
421
+ > :where([data-part-item])
422
+ > [data-part-tab]:focus-visible {
405
423
  outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
406
424
  outline-offset: calc(-1 * (var(--slotted-focus-ring-offset, 2px) + var(--_marker-size)));
407
425
  }
@@ -412,25 +430,19 @@
412
430
  * and nothing about it reaches the edge the scroller clips at — and an inset
413
431
  * ring on a twenty-four pixel box would be drawn through the mark.
414
432
  */
415
- [data-ui='tabs']
416
- > :where([data-part='list'])
417
- > :where([data-part='item'])
418
- > [data-part='dismiss']:focus-visible {
433
+ [data-ui-tabs]
434
+ > :where([data-part-list])
435
+ > :where([data-part-item])
436
+ > [data-part-dismiss]:focus-visible {
419
437
  outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
420
438
  outline-offset: var(--slotted-focus-ring-offset, 2px);
421
439
  }
422
440
 
423
- [data-ui='tabs']
424
- > :where([data-part='list'])
425
- > [data-part='item'][data-selected]
426
- > [data-part='tab'] {
441
+ [data-ui-tabs] > :where([data-part-list]) > [data-part-item][data-selected] > [data-part-tab] {
427
442
  color: var(--slotted-tabs-selected-color, var(--slotted-tone-accent-text));
428
443
  }
429
444
 
430
- [data-ui='tabs']
431
- > :where([data-part='list'])
432
- > :where([data-part='item'])
433
- > [data-part='tab']:disabled {
445
+ [data-ui-tabs] > :where([data-part-list]) > :where([data-part-item]) > [data-part-tab]:disabled {
434
446
  color: var(--slotted-disabled-foreground, GrayText);
435
447
  cursor: not-allowed;
436
448
  }
@@ -438,132 +450,153 @@
438
450
  /* ── The marker ───────────────────────────────────────────────────────── */
439
451
 
440
452
  /**
441
- * Drawn on the item, on the edge the list runs along, and present on every
442
- * item rather than only on the selected one: a mark that appears has nothing
443
- * to transition from. It is scaled to nothing across the axis it marks, and
444
- * the transform origin is what the direction of travel decides.
445
- *
446
- * It is pulled over the track by exactly the track's own width, so the two
447
- * lines are one line rather than a hairline with a thicker line beside it.
453
+ * One bar, drawn by the list rather than by each item, that slides from the
454
+ * tab being left to the tab being entered: a mark per item can only appear
455
+ * or scale from an edge, and one mark moving is what says the selection
456
+ * moved. The binding creates it with `createIndicator` from
457
+ * `@slotted/core/measure`, which writes the selected tab's start and length
458
+ * in the list's scroll coordinates; everything else is decided here.
448
459
  *
449
- * There are two of them in the same place. `::after` is the mark, in the
450
- * accent, and the one that travels. `::before` is the hover, in a neutral
451
- * a step darker than the track: the same bar, under the tab the pointer is
452
- * on, saying where the mark would go. It fades rather than grows — a bar
453
- * that slid in from one side on every pass of the pointer would be the
454
- * travelling animation with nothing travelling — and it is never on the
455
- * selected item, where the mark already is.
456
- */
457
- [data-ui='tabs'] > :where([data-part='list']) > [data-part='item']::before,
458
- [data-ui='tabs'] > :where([data-part='list']) > [data-part='item']::after {
459
- border-start-end-radius: var(--slotted-radius-xs, 2px);
460
- border-start-start-radius: var(--slotted-radius-xs, 2px);
460
+ * It spans the tab's content box — the icon and the label — through
461
+ * `--slotted-tabs-marker-inset`, which defaults to the tab's own inline
462
+ * padding, and never the closing control: a tab followed by one gives up its
463
+ * end padding, so the end inset is nought there. Below the width of a short
464
+ * label it keeps a minimum length, centred on the content. It stands
465
+ * `--slotted-tabs-marker-offset` above the list's edge, over the track, and the axes are physical in this one rule
466
+ * because the measurement is: the position is from the list's left edge.
467
+ * Position and length are both layout properties, so one thread advances
468
+ * both edges in the same frame: a composited `translate` beside a
469
+ * main-thread `inline-size` drifted apart while the panel rendered, and the
470
+ * bar grew and shrank on its way between tabs of unequal widths.
471
+ */
472
+ [data-ui-tabs] > :where([data-part-list]) > [data-part-marker] {
473
+ --_start-inset: var(--_marker-inset);
474
+ --_end-inset: var(--_marker-inset);
475
+ --_left-inset: var(--_start-inset);
476
+ --_span: calc(var(--_indicator-length, 0px) - var(--_start-inset) - var(--_end-inset));
477
+ --_length: max(var(--slotted-space-6, 1rem), var(--_span));
478
+
479
+ background-color: var(--slotted-tabs-marker-color, var(--slotted-tone-accent-solid));
461
480
  block-size: var(--_marker-size);
462
- content: '';
463
- inset-block-end: calc(-1 * var(--_track-size));
464
- inset-inline: 0;
465
- opacity: 0;
481
+ border-radius: var(--_marker-radius);
482
+ inline-size: var(--_length);
483
+ inset-block-end: calc(var(--_marker-lift, 0px) + var(--_marker-offset));
484
+ left: calc(
485
+ var(--_indicator-start, 0px) + var(--_left-inset) + (var(--_span) - var(--_length)) / 2
486
+ );
466
487
  pointer-events: none;
467
488
  position: absolute;
468
489
  }
469
490
 
470
- [data-ui='tabs'] > :where([data-part='list']) > [data-part='item']::before {
471
- /* No system colour as a last resort: unthemed, the bar disappears rather
472
- than shouts, as the mark beside it already does. */
473
- background-color: var(--slotted-tabs-hover-marker-color, var(--slotted-border-strong));
474
- transition:
475
- background-color var(--slotted-control-transition-duration)
476
- var(--slotted-control-transition-easing),
477
- opacity var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
491
+ [data-ui-tabs]:dir(rtl) > :where([data-part-list]) > [data-part-marker] {
492
+ --_left-inset: var(--_end-inset);
478
493
  }
479
494
 
480
- [data-ui='tabs'] > :where([data-part='list']) > [data-part='item']::after {
481
- background-color: var(--slotted-tabs-marker-color, var(--slotted-tone-accent-solid));
482
- transform: scale(0, 1);
483
- transform-origin: var(--_marker-origin) 50%;
484
- transition:
485
- opacity var(--slotted-control-transition-duration) var(--slotted-control-transition-easing),
486
- transform var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
495
+ [data-ui-tabs]:not([data-orientation='vertical'])
496
+ > [data-part-list]:has(> [data-part-item][data-selected] > [data-part-dismiss])
497
+ > [data-part-marker] {
498
+ --_end-inset: 0px;
487
499
  }
488
500
 
489
- [data-ui='tabs'][data-variant='line']
490
- > :where([data-part='list'])
491
- > [data-part='item']:not([data-selected]):has(
492
- > [data-part='tab']:not(:disabled):hover
493
- )::before {
494
- opacity: 1;
501
+ [data-ui-tabs] > :where([data-part-list]) > [data-part-marker][hidden] {
502
+ display: none;
495
503
  }
496
504
 
497
- /** Press takes the bar to the label's own ink: the two say one thing. */
498
- [data-ui='tabs'][data-variant='line']
499
- > :where([data-part='list'])
500
- > [data-part='item']:not([data-selected]):has(
501
- > [data-part='tab']:not(:disabled):active
502
- )::before {
503
- background-color: var(--slotted-tabs-active-marker-color, var(--slotted-text));
505
+ /**
506
+ * It slides only when the selection moves: `data-moving` arrives with a
507
+ * position whose tab changed, and leaves with a re-measurement of the same
508
+ * tab, so the first position, a font arriving and a resized list place the
509
+ * bar without motion. The slide takes the medium duration on a curve that
510
+ * starts and ends slowly, `--slotted-tabs-marker-easing`: the control
511
+ * duration on the theme's decelerating curve covered a third of the
512
+ * distance in its first frame and read as a jump. Under reduced motion it
513
+ * jumps.
514
+ */
515
+ [data-ui-tabs] > :where([data-part-list]) > [data-part-marker][data-moving] {
516
+ --_marker-easing: var(--slotted-tabs-marker-easing, cubic-bezier(0.4, 0, 0.2, 1));
517
+
518
+ transition:
519
+ left var(--slotted-duration-medium) var(--_marker-easing),
520
+ top var(--slotted-duration-medium) var(--_marker-easing),
521
+ inline-size var(--slotted-duration-medium) var(--_marker-easing),
522
+ block-size var(--slotted-duration-medium) var(--_marker-easing);
504
523
  }
505
524
 
506
- [data-ui='tabs'] > :where([data-part='list']) > [data-part='item'][data-selected]::after {
507
- opacity: 1;
508
- transform: scale(1, 1);
509
- transform-origin: var(--_marker-origin-selected) 50%;
525
+ @media (prefers-reduced-motion: reduce) {
526
+ [data-ui-tabs] > :where([data-part-list]) > [data-part-marker][data-moving] {
527
+ transition: none;
528
+ }
510
529
  }
511
530
 
512
531
  /**
513
- * Forward is toward the end of the list. The tab being left collapses toward
514
- * the end and the tab being entered grows from the start, which is one bar
515
- * travelling. `transform-origin` takes no logical keyword, so the two
516
- * percentages swap under `:dir(rtl)` — the one place in this stylesheet
517
- * where a rule is mirrored by hand.
532
+ * The hover bar: the marker's geometry under the tab the pointer is on, in a
533
+ * neutral at a reduced opacity, saying where the mark would go. It is drawn
534
+ * on the item, and it fades rather than slides — a bar that travelled on
535
+ * every pass of the pointer would be the selection's motion with nothing
536
+ * selected. It reaches past the item by the track's width to lie on it, and
537
+ * stops at the tab where a closing control follows: that control is the
538
+ * tab's inline padding on either side of the glyph.
518
539
  */
519
- [data-ui='tabs'][data-activation-direction='forward'] {
520
- --_marker-origin: 100%;
521
- --_marker-origin-selected: 0%;
540
+ [data-ui-tabs] > :where([data-part-list]) > [data-part-item]::before {
541
+ background-color: var(--slotted-tabs-hover-marker-color, var(--slotted-border-strong));
542
+ block-size: var(--_marker-size);
543
+ border-radius: var(--_marker-radius);
544
+ content: '';
545
+ inset-block-end: calc(var(--_marker-offset) - var(--_track-reach, 0px));
546
+ inset-inline: var(--_marker-inset);
547
+ min-inline-size: var(--slotted-space-6, 1rem);
548
+ opacity: 0;
549
+ pointer-events: none;
550
+ position: absolute;
551
+ transition:
552
+ background-color var(--slotted-control-transition-duration)
553
+ var(--slotted-control-transition-easing),
554
+ opacity var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
522
555
  }
523
556
 
524
- [data-ui='tabs'][data-activation-direction='backward'] {
525
- --_marker-origin: 0%;
526
- --_marker-origin-selected: 100%;
557
+ [data-ui-tabs]:not([data-orientation='vertical'])
558
+ > :where([data-part-list])
559
+ > [data-part-item]:has(> [data-part-dismiss])::before {
560
+ inset-inline-end: calc(2 * var(--_padding-inline) + var(--_icon-size));
527
561
  }
528
562
 
529
- [data-ui='tabs'][data-activation-direction='forward']:dir(rtl) {
530
- --_marker-origin: 0%;
531
- --_marker-origin-selected: 100%;
563
+ [data-ui-tabs][data-variant='line']
564
+ > :where([data-part-list])
565
+ > [data-part-item]:not([data-selected]):has(> [data-part-tab]:not(:disabled):hover)::before {
566
+ opacity: var(--slotted-tabs-hover-marker-opacity, 0.5);
532
567
  }
533
568
 
534
- [data-ui='tabs'][data-activation-direction='backward']:dir(rtl) {
535
- --_marker-origin: 100%;
536
- --_marker-origin-selected: 0%;
569
+ /** Press takes the bar to the label's own ink: the two say one thing. */
570
+ [data-ui-tabs][data-variant='line']
571
+ > :where([data-part-list])
572
+ > [data-part-item]:not([data-selected]):has(> [data-part-tab]:not(:disabled):active)::before {
573
+ background-color: var(--slotted-tabs-active-marker-color, var(--slotted-text));
537
574
  }
538
575
 
539
- /** A quarter turn: the bar stands on the list's own edge and grows in block. */
540
- [data-ui='tabs'][data-orientation='vertical']
541
- > :where([data-part='list'])
542
- > [data-part='item']::before,
543
- [data-ui='tabs'][data-orientation='vertical']
544
- > :where([data-part='list'])
545
- > [data-part='item']::after {
546
- block-size: auto;
547
- border-start-end-radius: var(--slotted-radius-xs, 2px);
548
- border-start-start-radius: 0;
549
- border-end-end-radius: var(--slotted-radius-xs, 2px);
576
+ /**
577
+ * A quarter turn: both bars stand on the list's inline-end edge and run along
578
+ * the block axis, where the inset defaults to nought because a tab has no
579
+ * block padding.
580
+ */
581
+ [data-ui-tabs][data-orientation='vertical'] > :where([data-part-list]) > [data-part-marker] {
582
+ block-size: var(--_length);
550
583
  inline-size: var(--_marker-size);
551
- inset-block: 0;
552
- inset-inline: auto calc(-1 * var(--_track-size));
584
+ inset-block: calc(
585
+ var(--_indicator-start, 0px) + var(--_start-inset) + (var(--_span) - var(--_length)) / 2
586
+ )
587
+ auto;
588
+ inset-inline: auto calc(var(--_marker-lift, 0px) + var(--_marker-offset));
553
589
  }
554
590
 
555
- [data-ui='tabs'][data-orientation='vertical']
556
- > :where([data-part='list'])
557
- > [data-part='item']::after {
558
- transform: scale(1, 0);
559
- transform-origin: 50% var(--_marker-origin);
560
- }
561
-
562
- [data-ui='tabs'][data-orientation='vertical']
563
- > :where([data-part='list'])
564
- > [data-part='item'][data-selected]::after {
565
- transform: scale(1, 1);
566
- transform-origin: 50% var(--_marker-origin-selected);
591
+ [data-ui-tabs][data-orientation='vertical']
592
+ > :where([data-part-list])
593
+ > [data-part-item]::before {
594
+ block-size: auto;
595
+ inline-size: var(--_marker-size);
596
+ inset-block: var(--_marker-inset);
597
+ inset-inline: auto calc(var(--_marker-offset) - var(--_track-reach, 0px));
598
+ min-block-size: var(--slotted-space-6, 1rem);
599
+ min-inline-size: 0;
567
600
  }
568
601
 
569
602
  /* ── Contained ────────────────────────────────────────────────────────── */
@@ -581,7 +614,10 @@
581
614
  * the first capture showed; the `line` variant keeps the full width, because
582
615
  * there the track is the edge of the panel below it.
583
616
  */
584
- [data-ui='tabs'][data-variant='contained'] > [data-part='list'] {
617
+ [data-ui-tabs][data-variant='contained'] > [data-part-list] {
618
+ /* The marker underlines the label inside the selected surface, a step above its edge. */
619
+ --_marker-lift: calc(2 * var(--slotted-space-1, 0.125rem));
620
+
585
621
  background-color: var(--slotted-tabs-contained-background, var(--slotted-surface-sunken));
586
622
  border-radius: var(--slotted-radius-md, 6px);
587
623
  justify-self: start;
@@ -589,39 +625,19 @@
589
625
  padding: var(--slotted-space-1, 0.125rem);
590
626
  }
591
627
 
592
- [data-ui='tabs'][data-variant='contained'] > :where([data-part='list']) > [data-part='item'] {
628
+ [data-ui-tabs][data-variant='contained'] > :where([data-part-list]) > [data-part-item] {
593
629
  border-radius: var(--slotted-radius-sm, 4px);
594
630
  transition: background-color var(--slotted-control-transition-duration)
595
631
  var(--slotted-control-transition-easing);
596
632
  }
597
633
 
598
- [data-ui='tabs'][data-variant='contained']
599
- > :where([data-part='list'])
600
- > [data-part='item'][data-selected] {
634
+ [data-ui-tabs][data-variant='contained']
635
+ > :where([data-part-list])
636
+ > [data-part-item][data-selected] {
601
637
  background-color: var(--slotted-tabs-contained-selected-background, var(--slotted-surface));
602
638
  box-shadow: var(--slotted-shadow-xs);
603
639
  }
604
640
 
605
- /**
606
- * Inset from the corners by the radius, so the bar underlines the label
607
- * instead of tracing the edge of the surface it sits on. Sitting on the
608
- * edge, it read as a second border of a different colour, and the capture
609
- * showed a pill with one blue side.
610
- */
611
- [data-ui='tabs'][data-variant='contained']
612
- > :where([data-part='list'])
613
- > [data-part='item']::after {
614
- inset-block-end: var(--slotted-space-1, 0.125rem);
615
- inset-inline: var(--slotted-radius-sm, 4px);
616
- }
617
-
618
- [data-ui='tabs'][data-variant='contained'][data-orientation='vertical']
619
- > :where([data-part='list'])
620
- > [data-part='item']::after {
621
- inset-block: var(--slotted-radius-sm, 4px);
622
- inset-inline: auto var(--slotted-space-1, 0.125rem);
623
- }
624
-
625
641
  /* ── The dismiss control ──────────────────────────────────────────────── */
626
642
 
627
643
  /**
@@ -631,17 +647,16 @@
631
647
  * through `aria-keyshortcuts`.
632
648
  *
633
649
  * It is aligned by its mark rather than by its box. The box overhangs the X
634
- * on every side, so a box set flush against the label leaves a hole where the
635
- * overhang is; both margins take the overhang back, which puts the mark one
636
- * inner gap from the last letter and the tab's own inset from the end of the
637
- * item. The first capture showed the other arrangement: a square the height of
638
- * the control, hard against the words, with the whole tab's padding on the
639
- * far side of it.
640
- */
641
- [data-ui='tabs']
642
- > :where([data-part='list'])
643
- > :where([data-part='item'])
644
- > [data-part='dismiss'] {
650
+ * on every side, and both margins take the overhang back, which puts the mark
651
+ * the tab's own inset from the last letter and from the end of the item. An
652
+ * inner gap before the mark left the round ground of the hover touching the
653
+ * words; the first capture showed a square the height of the control, hard
654
+ * against the words, with the whole tab's padding on the far side of it.
655
+ *
656
+ * Neutral, as the dialog's close and the paging controls: removing a tab
657
+ * closes a view and destroys nothing, so the danger tone overstated it.
658
+ */
659
+ [data-ui-tabs] > :where([data-part-list]) > :where([data-part-item]) > [data-part-dismiss] {
645
660
  --slotted-icon-size: var(--_icon-size);
646
661
 
647
662
  align-items: center;
@@ -650,7 +665,7 @@
650
665
  background-color: transparent;
651
666
  block-size: var(--_dismiss-size);
652
667
  border: 0;
653
- border-radius: var(--slotted-control-radius, 4px);
668
+ border-radius: var(--slotted-radius-full, 9999px);
654
669
  color: var(--slotted-tabs-dismiss-color, var(--slotted-text-muted, GrayText));
655
670
  cursor: pointer;
656
671
  display: inline-flex;
@@ -658,7 +673,7 @@
658
673
  inline-size: var(--_dismiss-size);
659
674
  justify-content: center;
660
675
  margin-inline-end: calc(var(--_padding-inline) - var(--_dismiss-overhang));
661
- margin-inline-start: max(0px, calc(var(--_inner-gap) - var(--_dismiss-overhang)));
676
+ margin-inline-start: calc(var(--_padding-inline) - var(--_dismiss-overhang));
662
677
  padding: 0;
663
678
  transition:
664
679
  background-color var(--slotted-control-transition-duration)
@@ -670,49 +685,46 @@
670
685
  is the one a mouse sees: a transparent box centred on the control reaches
671
686
  44 pixels, and the ground and the ring stay square. */
672
687
  @media (pointer: coarse) {
673
- [data-ui='tabs']
674
- > :where([data-part='list'])
675
- > :where([data-part='item'])
676
- > [data-part='dismiss'] {
688
+ [data-ui-tabs] > :where([data-part-list]) > :where([data-part-item]) > [data-part-dismiss] {
677
689
  position: relative;
678
690
  }
679
691
 
680
- [data-ui='tabs']
681
- > :where([data-part='list'])
682
- > :where([data-part='item'])
683
- > [data-part='dismiss']::after {
692
+ [data-ui-tabs]
693
+ > :where([data-part-list])
694
+ > :where([data-part-item])
695
+ > [data-part-dismiss]::after {
684
696
  content: '';
685
697
  inset: min(0px, calc((100% - var(--slotted-target-comfortable, 44px)) / 2));
686
698
  position: absolute;
687
699
  }
688
700
  }
689
701
 
690
- [data-ui='tabs']
691
- > :where([data-part='list'])
692
- > :where([data-part='item'])
693
- > [data-part='dismiss']:not(:disabled):hover {
702
+ [data-ui-tabs]
703
+ > :where([data-part-list])
704
+ > :where([data-part-item])
705
+ > [data-part-dismiss]:not(:disabled):hover {
694
706
  background-color: var(
695
707
  --slotted-tabs-dismiss-hover-background,
696
- var(--slotted-tone-danger-surface)
708
+ var(--slotted-tone-secondary-subtle-hover)
697
709
  );
698
- color: var(--slotted-tabs-dismiss-hover-color, var(--slotted-tone-danger-text));
710
+ color: var(--slotted-tabs-dismiss-hover-color, var(--slotted-text, CanvasText));
699
711
  }
700
712
 
701
- [data-ui='tabs']
702
- > :where([data-part='list'])
703
- > :where([data-part='item'])
704
- > [data-part='dismiss']:not(:disabled):active {
713
+ [data-ui-tabs]
714
+ > :where([data-part-list])
715
+ > :where([data-part-item])
716
+ > [data-part-dismiss]:not(:disabled):active {
705
717
  background-color: var(
706
718
  --slotted-tabs-dismiss-active-background,
707
- var(--slotted-tone-danger-border)
719
+ var(--slotted-tone-secondary-subtle-active)
708
720
  );
709
- color: var(--slotted-tabs-dismiss-active-color, var(--slotted-text-inverse));
721
+ color: var(--slotted-tabs-dismiss-active-color, var(--slotted-text, CanvasText));
710
722
  }
711
723
 
712
- [data-ui='tabs']
713
- > :where([data-part='list'])
714
- > :where([data-part='item'])
715
- > [data-part='dismiss']:disabled {
724
+ [data-ui-tabs]
725
+ > :where([data-part-list])
726
+ > :where([data-part-item])
727
+ > [data-part-dismiss]:disabled {
716
728
  color: var(--slotted-disabled-foreground, GrayText);
717
729
  cursor: not-allowed;
718
730
  }
@@ -735,7 +747,7 @@
735
747
  * list as they move, and Cloudscape's own guidance warns against extra
736
748
  * stops before a tab list.
737
749
  */
738
- [data-ui='tabs'] > [data-part='scroll'] {
750
+ [data-ui-tabs] > [data-part-scroll] {
739
751
  --slotted-icon-size: var(--_icon-size);
740
752
 
741
753
  align-items: center;
@@ -767,31 +779,30 @@
767
779
  * is read from the control itself — a paging control at its end is
768
780
  * disabled — so the family needs no second signal for it.
769
781
  */
770
- [data-ui='tabs']:has(> [data-part='scroll'][data-direction='start']:not(:disabled))
771
- > [data-part='list'] {
782
+ [data-ui-tabs]:has(> [data-part-scroll][data-direction='start']:not(:disabled))
783
+ > [data-part-list] {
772
784
  mask-image: linear-gradient(to right, transparent, black var(--_fade));
773
785
  }
774
786
 
775
- [data-ui='tabs']:has(> [data-part='scroll'][data-direction='end']:not(:disabled))
776
- > [data-part='list'] {
787
+ [data-ui-tabs]:has(> [data-part-scroll][data-direction='end']:not(:disabled)) > [data-part-list] {
777
788
  mask-image: linear-gradient(to left, transparent, black var(--_fade));
778
789
  }
779
790
 
780
791
  /* The start edge is the right one in a right-to-left document. */
781
- [data-ui='tabs']:dir(rtl):has(> [data-part='scroll'][data-direction='start']:not(:disabled))
782
- > [data-part='list'] {
792
+ [data-ui-tabs]:dir(rtl):has(> [data-part-scroll][data-direction='start']:not(:disabled))
793
+ > [data-part-list] {
783
794
  mask-image: linear-gradient(to left, transparent, black var(--_fade));
784
795
  }
785
796
 
786
- [data-ui='tabs']:dir(rtl):has(> [data-part='scroll'][data-direction='end']:not(:disabled))
787
- > [data-part='list'] {
797
+ [data-ui-tabs]:dir(rtl):has(> [data-part-scroll][data-direction='end']:not(:disabled))
798
+ > [data-part-list] {
788
799
  mask-image: linear-gradient(to right, transparent, black var(--_fade));
789
800
  }
790
801
 
791
- [data-ui='tabs']:has(> [data-part='scroll'][data-direction='start']:not(:disabled)):has(
792
- > [data-part='scroll'][data-direction='end']:not(:disabled)
802
+ [data-ui-tabs]:has(> [data-part-scroll][data-direction='start']:not(:disabled)):has(
803
+ > [data-part-scroll][data-direction='end']:not(:disabled)
793
804
  )
794
- > [data-part='list'] {
805
+ > [data-part-list] {
795
806
  mask-image: linear-gradient(
796
807
  to right,
797
808
  transparent,
@@ -805,19 +816,19 @@
805
816
  for both axes. As wide as its glyph and as tall as the row, it stood 24
806
817
  wide and 44 tall beside tabs grown to the comfortable height. */
807
818
  @media (pointer: coarse) {
808
- [data-ui='tabs'] > [data-part='scroll'] {
819
+ [data-ui-tabs] > [data-part-scroll] {
809
820
  min-block-size: max(var(--slotted-target-comfortable, 44px), var(--_height));
810
821
  min-inline-size: max(var(--slotted-target-comfortable, 44px), var(--_height));
811
822
  }
812
823
  }
813
824
 
814
- [data-ui='tabs'] > [data-part='scroll'][data-direction='start'] {
825
+ [data-ui-tabs] > [data-part-scroll][data-direction='start'] {
815
826
  grid-column: 1;
816
827
  grid-row: 1;
817
828
  margin-inline-end: var(--slotted-tabs-actions-gap, var(--slotted-space-4, 0.5rem));
818
829
  }
819
830
 
820
- [data-ui='tabs'] > [data-part='scroll'][data-direction='end'] {
831
+ [data-ui-tabs] > [data-part-scroll][data-direction='end'] {
821
832
  grid-column: 3;
822
833
  margin-inline-start: var(--slotted-tabs-actions-gap, var(--slotted-space-4, 0.5rem));
823
834
  grid-row: 1;
@@ -832,26 +843,26 @@
832
843
  * own mirror holds: the two compose, so the start control points back in
833
844
  * both directions.
834
845
  */
835
- [data-ui='tabs'] > [data-part='scroll'][data-direction='start'] > [data-ui='icon'] {
846
+ [data-ui-tabs] > [data-part-scroll][data-direction='start'] > [data-ui-icon] {
836
847
  rotate: 0.5turn;
837
848
  }
838
849
 
839
850
  /* The ground moves under the pointer and nothing else does (R2). */
840
- [data-ui='tabs'] > [data-part='scroll']:not(:disabled):hover {
851
+ [data-ui-tabs] > [data-part-scroll]:not(:disabled):hover {
841
852
  background-color: var(
842
853
  --slotted-tabs-hover-background,
843
854
  var(--slotted-tone-secondary-subtle-hover)
844
855
  );
845
856
  }
846
857
 
847
- [data-ui='tabs'] > [data-part='scroll']:not(:disabled):active {
858
+ [data-ui-tabs] > [data-part-scroll]:not(:disabled):active {
848
859
  background-color: var(
849
860
  --slotted-tabs-active-background,
850
861
  var(--slotted-tone-secondary-subtle-active)
851
862
  );
852
863
  }
853
864
 
854
- [data-ui='tabs'] > [data-part='scroll']:focus-visible {
865
+ [data-ui-tabs] > [data-part-scroll]:focus-visible {
855
866
  outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
856
867
  outline-offset: calc(-1 * var(--slotted-focus-ring-width, 2px));
857
868
  }
@@ -862,18 +873,18 @@
862
873
  * not removed — so the list never moves under the pointer that is using
863
874
  * the other one.
864
875
  */
865
- [data-ui='tabs'] > [data-part='scroll']:disabled {
876
+ [data-ui-tabs] > [data-part-scroll]:disabled {
866
877
  cursor: default;
867
878
  visibility: hidden;
868
879
  }
869
880
 
870
- [data-ui='tabs'][data-orientation='vertical'] > [data-part='scroll'] {
881
+ [data-ui-tabs][data-orientation='vertical'] > [data-part-scroll] {
871
882
  display: none;
872
883
  }
873
884
 
874
885
  /* ── Actions, and the panels ──────────────────────────────────────────── */
875
886
 
876
- [data-ui='tabs'] > [data-part='actions'] {
887
+ [data-ui-tabs] > [data-part-actions] {
877
888
  align-items: center;
878
889
  align-self: center;
879
890
  display: flex;
@@ -883,7 +894,7 @@
883
894
  min-inline-size: 0;
884
895
  }
885
896
 
886
- [data-ui='tabs'][data-orientation='vertical'] > [data-part='actions'] {
897
+ [data-ui-tabs][data-orientation='vertical'] > [data-part-actions] {
887
898
  grid-column: 1;
888
899
  grid-row: 2;
889
900
  }
@@ -902,14 +913,14 @@
902
913
  * their own element, which is one declaration against a layout that
903
914
  * otherwise breaks for every reader on a narrow screen.
904
915
  */
905
- [data-ui='tabs'] > [data-part='panel'] {
916
+ [data-ui-tabs] > [data-part-panel] {
906
917
  grid-column: 1 / -1;
907
918
  grid-row: 2;
908
919
  min-inline-size: 0;
909
920
  overflow-wrap: anywhere;
910
921
  }
911
922
 
912
- [data-ui='tabs'][data-orientation='vertical'] > [data-part='panel'] {
923
+ [data-ui-tabs][data-orientation='vertical'] > [data-part-panel] {
913
924
  grid-column: 2;
914
925
  grid-row: 1 / -1;
915
926
  }
@@ -920,7 +931,7 @@
920
931
  * than relied on. It is the attribute and not a class because a screen
921
932
  * reader, find-in-page and `:target` all already understand it.
922
933
  */
923
- [data-ui='tabs'] > [data-part='panel'][hidden] {
934
+ [data-ui-tabs] > [data-part-panel][hidden] {
924
935
  display: none;
925
936
  }
926
937
 
@@ -930,7 +941,7 @@
930
941
  * own content and has no padding of its own, so an inset ring is drawn
931
942
  * through the first line of it.
932
943
  */
933
- [data-ui='tabs'] > [data-part='panel']:focus-visible {
944
+ [data-ui-tabs] > [data-part-panel]:focus-visible {
934
945
  outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
935
946
  outline-offset: var(--slotted-focus-ring-offset, 2px);
936
947
  }
@@ -943,7 +954,7 @@
943
954
  * panel instead, which needs a clipping viewport that traps horizontal
944
955
  * scrolling and fights the list's own scroll.
945
956
  */
946
- [data-ui='tabs'] > [data-part='panel']:not([hidden]) {
957
+ [data-ui-tabs] > [data-part-panel]:not([hidden]) {
947
958
  animation: slotted-tabs-panel-in var(--slotted-duration-short) var(--slotted-easing-enter);
948
959
  }
949
960
 
@@ -961,11 +972,11 @@
961
972
  * adds is the track: a disabled family should not read as a live one with
962
973
  * grey labels.
963
974
  */
964
- [data-ui='tabs'][data-disabled][data-variant='line'][data-track='line'] > [data-part='list'] {
965
- border-color: var(--slotted-disabled-border, GrayText);
975
+ [data-ui-tabs][data-disabled] {
976
+ --_track-color: var(--slotted-disabled-border, GrayText);
966
977
  }
967
978
 
968
- [data-ui='tabs'][data-disabled][data-variant='contained'] > [data-part='list'] {
979
+ [data-ui-tabs][data-disabled][data-variant='contained'] > [data-part-list] {
969
980
  background-color: var(--slotted-disabled-background, Canvas);
970
981
  }
971
982
 
@@ -974,24 +985,41 @@
974
985
  * decoration in an unthemed page should disappear rather than shout, and a
975
986
  * marker painted `GrayText` with no theme would be the loudest thing on it.
976
987
  */
977
- [data-ui='tabs'][data-disabled]
978
- > :where([data-part='list'])
979
- > [data-part='item'][data-selected]::after {
988
+ [data-ui-tabs][data-disabled] > :where([data-part-list]) > [data-part-marker] {
980
989
  background-color: var(--slotted-disabled-border);
981
990
  }
982
991
 
983
992
  /* ── Forced colours ──────────────────────────────────────────────────── */
984
993
 
985
994
  /**
986
- * The theme maps every scheme token to a system colour, so the only rule
987
- * here is about paint the theme cannot reach: a selected tab in the
988
- * contained variant has a fill that flattens to `Canvas` along with the
989
- * track it stands in.
995
+ * The theme maps every scheme token to a system colour, so the rules here
996
+ * are about paint the theme cannot reach: the track drawn as a shadow, the
997
+ * marker's ground, and a selected tab in the contained variant, whose fill
998
+ * flattens to `Canvas` along with the track it stands in.
990
999
  */
991
1000
  @media (forced-colors: active) {
992
- [data-ui='tabs'][data-variant='contained']
993
- > :where([data-part='list'])
994
- > [data-part='item'][data-selected] {
1001
+ /* A shadow is not drawn under forced colours: the track is a border again. */
1002
+ [data-ui-tabs][data-variant='line'][data-track='line'] > [data-part-list] {
1003
+ border-block-end: var(--_track-size) solid CanvasText;
1004
+ padding-block-end: 0;
1005
+ }
1006
+
1007
+ [data-ui-tabs][data-orientation='vertical'][data-variant='line'][data-track='line']
1008
+ > [data-part-list] {
1009
+ border-block-end: 0;
1010
+ border-inline-end: var(--_track-size) solid CanvasText;
1011
+ padding-inline-end: 0;
1012
+ }
1013
+
1014
+ /* The marker's ground would flatten to Canvas with every other ground. */
1015
+ [data-ui-tabs] > :where([data-part-list]) > [data-part-marker] {
1016
+ background-color: Highlight;
1017
+ forced-color-adjust: none;
1018
+ }
1019
+
1020
+ [data-ui-tabs][data-variant='contained']
1021
+ > :where([data-part-list])
1022
+ > [data-part-item][data-selected] {
995
1023
  border: var(--slotted-border-width-thin, 1px) solid Highlight;
996
1024
  }
997
1025
  }