@xsynaptic/sonic-ui 0.24.0 → 0.24.1

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 (36) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/default/elements/readout.js +3 -2
  3. package/dist/default/elements/sonic-element.js +23 -4
  4. package/dist/default/elements/value-element.js +2 -2
  5. package/dist/default/lib/spoken-duration.js +3 -0
  6. package/dist/dev/elements/readout.js +3 -2
  7. package/dist/dev/elements/readout.js.map +1 -1
  8. package/dist/dev/elements/sonic-element.js +23 -4
  9. package/dist/dev/elements/sonic-element.js.map +1 -1
  10. package/dist/dev/elements/value-element.js +2 -2
  11. package/dist/dev/elements/value-element.js.map +1 -1
  12. package/dist/dev/lib/spoken-duration.js +3 -0
  13. package/dist/dev/lib/spoken-duration.js.map +1 -1
  14. package/dist/styles/button.css +30 -11
  15. package/dist/styles/dial.css +13 -15
  16. package/dist/styles/envelope.css +2 -2
  17. package/dist/styles/led.css +28 -13
  18. package/dist/styles/material/cap.css +6 -6
  19. package/dist/styles/material/core.css +53 -1
  20. package/dist/styles/material/glass.css +11 -1
  21. package/dist/styles/material/keycap.css +3 -3
  22. package/dist/styles/material/pane.css +8 -6
  23. package/dist/styles/material/readout.css +19 -7
  24. package/dist/styles/material/scale.css +4 -4
  25. package/dist/styles/material/value.css +12 -3
  26. package/dist/styles/meter.css +6 -6
  27. package/dist/styles/panel.css +2 -3
  28. package/dist/styles/ring.css +3 -3
  29. package/dist/styles/segmented.css +6 -6
  30. package/dist/styles/slider.css +28 -29
  31. package/dist/styles/switch.css +49 -51
  32. package/dist/styles/toggle.css +31 -37
  33. package/dist/styles/waveform.css +2 -2
  34. package/dist/styles/wavestrip.css +4 -4
  35. package/dist/styles/xy.css +10 -11
  36. package/package.json +2 -2
@@ -117,11 +117,14 @@
117
117
  --_sonic-slider-groove-hovered var(--_sonic-fade-duration) ease-out
118
118
  var(--_sonic-slider-groove-hover-delay),
119
119
  --_sonic-slider-groove-held var(--_sonic-fade-duration) ease-out;
120
+ }
120
121
 
121
122
  @media (prefers-reduced-motion: reduce) {
123
+
124
+ .sonic-slider {
122
125
  transition: none;
123
- }
124
126
  }
127
+ }
125
128
 
126
129
  :where(:not(:disabled)) > .sonic-slider:focus-visible,
127
130
  :state(dragging) > .sonic-slider {
@@ -206,11 +209,14 @@
206
209
  1,
207
210
  1
208
211
  );
212
+ }
209
213
 
210
214
  @media (prefers-reduced-motion: reduce) {
215
+
216
+ :state(springing) > .sonic-slider {
211
217
  transition: none;
212
- }
213
218
  }
219
+ }
214
220
 
215
221
  [dimmed] > .sonic-slider {
216
222
  --_sonic-slider-lit: var(--_sonic-lit-off);
@@ -269,8 +275,9 @@
269
275
 
270
276
  .sonic-slider-scale {
271
277
  font-size: calc(var(--_sonic-slider-size) * var(--_sonic-slider-scale-font-ratio));
278
+ }
272
279
 
273
- & > * {
280
+ .sonic-slider-scale > * {
274
281
  --_sonic-slider-scale-along: calc(
275
282
  var(--_sonic-slider-cap) / 2 + var(--_sonic-scale-at, 0) * var(--_sonic-slider-travel)
276
283
  );
@@ -280,23 +287,19 @@
280
287
  translate: -50% 0;
281
288
  }
282
289
 
283
- & > .sonic-scale-tick {
290
+ .sonic-slider-scale > .sonic-scale-tick {
284
291
  inline-size: var(--_sonic-unit);
285
292
  block-size: calc(var(--_sonic-slider-scale-band) * 0.4);
286
293
  }
287
- }
288
-
289
- [orientation='vertical'] > .sonic-slider > .sonic-slider-scale {
290
- & > * {
294
+ :is([orientation='vertical'] > .sonic-slider > .sonic-slider-scale) > * {
291
295
  inset: auto var(--_sonic-slider-scale-edge) var(--_sonic-slider-scale-along) auto;
292
296
  translate: 0 50%;
293
297
  }
294
298
 
295
- & > .sonic-scale-tick {
299
+ :is([orientation='vertical'] > .sonic-slider > .sonic-slider-scale) > .sonic-scale-tick {
296
300
  inline-size: calc(var(--_sonic-slider-scale-band) * 0.4);
297
301
  block-size: var(--_sonic-unit);
298
302
  }
299
- }
300
303
 
301
304
  .sonic-slider-groove {
302
305
  --_sonic-slider-lit-to: var(--_sonic-slider-played, var(--_sonic-slider-value, 0));
@@ -314,12 +317,13 @@
314
317
  transparent
315
318
  calc(
316
319
  var(--_sonic-slider-lit-low) * var(--_sonic-slider-travel) +
317
- var(--_sonic-slider-groove-end) * sign(var(--_sonic-slider-lit-low))
320
+ var(--_sonic-slider-groove-end) * clamp(0, var(--_sonic-slider-lit-low) * 100000, 1)
318
321
  ),
319
322
  var(--_sonic-slider-lit) 0
320
323
  calc(
321
324
  var(--_sonic-slider-lit-high) * var(--_sonic-slider-travel) +
322
- var(--_sonic-slider-groove-end) * (2 - sign(1 - var(--_sonic-slider-lit-high)))
325
+ var(--_sonic-slider-groove-end) *
326
+ (2 - clamp(0, (1 - var(--_sonic-slider-lit-high)) * 100000, 1))
323
327
  ),
324
328
  transparent 0
325
329
  ),
@@ -401,41 +405,37 @@
401
405
 
402
406
  display: block;
403
407
  background: color-mix(in oklab, var(--_sonic-slider-modulation) 50%, transparent);
408
+ }
404
409
 
405
- &::before,
406
- &::after {
410
+ :is(:state(modulated) > .sonic-slider > .sonic-slider-modulation)::before,:is(:state(modulated) > .sonic-slider > .sonic-slider-modulation)::after {
407
411
  position: absolute;
408
412
  content: '';
409
413
  }
410
414
 
411
- &::before {
415
+ :is(:state(modulated) > .sonic-slider > .sonic-slider-modulation)::before {
412
416
  inset: 0 auto 0 var(--_sonic-slider-live-start);
413
417
  inline-size: var(--_sonic-slider-live-length);
414
418
  background: var(--_sonic-slider-modulation);
415
419
  border-radius: inherit;
416
420
  }
417
421
 
418
- &::after {
422
+ :is(:state(modulated) > .sonic-slider > .sonic-slider-modulation)::after {
419
423
  inset: var(--_sonic-slider-tick-overhang) auto var(--_sonic-slider-tick-overhang)
420
424
  var(--_sonic-slider-tick-start);
421
425
  inline-size: var(--_sonic-unit);
422
426
  background: var(--_sonic-slider-modulation-tick);
423
427
  }
424
- }
425
-
426
- :where([orientation='vertical']):state(modulated) > .sonic-slider > .sonic-slider-modulation {
427
- &::before {
428
+ :is(:where([orientation='vertical']):state(modulated) > .sonic-slider > .sonic-slider-modulation)::before {
428
429
  inset: auto 0 var(--_sonic-slider-live-start);
429
430
  inline-size: auto;
430
431
  block-size: var(--_sonic-slider-live-length);
431
432
  }
432
433
 
433
- &::after {
434
+ :is(:where([orientation='vertical']):state(modulated) > .sonic-slider > .sonic-slider-modulation)::after {
434
435
  inset: auto var(--_sonic-slider-tick-overhang) var(--_sonic-slider-tick-start);
435
436
  inline-size: auto;
436
437
  block-size: var(--_sonic-unit);
437
438
  }
438
- }
439
439
 
440
440
  .sonic-slider-cap {
441
441
  --_sonic-slider-indicator-width: calc(
@@ -464,21 +464,21 @@
464
464
  var(--_sonic-rim),
465
465
  var(--_sonic-focus-shadow);
466
466
  translate: var(--_sonic-slider-offset) 0;
467
+ }
467
468
 
468
- &::before,
469
- &::after {
469
+ .sonic-slider-cap::before,.sonic-slider-cap::after {
470
470
  position: absolute;
471
471
  content: '';
472
472
  }
473
473
 
474
- &::before {
474
+ .sonic-slider-cap::before {
475
475
  inset: var(--_sonic-slider-bevel);
476
476
  background: var(--_sonic-face);
477
477
  border-radius: max(0px, var(--_sonic-slider-corner) - var(--_sonic-slider-bevel));
478
478
  box-shadow: var(--_sonic-face-shadow);
479
479
  }
480
480
 
481
- &::after {
481
+ .sonic-slider-cap::after {
482
482
  inset: var(--_sonic-slider-indicator-inset)
483
483
  calc(50% - var(--_sonic-slider-indicator-width) / 2);
484
484
  background: var(--_sonic-slider-indicator);
@@ -486,19 +486,18 @@
486
486
  box-shadow: inset 0 0 calc(0.75 * var(--_sonic-unit))
487
487
  rgb(from var(--_sonic-shade) r g b / calc(0.55 * var(--_sonic-relief)));
488
488
  }
489
- }
490
489
 
491
490
  [orientation='vertical'] > .sonic-slider > .sonic-slider-cap {
492
491
  inset: auto 0 0 var(--_sonic-slider-scale-band);
493
492
  inline-size: auto;
494
493
  block-size: var(--_sonic-slider-cap);
495
494
  translate: 0 calc(-1 * var(--_sonic-slider-offset));
495
+ }
496
496
 
497
- &::after {
497
+ :is([orientation='vertical'] > .sonic-slider > .sonic-slider-cap)::after {
498
498
  inset: calc(50% - var(--_sonic-slider-indicator-width) / 2)
499
499
  var(--_sonic-slider-indicator-inset);
500
500
  }
501
- }
502
501
 
503
502
  :disabled > .sonic-slider > .sonic-slider-cap::after {
504
503
  background: var(--_sonic-ink-disabled);
@@ -62,15 +62,18 @@
62
62
  line-height: 1;
63
63
  user-select: none;
64
64
  transition: --_sonic-switch-at 90ms cubic-bezier(0.4, 0, 0.2, 1);
65
+ }
65
66
 
66
67
  @media (prefers-reduced-motion: reduce) {
68
+
69
+ .sonic-switch {
67
70
  transition: none;
71
+ }
68
72
  }
69
73
 
70
- & > * {
74
+ .sonic-switch > * {
71
75
  grid-area: 1 / 1;
72
76
  }
73
- }
74
77
 
75
78
  [orientation='horizontal'] > .sonic-switch {
76
79
  --_sonic-switch-along-x: 1;
@@ -99,20 +102,20 @@
99
102
  cursor: pointer;
100
103
  background: transparent;
101
104
  border: 0;
105
+ }
102
106
 
103
- &:disabled {
107
+ .sonic-switch-position:disabled {
104
108
  cursor: default;
105
109
  }
106
110
 
107
- &:focus-visible {
111
+ .sonic-switch-position:focus-visible {
108
112
  outline: var(--sonic-focus-outline, 2px solid transparent);
109
113
  outline-offset: var(--sonic-focus-outline-offset, -2px);
110
114
  }
111
115
 
112
- &:has([data-sonic-momentary]) {
116
+ .sonic-switch-position:has([data-sonic-momentary]) {
113
117
  touch-action: none;
114
118
  }
115
- }
116
119
 
117
120
  .sonic-switch[data-sonic-position-count] > .sonic-switch-position::after {
118
121
  inset-block: 0;
@@ -128,71 +131,68 @@
128
131
  .sonic-switch-label {
129
132
  padding: calc(var(--_sonic-switch-size) * 0.12);
130
133
  white-space: nowrap;
134
+ }
131
135
 
132
- & svg {
136
+ .sonic-switch-label svg {
133
137
  display: block;
134
138
  inline-size: 1em;
135
139
  block-size: 1em;
136
140
  }
137
- }
138
141
 
139
142
  .sonic-switch-position:disabled > .sonic-switch-label {
140
143
  color: var(--sonic-ink-disabled, color-mix(in oklab, currentcolor 30%, transparent));
141
144
  }
142
-
143
- .sonic-switch[data-sonic-position-count] {
144
- & > :is(.sonic-switch-bushing, .sonic-switch-bat) {
145
+ .sonic-switch[data-sonic-position-count] > :is(.sonic-switch-bushing,.sonic-switch-bat) {
145
146
  grid-area: 2 / 1 / -2 / 2;
146
147
  }
147
148
 
148
- & > .sonic-switch-position {
149
+ .sonic-switch[data-sonic-position-count] > .sonic-switch-position {
149
150
  grid-template: subgrid / subgrid;
150
151
  }
151
- }
152
152
 
153
153
  .sonic-switch[data-sonic-position-count='2'] {
154
154
  grid-template:
155
155
  auto repeat(2, calc(var(--_sonic-switch-size) / 2)) auto /
156
156
  minmax(var(--_sonic-switch-size), auto);
157
+ }
157
158
 
158
- & > .sonic-switch-position {
159
+ .sonic-switch[data-sonic-position-count='2'] > .sonic-switch-position {
159
160
  grid-area: 1 / 1 / 3 / 2;
161
+ }
160
162
 
161
- &:last-child {
163
+ :is(.sonic-switch[data-sonic-position-count='2'] > .sonic-switch-position):last-child {
162
164
  grid-area: 3 / 1 / 5 / 2;
165
+ }
163
166
 
164
- & > .sonic-switch-label {
167
+ :is(.sonic-switch[data-sonic-position-count='2'] > .sonic-switch-position):last-child > .sonic-switch-label {
165
168
  grid-row: 2;
166
169
  }
167
- }
168
- }
169
- }
170
170
 
171
171
  .sonic-switch[data-sonic-position-count='3'] {
172
172
  grid-template:
173
173
  auto repeat(3, calc(var(--_sonic-switch-size) / 3)) auto /
174
174
  minmax(var(--_sonic-switch-size), auto) auto;
175
+ }
175
176
 
176
- & > .sonic-switch-position {
177
+ .sonic-switch[data-sonic-position-count='3'] > .sonic-switch-position {
177
178
  grid-area: 1 / 1 / 3 / 2;
179
+ }
178
180
 
179
- &:last-child {
181
+ :is(.sonic-switch[data-sonic-position-count='3'] > .sonic-switch-position):last-child {
180
182
  grid-area: 4 / 1 / 6 / 2;
183
+ }
181
184
 
182
- & > .sonic-switch-label {
185
+ :is(.sonic-switch[data-sonic-position-count='3'] > .sonic-switch-position):last-child > .sonic-switch-label {
183
186
  grid-row: 2;
184
187
  }
185
- }
186
188
 
187
- &:nth-child(2 of .sonic-switch-position) {
189
+ :is(.sonic-switch[data-sonic-position-count='3'] > .sonic-switch-position):nth-child(2 of .sonic-switch-position) {
188
190
  grid-area: 3 / 1 / 4 / 3;
191
+ }
189
192
 
190
- & > .sonic-switch-label {
193
+ :is(.sonic-switch[data-sonic-position-count='3'] > .sonic-switch-position):nth-child(2 of .sonic-switch-position) > .sonic-switch-label {
191
194
  grid-column: 2;
192
195
  }
193
- }
194
- }
195
- }
196
196
 
197
197
  [orientation='horizontal']
198
198
  > .sonic-switch[data-sonic-position-count]
@@ -204,45 +204,45 @@
204
204
  grid-template:
205
205
  minmax(var(--_sonic-switch-size), auto) /
206
206
  auto repeat(2, calc(var(--_sonic-switch-size) / 2)) auto;
207
+ }
207
208
 
208
- & > .sonic-switch-position {
209
+ :is([orientation='horizontal'] > .sonic-switch[data-sonic-position-count='2']) > .sonic-switch-position {
209
210
  grid-area: 1 / 1 / 2 / 3;
211
+ }
210
212
 
211
- &:last-child {
213
+ :is(:is([orientation='horizontal'] > .sonic-switch[data-sonic-position-count='2']) > .sonic-switch-position):last-child {
212
214
  grid-area: 1 / 3 / 2 / 5;
215
+ }
213
216
 
214
- & > .sonic-switch-label {
217
+ :is(:is([orientation='horizontal'] > .sonic-switch[data-sonic-position-count='2']) > .sonic-switch-position):last-child > .sonic-switch-label {
215
218
  grid-area: 1 / 2;
216
219
  }
217
- }
218
- }
219
- }
220
220
 
221
221
  [orientation='horizontal'] > .sonic-switch[data-sonic-position-count='3'] {
222
222
  grid-template:
223
223
  minmax(var(--_sonic-switch-size), auto) auto /
224
224
  auto repeat(3, calc(var(--_sonic-switch-size) / 3)) auto;
225
+ }
225
226
 
226
- & > .sonic-switch-position {
227
+ :is([orientation='horizontal'] > .sonic-switch[data-sonic-position-count='3']) > .sonic-switch-position {
227
228
  grid-area: 1 / 1 / 2 / 3;
229
+ }
228
230
 
229
- &:last-child {
231
+ :is(:is([orientation='horizontal'] > .sonic-switch[data-sonic-position-count='3']) > .sonic-switch-position):last-child {
230
232
  grid-area: 1 / 4 / 2 / 6;
233
+ }
231
234
 
232
- & > .sonic-switch-label {
235
+ :is(:is([orientation='horizontal'] > .sonic-switch[data-sonic-position-count='3']) > .sonic-switch-position):last-child > .sonic-switch-label {
233
236
  grid-area: 1 / 2;
234
237
  }
235
- }
236
238
 
237
- &:nth-child(2 of .sonic-switch-position) {
239
+ :is(:is([orientation='horizontal'] > .sonic-switch[data-sonic-position-count='3']) > .sonic-switch-position):nth-child(2 of .sonic-switch-position) {
238
240
  grid-area: 1 / 3 / 3 / 4;
241
+ }
239
242
 
240
- & > .sonic-switch-label {
243
+ :is(:is([orientation='horizontal'] > .sonic-switch[data-sonic-position-count='3']) > .sonic-switch-position):nth-child(2 of .sonic-switch-position) > .sonic-switch-label {
241
244
  grid-area: 2 / 1;
242
245
  }
243
- }
244
- }
245
- }
246
246
 
247
247
  .sonic-switch-bushing {
248
248
  --_sonic-switch-bushing-shade: color-mix(
@@ -325,9 +325,9 @@
325
325
  calc((1 + var(--_sonic-switch-lean)) * var(--_sonic-cast-y)) calc(1.5 * var(--_sonic-unit))
326
326
  var(--_sonic-drop-shade)
327
327
  );
328
+ }
328
329
 
329
- &::before,
330
- &::after {
330
+ .sonic-switch-bat::before,.sonic-switch-bat::after {
331
331
  position: absolute;
332
332
  inset: 0;
333
333
  margin: auto;
@@ -338,7 +338,7 @@
338
338
  box-shadow: 0 0 0 var(--_sonic-switch-outline) var(--_sonic-switch-rim);
339
339
  }
340
340
 
341
- &::before {
341
+ .sonic-switch-bat::before {
342
342
  --_sonic-switch-shaft-top: calc(
343
343
  var(--_sonic-switch-pivot) + var(--_sonic-switch-along-y) *
344
344
  min(0px, var(--_sonic-switch-throw))
@@ -362,7 +362,7 @@
362
362
  calc(-1 * var(--_sonic-switch-shaft-top));
363
363
  }
364
364
 
365
- &::after {
365
+ .sonic-switch-bat::after {
366
366
  inline-size: var(--_sonic-switch-ball);
367
367
  block-size: var(--_sonic-switch-ball);
368
368
  background-position: calc((var(--_sonic-switch-ball) - var(--_sonic-switch-size)) / 2)
@@ -375,7 +375,6 @@
375
375
  translate: calc(var(--_sonic-switch-along-x) * var(--_sonic-switch-throw))
376
376
  calc(var(--_sonic-switch-along-y) * var(--_sonic-switch-throw));
377
377
  }
378
- }
379
378
 
380
379
  .sonic-switch:has(> .sonic-switch-position:focus-visible) {
381
380
  --_sonic-focus-shadow: var(--_sonic-focus-glow);
@@ -414,13 +413,12 @@
414
413
 
415
414
  .sonic-switch-bat {
416
415
  filter: none;
416
+ }
417
417
 
418
- &::before,
419
- &::after {
418
+ .sonic-switch-bat::before,.sonic-switch-bat::after {
420
419
  background: var(--_sonic-switch-metal);
421
420
  box-shadow: none;
422
421
  }
423
- }
424
422
 
425
423
  .sonic-switch-position:focus-visible {
426
424
  outline-offset: 2px;
@@ -222,8 +222,9 @@
222
222
  transition:
223
223
  scale var(--_sonic-press-duration) cubic-bezier(0.4, 0, 0.2, 1),
224
224
  box-shadow var(--_sonic-press-duration) cubic-bezier(0.4, 0, 0.2, 1);
225
+ }
225
226
 
226
- & > .sonic-led {
227
+ .sonic-toggle-cap > .sonic-led {
227
228
  --_sonic-led-size: var(
228
229
  --sonic-led-size,
229
230
  calc(var(--_sonic-toggle-size) * var(--_sonic-toggle-led-ratio))
@@ -233,10 +234,9 @@
233
234
  box-shadow: inset 0 0 0 max(1px, 0.1 * var(--_sonic-led-size)) var(--_sonic-toggle-led-ring);
234
235
  }
235
236
 
236
- & > * {
237
+ .sonic-toggle-cap > * {
237
238
  color: var(--_sonic-toggle-legend);
238
239
  }
239
- }
240
240
 
241
241
  .sonic-toggle-position {
242
242
  position: relative;
@@ -313,11 +313,11 @@
313
313
  translate: calc(var(--_sonic-toggle-along-x) * var(--_sonic-toggle-ride))
314
314
  calc(var(--_sonic-toggle-along-y) * var(--_sonic-toggle-ride) + var(--_sonic-toggle-sink));
315
315
  transition: opacity var(--_sonic-fade-duration) ease-out;
316
+ }
316
317
 
317
- & > * {
318
+ .sonic-toggle-legend > * {
318
319
  filter: var(--_sonic-engraving);
319
320
  }
320
- }
321
321
 
322
322
  :is(.sonic-toggle-cap, .sonic-toggle-legend) > svg {
323
323
  display: block;
@@ -331,25 +331,23 @@
331
331
 
332
332
  .sonic-toggle-position[aria-checked='true']:has([data-sonic-lit]) > .sonic-toggle-legend {
333
333
  color: var(--_sonic-toggle-legend-lit);
334
+ }
334
335
 
335
- & > * {
336
+ :is(.sonic-toggle-position[aria-checked='true']:has([data-sonic-lit]) > .sonic-toggle-legend) > * {
336
337
  filter: var(--_sonic-engraving) var(--_sonic-legend-glow);
337
338
  }
338
- }
339
-
340
- [legends='outside'] > .sonic-toggle[data-sonic-position-count] {
341
- & > :is(.sonic-toggle-well, .sonic-toggle-cap) {
339
+ :is([legends='outside'] > .sonic-toggle[data-sonic-position-count]) > :is(.sonic-toggle-well,.sonic-toggle-cap) {
342
340
  grid-area: 1 / 2 / 2 / -2;
343
341
  }
344
342
 
345
- & > .sonic-toggle-position {
343
+ :is([legends='outside'] > .sonic-toggle[data-sonic-position-count]) > .sonic-toggle-position {
346
344
  display: grid;
347
345
  grid-area: 1 / 1 / 2 / 3;
348
346
  grid-template: subgrid / subgrid;
349
347
  place-items: center;
350
348
  }
351
349
 
352
- & > .sonic-toggle-position > .sonic-toggle-legend {
350
+ :is([legends='outside'] > .sonic-toggle[data-sonic-position-count]) > .sonic-toggle-position > .sonic-toggle-legend {
353
351
  position: static;
354
352
  display: block;
355
353
  inline-size: auto;
@@ -360,86 +358,82 @@
360
358
  pointer-events: auto;
361
359
  opacity: 1;
362
360
  translate: none;
361
+ }
363
362
 
364
- & > * {
363
+ :is(:is([legends='outside'] > .sonic-toggle[data-sonic-position-count]) > .sonic-toggle-position > .sonic-toggle-legend) > * {
365
364
  filter: none;
366
365
  }
367
- }
368
366
 
369
- & > .sonic-toggle-position:disabled > .sonic-toggle-legend {
367
+ :is([legends='outside'] > .sonic-toggle[data-sonic-position-count]) > .sonic-toggle-position:disabled > .sonic-toggle-legend {
370
368
  color: var(--sonic-ink-disabled, color-mix(in oklab, currentcolor 30%, transparent));
371
369
  }
372
370
 
373
- & > .sonic-toggle-position:last-child > .sonic-toggle-legend {
371
+ :is([legends='outside'] > .sonic-toggle[data-sonic-position-count]) > .sonic-toggle-position:last-child > .sonic-toggle-legend {
374
372
  grid-column: 2;
375
373
  }
376
- }
377
-
378
- [legends='outside'][orientation='vertical'] > .sonic-toggle[data-sonic-position-count] {
379
- & > :is(.sonic-toggle-well, .sonic-toggle-cap) {
374
+ :is([legends='outside'][orientation='vertical'] > .sonic-toggle[data-sonic-position-count]) > :is(.sonic-toggle-well,.sonic-toggle-cap) {
380
375
  grid-area: 2 / 1 / -2 / 2;
381
376
  }
382
377
 
383
- & > .sonic-toggle-position {
378
+ :is([legends='outside'][orientation='vertical'] > .sonic-toggle[data-sonic-position-count]) > .sonic-toggle-position {
384
379
  grid-area: 1 / 1 / 3 / 2;
385
380
  }
386
381
 
387
- & > .sonic-toggle-position:last-child > .sonic-toggle-legend {
382
+ :is([legends='outside'][orientation='vertical'] > .sonic-toggle[data-sonic-position-count]) > .sonic-toggle-position:last-child > .sonic-toggle-legend {
388
383
  grid-area: 2 / 1;
389
384
  }
390
- }
391
385
 
392
386
  [legends='outside'] > .sonic-toggle[data-sonic-position-count='2'] {
393
387
  grid-template: var(--_sonic-toggle-size) / auto repeat(2, var(--_sonic-toggle-slice)) auto;
388
+ }
394
389
 
395
- & > .sonic-toggle-position:last-child {
390
+ :is([legends='outside'] > .sonic-toggle[data-sonic-position-count='2']) > .sonic-toggle-position:last-child {
396
391
  grid-area: 1 / 3 / 2 / 5;
397
392
  }
398
- }
399
393
 
400
394
  [legends='outside'] > .sonic-toggle[data-sonic-position-count='3'] {
401
395
  grid-template: var(--_sonic-toggle-size) auto / auto repeat(3, var(--_sonic-toggle-slice)) auto;
396
+ }
402
397
 
403
- & > .sonic-toggle-position:last-child {
398
+ :is([legends='outside'] > .sonic-toggle[data-sonic-position-count='3']) > .sonic-toggle-position:last-child {
404
399
  grid-area: 1 / 4 / 2 / 6;
405
400
  }
406
401
 
407
- & > .sonic-toggle-position:nth-child(2 of .sonic-toggle-position) {
402
+ :is([legends='outside'] > .sonic-toggle[data-sonic-position-count='3']) > .sonic-toggle-position:nth-child(2 of .sonic-toggle-position) {
408
403
  grid-area: 1 / 3 / 3 / 4;
404
+ }
409
405
 
410
- & > .sonic-toggle-legend {
406
+ :is(:is([legends='outside'] > .sonic-toggle[data-sonic-position-count='3']) > .sonic-toggle-position:nth-child(2 of .sonic-toggle-position)) > .sonic-toggle-legend {
411
407
  grid-row: 2;
412
408
  }
413
- }
414
- }
415
409
 
416
410
  [legends='outside'][orientation='vertical'] > .sonic-toggle[data-sonic-position-count='2'] {
417
411
  grid-template:
418
412
  auto repeat(2, var(--_sonic-toggle-slice)) auto /
419
413
  minmax(var(--_sonic-toggle-size), auto);
414
+ }
420
415
 
421
- & > .sonic-toggle-position:last-child {
416
+ :is([legends='outside'][orientation='vertical'] > .sonic-toggle[data-sonic-position-count='2']) > .sonic-toggle-position:last-child {
422
417
  grid-area: 3 / 1 / 5 / 2;
423
418
  }
424
- }
425
419
 
426
420
  [legends='outside'][orientation='vertical'] > .sonic-toggle[data-sonic-position-count='3'] {
427
421
  grid-template:
428
422
  auto repeat(3, var(--_sonic-toggle-slice)) auto /
429
423
  minmax(var(--_sonic-toggle-size), auto) auto;
424
+ }
430
425
 
431
- & > .sonic-toggle-position:last-child {
426
+ :is([legends='outside'][orientation='vertical'] > .sonic-toggle[data-sonic-position-count='3']) > .sonic-toggle-position:last-child {
432
427
  grid-area: 4 / 1 / 6 / 2;
433
428
  }
434
429
 
435
- & > .sonic-toggle-position:nth-child(2 of .sonic-toggle-position) {
430
+ :is([legends='outside'][orientation='vertical'] > .sonic-toggle[data-sonic-position-count='3']) > .sonic-toggle-position:nth-child(2 of .sonic-toggle-position) {
436
431
  grid-area: 3 / 1 / 4 / 3;
432
+ }
437
433
 
438
- & > .sonic-toggle-legend {
434
+ :is(:is([legends='outside'][orientation='vertical'] > .sonic-toggle[data-sonic-position-count='3']) > .sonic-toggle-position:nth-child(2 of .sonic-toggle-position)) > .sonic-toggle-legend {
439
435
  grid-area: 1 / 2;
440
436
  }
441
- }
442
- }
443
437
 
444
438
  @media (prefers-reduced-motion: reduce) {
445
439
  .sonic-toggle,
@@ -280,12 +280,12 @@
280
280
 
281
281
  .sonic-waveform-label {
282
282
  color: CanvasText;
283
+ }
283
284
 
284
- &[data-sonic-dimmed] {
285
+ .sonic-waveform-label[data-sonic-dimmed] {
285
286
  color: GrayText;
286
287
  filter: none;
287
288
  }
288
- }
289
289
 
290
290
  .sonic-waveform-playhead {
291
291
  background: CanvasText;
@@ -178,15 +178,15 @@
178
178
  --_sonic-marker-colour: var(--_sonic-marker, var(--_sonic-marker-default));
179
179
 
180
180
  position: absolute;
181
+ }
181
182
 
182
- &[data-sonic-dimmed] {
183
+ [data-sonic-dimmed]:is(.sonic-wavestrip-marker,.sonic-wavestrip-region) {
183
184
  --_sonic-marker-colour: color-mix(
184
185
  in oklab,
185
186
  var(--_sonic-marker, var(--_sonic-marker-default)) 45%,
186
187
  transparent
187
188
  );
188
189
  }
189
- }
190
190
 
191
191
  .sonic-wavestrip-marker {
192
192
  inset: calc(var(--_sonic-marker-lane, 0) * var(--_sonic-marker-step)) auto auto
@@ -233,11 +233,11 @@
233
233
  --_sonic-marker-colour: CanvasText;
234
234
 
235
235
  forced-color-adjust: none;
236
+ }
236
237
 
237
- &[data-sonic-dimmed] {
238
+ [data-sonic-dimmed]:is(.sonic-wavestrip-marker,.sonic-wavestrip-region) {
238
239
  --_sonic-marker-colour: GrayText;
239
240
  }
240
- }
241
241
 
242
242
  .sonic-wavestrip-marker {
243
243
  background: var(--_sonic-marker-colour);