@zazz-ui/core 0.12.1 → 0.12.3

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.
@@ -133521,6 +133521,14 @@
133521
133521
  "name": "--ui-separator-thickness",
133522
133522
  "description": "Primitive hook: the public override surface."
133523
133523
  },
133524
+ {
133525
+ "name": "--ui-slider-fill-bg",
133526
+ "description": "Primitive hook: the public override surface."
133527
+ },
133528
+ {
133529
+ "name": "--ui-slider-fill-side",
133530
+ "description": "Primitive hook: the public override surface."
133531
+ },
133524
133532
  {
133525
133533
  "name": "--ui-slider-ring-color",
133526
133534
  "description": "Primitive hook: the public override surface."
@@ -133601,6 +133609,30 @@
133601
133609
  "name": "--ui-switch-thumb-bg--checked",
133602
133610
  "description": "Primitive hook: the public override surface."
133603
133611
  },
133612
+ {
133613
+ "name": "--ui-switch-thumb-border-color",
133614
+ "description": "Primitive hook: the public override surface."
133615
+ },
133616
+ {
133617
+ "name": "--ui-switch-thumb-border-color--checked",
133618
+ "description": "Primitive hook: the public override surface."
133619
+ },
133620
+ {
133621
+ "name": "--ui-switch-thumb-border-color--checked-hover",
133622
+ "description": "Primitive hook: the public override surface."
133623
+ },
133624
+ {
133625
+ "name": "--ui-switch-thumb-border-color--hover",
133626
+ "description": "Primitive hook: the public override surface."
133627
+ },
133628
+ {
133629
+ "name": "--ui-switch-thumb-border-style",
133630
+ "description": "Primitive hook: the public override surface."
133631
+ },
133632
+ {
133633
+ "name": "--ui-switch-thumb-border-width",
133634
+ "description": "Primitive hook: the public override surface."
133635
+ },
133604
133636
  {
133605
133637
  "name": "--ui-switch-thumb-corner-shape",
133606
133638
  "description": "Primitive hook: the public override surface."
@@ -1006,7 +1006,9 @@
1006
1006
  "appearance: none — redraws track + thumb from theme tokens",
1007
1007
  "--_touch-min (touch screens): the transparent input grows to the touch floor and so does the thumb's box, through a transparent border, while the visible thumb keeps its size. A thumb can't have an ::after, so on touch screens its border and ring draw inset, it loses its drop shadow, and the visible thumb stops a border's width short of each track end.",
1008
1008
  "sign(): switches the ring inset once the thumb has a hit border",
1009
- "corner-shape — round by default, so circles stay circles; a hook takes any shape"
1009
+ "corner-shape — round by default, so circles stay circles; a hook takes any shape",
1010
+ "the track fill: ::-moz-range-progress in Firefox. Chromium and Safari have no progress part, so a view timeline on the thumb (view-timeline + timeline-scope) animates --_slider-progress on the track, which paints the fill as a gradient. The timeline needs the input to be a scroll container, so there it clips its overflow and pads its inline ends to keep the thumb's ring in view, so a padding utility on the input moves the fill off the thumb there. @supports-gated: an engine without view timelines shows no fill. Nor does a right-to-left slider there: Chromium measures an inline view timeline from the left in RTL and Safari from the right, and CSS can't tell which it got.",
1011
+ "@container style(--ui-slider-fill-side: end) — the fill runs from the thumb to the end; Firefox 151+ (style queries), older engines fill from the start."
1010
1012
  ],
1011
1013
  "tokens": [
1012
1014
  "--ui-slider-* (@layer variables, on :root so subtree hooks work); the thumb and track sizes floor at --spacing-control-min"
@@ -1168,7 +1170,7 @@
1168
1170
  "uses": [
1169
1171
  "interestfor: Interest Invokers API (Chromium 142+; polyfill via invokers)",
1170
1172
  "data-tooltip-slot=\"content\": hint popover (light dismiss, auto-hides sibling hints)",
1171
- "anchor-name, position-anchor, position-area, position-try-fallbacks: explicit anchors for polyfill; data-popover-side maps to --ui-popover-position-*",
1173
+ "anchor-name, position-anchor, position-area, position-try-fallbacks: explicit anchors for polyfill; data-popover-side maps to --ui-popover-position-*. Chromium (151) draws one of a newly opened anchored element's first two frames without its scroll compensation, so in a scrolled container or page the tooltip flashes far from its trigger. Opening, the fade starts 34ms (two 60Hz frames) late, so that frame paints transparent; a later one would be nearly so. A custom --ui-tooltip-transition keeps the delay on its first entry.",
1172
1174
  "corner-shape — superellipse corners; unsupported browsers keep plain rounded corners",
1173
1175
  ":dir(rtl): inline-side origins and slide-in mirror; the arrow uses logical insets",
1174
1176
  "@media not (hover: hover) — hidden on touch screens (no hover to show it, and a tap would cover the trigger's own action); keep essential text visible"
@@ -1925,7 +1927,7 @@
1925
1927
  "file": "primitives/fields/fields.css"
1926
1928
  },
1927
1929
  "--ui-field-border-color--hover": {
1928
- "value": "color-mix( in oklch, var(--color-border) 90%, var(--color-primary) 10% )",
1930
+ "value": "color-mix( in oklch, var(--color-border) 90%, var(--color-foreground) 10% )",
1929
1931
  "file": "primitives/fields/fields.css"
1930
1932
  },
1931
1933
  "--ui-field-border-style": {
@@ -3072,12 +3074,20 @@
3072
3074
  "value": "1px",
3073
3075
  "file": "primitives/separator/separator.css"
3074
3076
  },
3077
+ "--ui-slider-fill-bg": {
3078
+ "value": "var(--color-primary)",
3079
+ "file": "primitives/slider/slider.css"
3080
+ },
3081
+ "--ui-slider-fill-side": {
3082
+ "value": "start",
3083
+ "file": "primitives/slider/slider.css"
3084
+ },
3075
3085
  "--ui-slider-ring-color": {
3076
3086
  "value": "var(--color-ring)",
3077
3087
  "file": "primitives/slider/slider.css"
3078
3088
  },
3079
3089
  "--ui-slider-thumb-bg": {
3080
- "value": "var(--color-background)",
3090
+ "value": "var(--color-card)",
3081
3091
  "file": "primitives/slider/slider.css"
3082
3092
  },
3083
3093
  "--ui-slider-thumb-border-color": {
@@ -3109,15 +3119,15 @@
3109
3119
  "file": "primitives/slider/slider.css"
3110
3120
  },
3111
3121
  "--ui-slider-track-bg": {
3112
- "value": "var(--color-muted)",
3122
+ "value": "var(--ui-field-bg)",
3113
3123
  "file": "primitives/slider/slider.css"
3114
3124
  },
3115
3125
  "--ui-slider-track-border-color": {
3116
- "value": "var(--color-muted)",
3126
+ "value": "var(--ui-field-border-color)",
3117
3127
  "file": "primitives/slider/slider.css"
3118
3128
  },
3119
3129
  "--ui-slider-track-border-width": {
3120
- "value": "1px",
3130
+ "value": "var(--ui-field-border-width)",
3121
3131
  "file": "primitives/slider/slider.css"
3122
3132
  },
3123
3133
  "--ui-slider-track-corner-shape": {
@@ -3152,6 +3162,30 @@
3152
3162
  "value": "var(--color-primary-foreground)",
3153
3163
  "file": "primitives/switch/switch.css"
3154
3164
  },
3165
+ "--ui-switch-thumb-border-color": {
3166
+ "value": "transparent",
3167
+ "file": "primitives/switch/switch.css"
3168
+ },
3169
+ "--ui-switch-thumb-border-color--checked": {
3170
+ "value": "transparent",
3171
+ "file": "primitives/switch/switch.css"
3172
+ },
3173
+ "--ui-switch-thumb-border-color--checked-hover": {
3174
+ "value": "transparent",
3175
+ "file": "primitives/switch/switch.css"
3176
+ },
3177
+ "--ui-switch-thumb-border-color--hover": {
3178
+ "value": "transparent",
3179
+ "file": "primitives/switch/switch.css"
3180
+ },
3181
+ "--ui-switch-thumb-border-style": {
3182
+ "value": "var(--ui-field-border-style)",
3183
+ "file": "primitives/switch/switch.css"
3184
+ },
3185
+ "--ui-switch-thumb-border-width": {
3186
+ "value": "var(--ui-field-border-width)",
3187
+ "file": "primitives/switch/switch.css"
3188
+ },
3155
3189
  "--ui-switch-thumb-corner-shape": {
3156
3190
  "value": "var(--ui-switch-corner-shape)",
3157
3191
  "file": "primitives/switch/switch.css"
@@ -3165,11 +3199,11 @@
3165
3199
  "file": "primitives/switch/switch.css"
3166
3200
  },
3167
3201
  "--ui-switch-thumb-shadow": {
3168
- "value": "var(--shadow-sm)",
3202
+ "value": "var(--shadow-xs)",
3169
3203
  "file": "primitives/switch/switch.css"
3170
3204
  },
3171
3205
  "--ui-switch-thumb-size": {
3172
- "value": "calc((var(--ui-switch-track-w) / 2) - var(--ui-switch-track-p))",
3206
+ "value": "calc( (var(--ui-switch-track-w) / 2) - var(--ui-switch-track-p) - var(--ui-switch-thumb-border-width) )",
3173
3207
  "file": "primitives/switch/switch.css"
3174
3208
  },
3175
3209
  "--ui-switch-thumb-translate": {
@@ -3221,7 +3255,7 @@
3221
3255
  "file": "primitives/switch/switch.css"
3222
3256
  },
3223
3257
  "--ui-switch-track-h": {
3224
- "value": "calc(var(--ui-switch-track-w) / 2 + var(--ui-switch-track-p))",
3258
+ "value": "calc( var(--ui-switch-track-w) / 2 + var(--ui-switch-track-p) + var(--ui-switch-track-border-width) )",
3225
3259
  "file": "primitives/switch/switch.css"
3226
3260
  },
3227
3261
  "--ui-switch-track-p": {
@@ -3321,11 +3355,11 @@
3321
3355
  "file": "primitives/table/table.css"
3322
3356
  },
3323
3357
  "--ui-tabs-gap": {
3324
- "value": "var(--space-xs)",
3358
+ "value": "0",
3325
3359
  "file": "primitives/tabs/tabs.css"
3326
3360
  },
3327
3361
  "--ui-tabs-indicator-bg": {
3328
- "value": "var(--color-card)",
3362
+ "value": "var(--color-muted)",
3329
3363
  "file": "primitives/tabs/tabs.css"
3330
3364
  },
3331
3365
  "--ui-tabs-indicator-border-color": {
@@ -3353,7 +3387,7 @@
3353
3387
  "file": "primitives/tabs/tabs.css"
3354
3388
  },
3355
3389
  "--ui-tabs-indicator-shadow": {
3356
- "value": "var(--shadow-xs)",
3390
+ "value": "none",
3357
3391
  "file": "primitives/tabs/tabs.css"
3358
3392
  },
3359
3393
  "--ui-tabs-label-bg": {
@@ -3433,11 +3467,11 @@
3433
3467
  "file": "primitives/tabs/tabs.css"
3434
3468
  },
3435
3469
  "--ui-tabs-track-gap": {
3436
- "value": "calc(var(--spacing) * 0.5)",
3470
+ "value": "calc(var(--spacing) * 0.35)",
3437
3471
  "file": "primitives/tabs/tabs.css"
3438
3472
  },
3439
3473
  "--ui-tabs-track-p": {
3440
- "value": "calc(var(--spacing) * 0.5)",
3474
+ "value": "calc(var(--spacing) * 0.35)",
3441
3475
  "file": "primitives/tabs/tabs.css"
3442
3476
  },
3443
3477
  "--ui-tabs-track-radius": {
@@ -3979,10 +4013,10 @@
3979
4013
  "dark": "oklch(0.82 0.09 242)"
3980
4014
  },
3981
4015
  "--color-input": {
3982
- "value": "light-dark(var(--color-neutral-50), var(--color-tint-100))",
4016
+ "value": "light-dark(var(--color-neutral-50), var(--color-neutral-950))",
3983
4017
  "file": "base/_variables.css",
3984
4018
  "light": "oklch(0.973 0.001 287.31)",
3985
- "dark": "oklch(from oklch(0.973 0.001 287.31) l c h / 0.085)"
4019
+ "dark": "oklch(0.198 0.008 285.68)"
3986
4020
  },
3987
4021
  "--color-input-foreground": {
3988
4022
  "value": "light-dark(var(--color-neutral-900), var(--color-white))",
@@ -112,6 +112,8 @@
112
112
  ],
113
113
  "switch": [
114
114
  "thumb-bg--checked",
115
+ "thumb-border-color--checked",
116
+ "thumb-border-color--hover",
115
117
  "track-bg--checked",
116
118
  "track-bg--hover",
117
119
  "track-border-color--checked",
@@ -1447,6 +1449,7 @@
1447
1449
  254,
1448
1450
  257,
1449
1451
  260,
1452
+ 269,
1450
1453
  270,
1451
1454
  273,
1452
1455
  274,
@@ -1592,6 +1595,7 @@
1592
1595
  254,
1593
1596
  257,
1594
1597
  260,
1598
+ 269,
1595
1599
  270,
1596
1600
  273,
1597
1601
  274,
@@ -1820,6 +1824,7 @@
1820
1824
  253,
1821
1825
  254,
1822
1826
  260,
1827
+ 269,
1823
1828
  270
1824
1829
  ],
1825
1830
  "pt": [
@@ -1964,6 +1969,7 @@
1964
1969
  254,
1965
1970
  257,
1966
1971
  260,
1972
+ 269,
1967
1973
  270,
1968
1974
  273,
1969
1975
  274,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zazz-ui/core",
3
- "version": "0.12.1",
3
+ "version": "0.12.3",
4
4
  "description": "Zazz Design Framework — a zero-build, semantic-token CSS + vanilla JS UI kit built on modern web standards.",
5
5
  "keywords": [
6
6
  "cascade-layers",
@@ -196,13 +196,13 @@
196
196
  }
197
197
 
198
198
 
199
- :where([style*="--p--"]:not(code, kbd, select:is([multiple], [size]) optgroup option)) {
199
+ :where([style*="--p--"]:not(code, input[type="range"], kbd, select:is([multiple], [size]) optgroup option)) {
200
200
  --_p-len: var(--_p-resolved, 0);
201
201
  --_p-num: var(--_p-resolved, 0);
202
202
  padding: calc(var(--_p-len) + var(--_p-num) * var(--spacing));
203
203
  }
204
204
 
205
- :where([style*="--px--"]:not(code, kbd, select:is([multiple], [size]) optgroup option)) {
205
+ :where([style*="--px--"]:not(code, input[type="range"], kbd, select:is([multiple], [size]) optgroup option)) {
206
206
  --_px-len: var(--_px-resolved, 0);
207
207
  --_px-num: var(--_px-resolved, 0);
208
208
  padding-inline: calc(var(--_px-len) + var(--_px-num) * var(--spacing));
@@ -226,13 +226,13 @@
226
226
  padding-block-end: calc(var(--_pb-len) + var(--_pb-num) * var(--spacing));
227
227
  }
228
228
 
229
- :where([style*="--pl--"]:not(code, kbd, select:is([multiple], [size]) optgroup option)) {
229
+ :where([style*="--pl--"]:not(code, input[type="range"], kbd, select:is([multiple], [size]) optgroup option)) {
230
230
  --_pl-len: var(--_pl-resolved, 0);
231
231
  --_pl-num: var(--_pl-resolved, 0);
232
232
  padding-inline-start: calc(var(--_pl-len) + var(--_pl-num) * var(--spacing));
233
233
  }
234
234
 
235
- :where([style*="--pr--"]:not(code, kbd)) {
235
+ :where([style*="--pr--"]:not(code, input[type="range"], kbd)) {
236
236
  --_pr-len: var(--_pr-resolved, 0);
237
237
  --_pr-num: var(--_pr-resolved, 0);
238
238
  padding-inline-end: calc(var(--_pr-len) + var(--_pr-num) * var(--spacing));
@@ -63,7 +63,7 @@
63
63
  --color-card-foreground: light-dark(var(--color-neutral-900), var(--color-white));
64
64
  --color-popover: light-dark(var(--color-white), var(--color-neutral-950));
65
65
  --color-popover-foreground: light-dark(var(--color-neutral-900), var(--color-white));
66
- --color-input: light-dark(var(--color-neutral-50), var(--color-tint-100));
66
+ --color-input: light-dark(var(--color-neutral-50), var(--color-neutral-950));
67
67
  --color-input-foreground: light-dark(var(--color-neutral-900), var(--color-white));
68
68
 
69
69
  /* selection */
@@ -407,7 +407,7 @@ export const TIER_BLOCKS = {
407
407
  112, 120, 121, 125, 130, 131, 141, 144, 145, 148, 149, 150, 151, 153, 154, 156, 157, 159, 161,
408
408
  162, 163, 164, 175, 177, 178, 180, 181, 184, 186, 187, 188, 189, 191, 192, 193, 194, 199, 207,
409
409
  211, 212, 214, 215, 218, 220, 221, 222, 223, 227, 230, 237, 238, 241, 245, 246, 248, 252, 253,
410
- 254, 257, 260, 270, 273, 274, 275,
410
+ 254, 257, 260, 269, 270, 273, 274, 275,
411
411
  ],
412
412
  pb: [
413
413
  5, 6, 26, 29, 37, 46, 49, 52, 58, 59, 61, 62, 64, 65, 67, 68, 78, 83, 84, 108, 112, 120, 121,
@@ -419,7 +419,7 @@ export const TIER_BLOCKS = {
419
419
  5, 6, 8, 9, 26, 29, 37, 46, 48, 49, 52, 58, 59, 61, 62, 64, 65, 67, 68, 78, 91, 108, 120, 121,
420
420
  125, 130, 131, 141, 144, 145, 148, 149, 150, 151, 153, 154, 156, 157, 159, 161, 163, 164, 175,
421
421
  177, 178, 184, 186, 187, 188, 191, 192, 193, 194, 199, 207, 211, 212, 218, 220, 221, 222, 227,
422
- 230, 237, 238, 245, 246, 248, 252, 253, 254, 257, 260, 270, 273, 274, 275,
422
+ 230, 237, 238, 245, 246, 248, 252, 253, 254, 257, 260, 269, 270, 273, 274, 275,
423
423
  ],
424
424
  "place-content": [
425
425
  0, 23, 25, 37, 59, 70, 77, 78, 84, 91, 94, 121, 123, 144, 145, 149, 150, 157, 159, 161, 162,
@@ -441,7 +441,7 @@ export const TIER_BLOCKS = {
441
441
  5, 6, 26, 29, 37, 46, 49, 52, 58, 59, 61, 62, 64, 65, 67, 68, 78, 108, 120, 121, 125, 130, 131,
442
442
  141, 144, 145, 148, 149, 150, 151, 153, 154, 156, 157, 159, 161, 163, 164, 175, 177, 178, 184,
443
443
  186, 187, 189, 191, 193, 194, 199, 207, 211, 212, 218, 220, 221, 223, 227, 230, 237, 238, 245,
444
- 246, 248, 252, 253, 254, 260, 270,
444
+ 246, 248, 252, 253, 254, 260, 269, 270,
445
445
  ],
446
446
  pt: [
447
447
  5, 6, 26, 29, 37, 46, 49, 52, 58, 59, 61, 62, 64, 65, 67, 68, 78, 83, 84, 108, 112, 120, 121,
@@ -453,7 +453,7 @@ export const TIER_BLOCKS = {
453
453
  5, 6, 8, 9, 26, 29, 37, 46, 48, 49, 52, 58, 59, 61, 62, 64, 65, 67, 68, 78, 91, 108, 120, 121,
454
454
  125, 130, 131, 141, 144, 145, 148, 149, 150, 151, 153, 154, 156, 157, 159, 161, 163, 164, 175,
455
455
  177, 178, 184, 186, 187, 188, 189, 191, 192, 193, 194, 199, 207, 211, 212, 218, 220, 221, 222,
456
- 223, 227, 230, 237, 238, 245, 246, 248, 252, 253, 254, 257, 260, 270, 273, 274, 275,
456
+ 223, 227, 230, 237, 238, 245, 246, 248, 252, 253, 254, 257, 260, 269, 270, 273, 274, 275,
457
457
  ],
458
458
  py: [
459
459
  5, 6, 26, 29, 37, 46, 49, 52, 58, 59, 61, 62, 64, 65, 67, 68, 78, 83, 84, 108, 112, 120, 121,
@@ -410,7 +410,7 @@ export const TIER_BLOCKS: Readonly<Record<string, readonly number[]>> = {
410
410
  112, 120, 121, 125, 130, 131, 141, 144, 145, 148, 149, 150, 151, 153, 154, 156, 157, 159, 161,
411
411
  162, 163, 164, 175, 177, 178, 180, 181, 184, 186, 187, 188, 189, 191, 192, 193, 194, 199, 207,
412
412
  211, 212, 214, 215, 218, 220, 221, 222, 223, 227, 230, 237, 238, 241, 245, 246, 248, 252, 253,
413
- 254, 257, 260, 270, 273, 274, 275,
413
+ 254, 257, 260, 269, 270, 273, 274, 275,
414
414
  ],
415
415
  pb: [
416
416
  5, 6, 26, 29, 37, 46, 49, 52, 58, 59, 61, 62, 64, 65, 67, 68, 78, 83, 84, 108, 112, 120, 121,
@@ -422,7 +422,7 @@ export const TIER_BLOCKS: Readonly<Record<string, readonly number[]>> = {
422
422
  5, 6, 8, 9, 26, 29, 37, 46, 48, 49, 52, 58, 59, 61, 62, 64, 65, 67, 68, 78, 91, 108, 120, 121,
423
423
  125, 130, 131, 141, 144, 145, 148, 149, 150, 151, 153, 154, 156, 157, 159, 161, 163, 164, 175,
424
424
  177, 178, 184, 186, 187, 188, 191, 192, 193, 194, 199, 207, 211, 212, 218, 220, 221, 222, 227,
425
- 230, 237, 238, 245, 246, 248, 252, 253, 254, 257, 260, 270, 273, 274, 275,
425
+ 230, 237, 238, 245, 246, 248, 252, 253, 254, 257, 260, 269, 270, 273, 274, 275,
426
426
  ],
427
427
  "place-content": [
428
428
  0, 23, 25, 37, 59, 70, 77, 78, 84, 91, 94, 121, 123, 144, 145, 149, 150, 157, 159, 161, 162,
@@ -444,7 +444,7 @@ export const TIER_BLOCKS: Readonly<Record<string, readonly number[]>> = {
444
444
  5, 6, 26, 29, 37, 46, 49, 52, 58, 59, 61, 62, 64, 65, 67, 68, 78, 108, 120, 121, 125, 130, 131,
445
445
  141, 144, 145, 148, 149, 150, 151, 153, 154, 156, 157, 159, 161, 163, 164, 175, 177, 178, 184,
446
446
  186, 187, 189, 191, 193, 194, 199, 207, 211, 212, 218, 220, 221, 223, 227, 230, 237, 238, 245,
447
- 246, 248, 252, 253, 254, 260, 270,
447
+ 246, 248, 252, 253, 254, 260, 269, 270,
448
448
  ],
449
449
  pt: [
450
450
  5, 6, 26, 29, 37, 46, 49, 52, 58, 59, 61, 62, 64, 65, 67, 68, 78, 83, 84, 108, 112, 120, 121,
@@ -456,7 +456,7 @@ export const TIER_BLOCKS: Readonly<Record<string, readonly number[]>> = {
456
456
  5, 6, 8, 9, 26, 29, 37, 46, 48, 49, 52, 58, 59, 61, 62, 64, 65, 67, 68, 78, 91, 108, 120, 121,
457
457
  125, 130, 131, 141, 144, 145, 148, 149, 150, 151, 153, 154, 156, 157, 159, 161, 163, 164, 175,
458
458
  177, 178, 184, 186, 187, 188, 189, 191, 192, 193, 194, 199, 207, 211, 212, 218, 220, 221, 222,
459
- 223, 227, 230, 237, 238, 245, 246, 248, 252, 253, 254, 257, 260, 270, 273, 274, 275,
459
+ 223, 227, 230, 237, 238, 245, 246, 248, 252, 253, 254, 257, 260, 269, 270, 273, 274, 275,
460
460
  ],
461
461
  py: [
462
462
  5, 6, 26, 29, 37, 46, 49, 52, 58, 59, 61, 62, 64, 65, 67, 68, 78, 83, 84, 108, 112, 120, 121,
@@ -40,7 +40,7 @@
40
40
  --ui-field-border-color--hover: color-mix(
41
41
  in oklch,
42
42
  var(--color-border) 90%,
43
- var(--color-primary) 10%
43
+ var(--color-foreground) 10%
44
44
  );
45
45
  --ui-field-border-color--focus-within: var(--color-primary);
46
46
 
@@ -11,12 +11,23 @@
11
11
  * stops a border's width short of each track end.
12
12
  * @uses sign(): switches the ring inset once the thumb has a hit border
13
13
  * @uses corner-shape — round by default, so circles stay circles; a hook takes any shape
14
+ * @uses the track fill: ::-moz-range-progress in Firefox. Chromium and Safari have no
15
+ * progress part, so a view timeline on the thumb (view-timeline + timeline-scope)
16
+ * animates --_slider-progress on the track, which paints the fill as a gradient.
17
+ * The timeline needs the input to be a scroll container, so there it clips its
18
+ * overflow and pads its inline ends to keep the thumb's ring in view, so a
19
+ * padding utility on the input moves the fill off the thumb there.
20
+ * @supports-gated: an engine without view timelines shows no fill. Nor does
21
+ * a right-to-left slider there: Chromium measures an inline view timeline from
22
+ * the left in RTL and Safari from the right, and CSS can't tell which it got.
23
+ * @uses @container style(--ui-slider-fill-side: end) — the fill runs from the thumb
24
+ * to the end; Firefox 151+ (style queries), older engines fill from the start.
14
25
  * @tokens --ui-slider-* (@layer variables, on :root so subtree hooks work); the thumb
15
26
  * and track sizes floor at --spacing-control-min
16
27
  *
17
- * Note: The active region is NOT filled (parity across engines); add a paint
18
- * via JS if a filled track is needed. The thumb is centered on the track with a
19
- * calc'd negative margin so retuning either size keeps it aligned.
28
+ * Note: The thumb is centered on the track with a calc'd negative margin so retuning
29
+ * either size keeps it aligned. The gradient fill runs left to right; a vertical writing
30
+ * mode isn't handled.
20
31
  */
21
32
 
22
33
  @layer variables {
@@ -24,13 +35,18 @@
24
35
  --ui-slider-ring-color: var(--color-ring);
25
36
 
26
37
  --ui-slider-track-h: max(calc(var(--spacing) * 1.5), calc(var(--spacing-control-min) * 0.375));
27
- --ui-slider-track-bg: var(--color-muted);
28
- --ui-slider-track-border-width: 1px;
29
- --ui-slider-track-border-color: var(--color-muted);
38
+ --ui-slider-track-bg: var(--ui-field-bg);
39
+ --ui-slider-track-border-width: var(--ui-field-border-width);
40
+ --ui-slider-track-border-color: var(--ui-field-border-color);
30
41
  --ui-slider-track-radius: var(--radius-full);
31
42
  --ui-slider-track-corner-shape: round;
43
+ /* the part of the track between its start and the thumb; `end` fills from the thumb
44
+ to the end of the track instead */
45
+ --ui-slider-fill-bg: var(--color-primary);
46
+ --ui-slider-fill-side: start;
47
+
32
48
  --ui-slider-thumb-size: max(calc(var(--spacing) * 4), var(--spacing-control-min));
33
- --ui-slider-thumb-bg: var(--color-background);
49
+ --ui-slider-thumb-bg: var(--color-card);
34
50
 
35
51
  /* composes into the thumb's box-shadow list with its border and ring: use a
36
52
  transparent shadow, never `none` */
@@ -55,6 +71,39 @@
55
71
  syntax: "*";
56
72
  inherits: true;
57
73
  }
74
+ @property --_slider-thumb-box {
75
+ syntax: "*";
76
+ inherits: true;
77
+ }
78
+ @property --_slider-bleed {
79
+ syntax: "*";
80
+ inherits: true;
81
+ }
82
+ @property --_slider-fill-before {
83
+ syntax: "*";
84
+ inherits: true;
85
+ }
86
+ @property --_slider-fill-after {
87
+ syntax: "*";
88
+ inherits: true;
89
+ }
90
+ /* 0 with the thumb at the start, 1 at the end; registered so the timeline can animate it */
91
+ @property --_slider-progress {
92
+ syntax: "<number>";
93
+ inherits: true;
94
+ initial-value: 0;
95
+ }
96
+
97
+ /* A view timeline counts up as its subject moves toward the start of the scroller, so
98
+ the keyframes run backward. */
99
+ @keyframes ui-slider-progress {
100
+ from {
101
+ --_slider-progress: 1;
102
+ }
103
+ to {
104
+ --_slider-progress: 0;
105
+ }
106
+ }
58
107
 
59
108
  @layer reset {
60
109
  :where(input[type="range"]) {
@@ -62,7 +111,16 @@
62
111
  --_slider-thumb-hit: max(0px, (var(--_touch-min) - var(--ui-slider-thumb-size)) / 2);
63
112
  /* 1 once the thumb has a hit border: the ring then draws inside the visible thumb */
64
113
  --_slider-thumb-in: sign(var(--_slider-thumb-hit));
114
+ /* the thumb's whole box, hit border included: what travels along the track */
115
+ --_slider-thumb-box: calc(var(--ui-slider-thumb-size) + 2 * var(--_slider-thumb-hit));
65
116
  --_slider-thumb-drop: var(--ui-slider-thumb-shadow);
117
+ /* how far the ring reaches past the thumb, which the scroll container must keep in view */
118
+ --_slider-bleed: calc(
119
+ (var(--ring-offset-width) + var(--ring-width)) * (1 - var(--_slider-thumb-in))
120
+ );
121
+ /* the fill: from the start to the thumb, or from the thumb to the end */
122
+ --_slider-fill-before: var(--ui-slider-fill-bg);
123
+ --_slider-fill-after: transparent;
66
124
  /* derived on the element so a subtree hook keeps the thumb centered on the track */
67
125
  --ui-slider-thumb-offset: calc(
68
126
  (var(--ui-slider-track-h) - var(--ui-slider-thumb-size)) / 2 - var(--_slider-thumb-hit) -
@@ -89,6 +147,59 @@
89
147
  outline-offset: var(--outline-offset);
90
148
  }
91
149
 
150
+ /* The view timeline needs the input as its scroller: it clips, so the inline padding
151
+ and the block size leave room for the thumb's ring and shadow, and the timeline's
152
+ inset takes the padding back out so the thumb's ends of travel are 0 and 1. */
153
+ @supports (animation-timeline: view()) {
154
+ :where(input[type="range"]) {
155
+ overflow: hidden;
156
+ padding-inline: var(--_slider-bleed);
157
+ min-block-size: max(
158
+ var(--_touch-min),
159
+ var(--ui-slider-thumb-size) + 2 * var(--_slider-bleed) + 2 * var(--spacing)
160
+ );
161
+ timeline-scope: --ui-slider-thumb;
162
+ }
163
+
164
+ :where(input[type="range"])::-webkit-slider-thumb {
165
+ view-timeline: --ui-slider-thumb inline;
166
+ view-timeline-inset: var(--_slider-bleed);
167
+ }
168
+
169
+ /* On the track, not the input: Safari's timeline doesn't reach the input itself.
170
+ Longhands only: with the `animation` shorthand, the build's minifier folds the
171
+ timeline into it, which no browser parses, and the fill never moves. */
172
+ :where(input[type="range"])::-webkit-slider-runnable-track {
173
+ animation-name: ui-slider-progress;
174
+ animation-duration: 1ms;
175
+ animation-timing-function: linear;
176
+ animation-fill-mode: both;
177
+ animation-timeline: --ui-slider-thumb;
178
+ animation-range: contain;
179
+ }
180
+ }
181
+
182
+ @container style(--ui-slider-fill-side: end) {
183
+ :where(input[type="range"])::-webkit-slider-runnable-track {
184
+ --_slider-fill-before: transparent;
185
+ --_slider-fill-after: var(--ui-slider-fill-bg);
186
+ }
187
+
188
+ :where(input[type="range"])::-moz-range-track {
189
+ background: var(--ui-slider-fill-bg);
190
+ }
191
+
192
+ :where(input[type="range"])::-moz-range-progress {
193
+ background: var(--ui-slider-track-bg);
194
+ }
195
+ }
196
+
197
+ /* No gradient fill right to left (see the header); after the side query, so it wins */
198
+ :where(input[type="range"]:dir(rtl))::-webkit-slider-runnable-track {
199
+ --_slider-fill-before: transparent;
200
+ --_slider-fill-after: transparent;
201
+ }
202
+
92
203
  /* An outer shadow would paint at the edge of the grown thumb box, not the visible thumb */
93
204
  @media (not (hover: hover)) {
94
205
  :where(input[type="range"]) {
@@ -98,12 +209,32 @@
98
209
  :where(input[type="range"])::-webkit-slider-runnable-track {
99
210
  block-size: var(--ui-slider-track-h);
100
211
  inline-size: 100%;
101
- background: var(--ui-slider-track-bg);
212
+ /* the fill's edge sits at the thumb's center, which travels half a thumb in from
213
+ each end of the track's content box */
214
+ background:
215
+ linear-gradient(
216
+ to right,
217
+ var(--_slider-fill-before)
218
+ calc(
219
+ var(--_slider-thumb-box) / 2 + var(--_slider-progress) *
220
+ (100% - var(--_slider-thumb-box))
221
+ ),
222
+ var(--_slider-fill-after) 0
223
+ )
224
+ content-box no-repeat,
225
+ var(--ui-slider-track-bg);
102
226
  border: var(--ui-slider-track-border-width) solid var(--ui-slider-track-border-color);
103
227
  border-radius: var(--ui-slider-track-radius);
104
228
  corner-shape: var(--ui-slider-track-corner-shape);
105
229
  }
106
230
 
231
+ /* Without a view timeline the progress never moves off 0, so the track stays plain */
232
+ @supports not (animation-timeline: view()) {
233
+ :where(input[type="range"])::-webkit-slider-runnable-track {
234
+ background: var(--ui-slider-track-bg);
235
+ }
236
+ }
237
+
107
238
  :where(input[type="range"])::-moz-range-track {
108
239
  block-size: var(--ui-slider-track-h);
109
240
  inline-size: 100%;
@@ -143,6 +274,14 @@
143
274
  transition: var(--default-transition);
144
275
  }
145
276
 
277
+ :where(input[type="range"])::-moz-range-progress {
278
+ /* inside the track's border, as the gradient fill is in the other engines */
279
+ block-size: var(--ui-slider-track-h);
280
+ background: var(--ui-slider-fill-bg);
281
+ border-radius: var(--ui-slider-track-radius);
282
+ corner-shape: var(--ui-slider-track-corner-shape);
283
+ }
284
+
146
285
  :where(input[type="range"])::-moz-range-thumb {
147
286
  appearance: none;
148
287
  box-sizing: content-box;