@zakisheriff/liquid-glass 0.2.7 → 0.3.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zaki Sheriff
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -5,14 +5,22 @@
5
5
  <br />
6
6
  <br />
7
7
 
8
+ [![npm version](https://img.shields.io/npm/v/@zakisheriff/liquid-glass?style=for-the-badge&logo=npm&color=cb3837)](https://www.npmjs.com/package/@zakisheriff/liquid-glass)
9
+ [![npm downloads](https://img.shields.io/npm/dm/@zakisheriff/liquid-glass?style=for-the-badge&color=0a84ff)](https://www.npmjs.com/package/@zakisheriff/liquid-glass)
10
+ [![Bundle size](https://img.shields.io/bundlephobia/minzip/@zakisheriff/liquid-glass?style=for-the-badge&label=gzip&color=30d158)](https://bundlephobia.com/package/@zakisheriff/liquid-glass)
11
+ [![Zero dependencies](https://img.shields.io/badge/dependencies-0-30d158?style=for-the-badge)](https://www.npmjs.com/package/@zakisheriff/liquid-glass?activeTab=dependencies)
12
+ <br />
8
13
  ![React](https://img.shields.io/badge/React-%3E%3D17-61dafb?style=for-the-badge&logo=react&logoColor=white)
14
+ ![Next.js](https://img.shields.io/badge/Next.js-ready-000000?style=for-the-badge&logo=nextdotjs&logoColor=white)
9
15
  ![TypeScript](https://img.shields.io/badge/TypeScript-5-3178C6?style=for-the-badge&logo=typescript&logoColor=white)
10
- ![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)
16
+ [![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)](./LICENSE)
17
+
18
+ <br />
11
19
 
12
- **[liquidglass.theatom.lk](https://liquidglass.theatom.lk)** ·
13
- **[Documentation](https://liquidglass.theatom.lk/docs)** ·
14
- **[npm](https://www.npmjs.com/package/@zakisheriff/liquid-glass)** ·
15
- **[GitHub](https://github.com/zakisheriff/Liquid-Glass)**
20
+ [![Live demo](https://img.shields.io/badge/Live_demo-liquidglass.theatom.lk-0a84ff?style=for-the-badge&logo=safari&logoColor=white)](https://liquidglass.theatom.lk)
21
+ [![Docs](https://img.shields.io/badge/Docs-read-1d1d1f?style=for-the-badge&logo=readthedocs&logoColor=white)](https://liquidglass.theatom.lk/docs)
22
+ [![npm](https://img.shields.io/badge/npm-install-cb3837?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/@zakisheriff/liquid-glass)
23
+ [![GitHub](https://img.shields.io/badge/GitHub-star-181717?style=for-the-badge&logo=github&logoColor=white)](https://github.com/zakisheriff/Liquid-Glass)
16
24
 
17
25
  </div>
18
26
 
@@ -45,12 +53,13 @@ Works with Next.js (the bundle is marked `"use client"`), Vite and CRA.
45
53
  | --- | --- |
46
54
  | `GlassButton` | Pill or circle (`icon` with no children). Swells, leans toward a drag, wobbles on release. |
47
55
  | `GlassSwitch` | The knob lifts into a clear lens that refracts the track. Tap, or drag with rubber-banding. |
48
- | `GlassNav` | Floating tab bar. The selection inflates into a lens you can drag across tabs. |
56
+ | `GlassNav` | Floating tab bar. The selection inflates into a lens you can drag across tabs. Icons with labels, or icons only. |
49
57
  | `GlassSegmented` | Segmented control. The whole control swells and the selection becomes a draggable lens. |
50
58
  | `GlassSlider` | Thin track with a lens thumb that magnifies the rail, or `showThumb={false}` for a Control Center block. |
51
59
  | `GlassInput` | Search / text field with icon, trailing accessory and clear button. |
52
60
  | `GlassCard` | Refracting panel, `regular` or `clear`. |
53
- | `GlassSheet` | Floating bottom sheet. Spring entrance, drag or flick to dismiss. |
61
+ | `GlassMenu` | Pull-down menu that grows out of its glass button and folds back into it. Slide a finger across the items to pick one. |
62
+ | `GlassSheet` | Floating bottom sheet. Spring entrance, drag or flick to dismiss. With `detents` it opens at half height and expands to full screen. |
54
63
 
55
64
  ### Buttons
56
65
 
@@ -82,6 +91,17 @@ Works with Next.js (the bundle is marked `"use client"`), Vite and CRA.
82
91
  ]}
83
92
  />
84
93
 
94
+ <GlassNav showLabels={false} activeIndex={tab} onChange={setTab} items={tabs} />
95
+
96
+ <GlassMenu
97
+ icon={<EllipsisIcon />}
98
+ aria-label="More"
99
+ items={[
100
+ { label: 'View as Gallery', icon: <GridIcon />, checked: view === 'gallery', onSelect: () => setView('gallery') },
101
+ { label: 'Delete', destructive: true, onSelect: remove },
102
+ ]}
103
+ />
104
+
85
105
  <GlassSegmented options={['Chat', 'Work']} value={mode} onChange={setMode} />
86
106
  <GlassSegmented size="sm" options={[{ label: 'Light', icon: <SunIcon /> }, 'Dark']} value={t} onChange={setT} />
87
107
 
@@ -94,25 +114,40 @@ Works with Next.js (the bundle is marked `"use client"`), Vite and CRA.
94
114
  <GlassCard variant="clear">…</GlassCard>
95
115
 
96
116
  <GlassSheet open={open} onClose={() => setOpen(false)} aria-label="Details">…</GlassSheet>
117
+ <GlassSheet open={open} onClose={() => setOpen(false)} detents={['medium', 'large']} aria-label="Details">…</GlassSheet>
97
118
  ```
98
119
 
99
120
  Sliders drag continuously by default (`step="any"`). Pass a numeric `step`, such as `step={5}`, when values should snap to fixed increments. `onChange` receives the full-precision value while block labels show a rounded number.
100
121
 
122
+ Pass a positioned element as a sheet's `container` to keep the sheet inside that element without locking page scrolling. Sheets use the full viewport by default.
123
+
101
124
  ### Props reference
102
125
 
103
126
  | Component | Props |
104
127
  | --- | --- |
105
128
  | `GlassButton` | `variant` (`glass` · `clear` · `tinted` · `filled`), `destructive`, `tint`, `size`, `icon`, `shimmer`, `intensity`, `thickness`, plus all `<button>` props |
106
129
  | `GlassSwitch` | `checked`, `defaultChecked`, `onChange(checked)`, `tint`, `disabled`, `intensity` |
107
- | `GlassNav` | `items: { label, icon? }[]`, `activeIndex`, `onChange(index)`, `intensity` |
130
+ | `GlassNav` | `items: { label, icon? }[]`, `activeIndex`, `onChange(index)`, `showLabels`, `intensity` |
131
+ | `GlassMenu` | `icon`, `items: { label, icon?, checked?, destructive?, disabled?, onSelect? }[]`, `aria-label`, `align` (`end` · `start`), `size`, `width`, `check` |
108
132
  | `GlassSegmented` | `options: (string \| { label, icon? })[]`, `value`, `onChange(index)`, `size` (`sm` · `md`), `intensity` |
109
133
  | `GlassSlider` | `value`, `min`, `max`, `step`, `onChange(value)`, `showThumb`, `icon`, `label`, `tint`, `intensity` |
110
134
  | `GlassInput` | `type`, `value`, `onChange(event)`, `placeholder`, `label`, `icon`, `trailing`, `onClear`, `tint`, `intensity` |
111
135
  | `GlassCard` | `variant` (`regular` · `clear`), `padding`, `radius`, `tint`, `thickness`, `intensity` |
112
- | `GlassSheet` | `open`, `onClose()`, `tint`, `aria-label`, `intensity` |
136
+ | `GlassSheet` | `open`, `onClose()`, `detents` (`['medium', 'large']`), `container`, `tint`, `aria-label`, `intensity` |
113
137
 
114
138
  `intensity` (1–10) scales refraction strength everywhere.
115
139
 
140
+ ## Lightweight
141
+
142
+ About **31 KB of JavaScript and 5.5 KB of CSS gzipped**, with **no runtime dependencies** (React and React DOM are peers).
143
+
144
+ - Refraction maps are computed once per glass size, cached and shared, then drawn by the browser. Nothing is recalculated while you scroll.
145
+ - Springs run on one shared animation frame loop and stop when they settle.
146
+ - Lens copies only copy and lay out content while a control is pressed, and stop entirely off screen.
147
+ - The demo page, with 99 glass elements, holds about 11 MB of JavaScript memory and renders at 60 fps in Chrome.
148
+
149
+ The GPU cost is in what moves *under* the glass. Keep large refracting panels over static or slow content, prefer a few large glass surfaces over many small overlapping ones, and lower `intensity` (or use `GlassCard variant="clear"`) for low-end devices.
150
+
116
151
  ## Light and dark
117
152
 
118
153
  Tokens follow `prefers-color-scheme`. To force a theme, set `data-theme="light"` or `data-theme="dark"` on any ancestor. Override any `--lg-*` variable to restyle, e.g. `--lg-accent`, `--lg-fill` or `--lg-blur`.
@@ -134,8 +169,8 @@ function Droplet() {
134
169
 
135
170
  ## Browser support
136
171
 
137
- - **Chrome / Edge / Arc:** live refraction of anything behind the glass through `backdrop-filter: url(#svg)`.
138
- - **Safari:** lenses (switch, slider, tab bar, segmented) refract a live copy of the content beneath them, including magnification and the colour split. Bars, buttons and cards over arbitrary page content get frosting, rims and motion.
172
+ - **Chrome / Edge / Arc:** live refraction of anything behind the glass through `backdrop-filter: url(#svg)`. Tab and segmented lenses refract a tinted live copy of the bar, so everything inside the lens takes the active colour.
173
+ - **Safari:** lenses (switch, slider, tab bar, segmented) show a magnified live copy of the content beneath them. Bars, buttons and cards over arbitrary page content get frosting, rims and motion.
139
174
  - **Firefox:** uses the same path as Safari; not yet tested.
140
175
  - Respects `prefers-reduced-motion` and `prefers-reduced-transparency`.
141
176
 
package/dist/index.css CHANGED
@@ -20,16 +20,17 @@
20
20
  --lg-lens-edge: rgb(0 0 0 / 0.07);
21
21
  --lg-lens-ring: rgb(0 0 0 / 0.22);
22
22
  --lg-navigation-fill: rgb(255 255 255 / 0.48);
23
- --lg-selection-lens-fill: rgb(255 255 255 / 0.025);
23
+ --lg-selection-lens-fill: rgb(255 255 255 / 0.55);
24
24
  --lg-selection-lens-edge: rgb(45 48 53 / 0.28);
25
25
  --lg-selection-lens-bevel: inset 0 3px 7px rgb(45 48 53 / 0.1), inset 0 -1px 2px rgb(255 255 255 / 0.8);
26
26
  --lg-selection-lens-brightness: 1;
27
27
  --lg-switch-face-fade: 1;
28
28
  --lg-panel-fill: rgb(255 255 255 / 0.62);
29
+ --lg-menu-fill: rgb(250 250 252 / 0.94);
29
30
  --lg-panel-blur: 28px;
30
31
  --lg-tab-selection: rgb(0 0 0 / 0.07);
31
32
  --lg-segment-selection: rgb(0 0 0 / 0.08);
32
- --lg-track: rgb(120 120 128 / 0.16);
33
+ --lg-track: rgb(120 120 128 / 0.26);
33
34
  --lg-rail: rgb(120 120 128 / 0.2);
34
35
  --lg-block-well: rgb(120 120 128 / 0.24);
35
36
  --lg-block-lit: #ffffff;
@@ -71,15 +72,16 @@
71
72
  --lg-lens-edge: rgb(255 255 255 / 0.12);
72
73
  --lg-lens-ring: rgb(255 255 255 / 0.3);
73
74
  --lg-navigation-fill: var(--lg-fill);
74
- --lg-selection-lens-fill: rgb(255 255 255 / 0.06);
75
+ --lg-selection-lens-fill: rgb(255 255 255 / 0.09);
75
76
  --lg-selection-lens-edge: rgb(255 255 255 / 0.25);
76
77
  --lg-selection-lens-bevel: inset 0 0 0 transparent;
77
78
  --lg-selection-lens-brightness: 1.06;
78
79
  --lg-switch-face-fade: 0.92;
79
80
  --lg-panel-fill: rgb(30 30 33 / 0.62);
81
+ --lg-menu-fill: rgb(38 38 42 / 0.94);
80
82
  --lg-tab-selection: rgb(0 0 0 / 0.36);
81
83
  --lg-segment-selection: rgb(255 255 255 / 0.14);
82
- --lg-track: rgb(120 120 128 / 0.36);
84
+ --lg-track: rgb(120 120 128 / 0.44);
83
85
  --lg-rail: rgb(120 120 128 / 0.4);
84
86
  --lg-block-well: rgb(120 120 128 / 0.3);
85
87
  --lg-block-lit: #ffffff;
@@ -111,15 +113,16 @@
111
113
  --lg-lens-edge: rgb(255 255 255 / 0.12);
112
114
  --lg-lens-ring: rgb(255 255 255 / 0.3);
113
115
  --lg-navigation-fill: var(--lg-fill);
114
- --lg-selection-lens-fill: rgb(255 255 255 / 0.06);
116
+ --lg-selection-lens-fill: rgb(255 255 255 / 0.09);
115
117
  --lg-selection-lens-edge: rgb(255 255 255 / 0.25);
116
118
  --lg-selection-lens-bevel: inset 0 0 0 transparent;
117
119
  --lg-selection-lens-brightness: 1.06;
118
120
  --lg-switch-face-fade: 0.92;
119
121
  --lg-panel-fill: rgb(30 30 33 / 0.62);
122
+ --lg-menu-fill: rgb(38 38 42 / 0.94);
120
123
  --lg-tab-selection: rgb(0 0 0 / 0.36);
121
124
  --lg-segment-selection: rgb(255 255 255 / 0.14);
122
- --lg-track: rgb(120 120 128 / 0.36);
125
+ --lg-track: rgb(120 120 128 / 0.44);
123
126
  --lg-rail: rgb(120 120 128 / 0.4);
124
127
  --lg-thumb-shadow: 0 3px 8px rgb(0 0 0 / 0.3), 0 1px 1px rgb(0 0 0 / 0.16);
125
128
  --lg-block-well: rgb(120 120 128 / 0.3);
@@ -499,6 +502,19 @@
499
502
  .lg-sheet::after {
500
503
  display: none;
501
504
  }
505
+ .lg-sheet--detents.lg-glass {
506
+ --lg-sheet-run: 160px;
507
+ width: min(640px, 100%);
508
+ height: calc(100% - 10px + var(--lg-sheet-run));
509
+ max-height: none;
510
+ margin-bottom: calc(-1 * var(--lg-sheet-run));
511
+ padding-bottom: var(--lg-sheet-run);
512
+ border-radius: 38px 38px 0 0;
513
+ }
514
+ .lg-sheet--detents:not([data-raised]) {
515
+ overflow: hidden;
516
+ touch-action: none;
517
+ }
502
518
  .lg-sheet__grabber-zone {
503
519
  display: flex;
504
520
  justify-content: center;
@@ -516,6 +532,113 @@
516
532
  padding: 8px 24px 28px;
517
533
  }
518
534
 
535
+ /* src/components/GlassMenu/GlassMenu.css */
536
+ .lg-menu-anchor {
537
+ position: relative;
538
+ display: inline-flex;
539
+ flex: none;
540
+ }
541
+ .lg-menu-surface {
542
+ position: absolute;
543
+ top: 0;
544
+ right: 0;
545
+ z-index: 50;
546
+ color: var(--lg-fg);
547
+ font-family: var(--lg-font);
548
+ touch-action: none;
549
+ }
550
+ .lg-menu-anchor[data-align=start] .lg-menu-surface {
551
+ right: auto;
552
+ left: 0;
553
+ }
554
+ .lg-menu.lg-glass {
555
+ --lg-glass-fill: var(--lg-menu-fill);
556
+ --lg-glass-blur: var(--lg-panel-blur);
557
+ position: absolute;
558
+ inset: 0;
559
+ box-shadow: 0 12px 40px rgb(0 0 0 / 0.16), inset 0 0 0 0.5px var(--lg-edge);
560
+ transform-origin: top right;
561
+ transition: none;
562
+ pointer-events: none;
563
+ }
564
+ .lg-menu-anchor[data-align=start] .lg-menu.lg-glass {
565
+ transform-origin: top left;
566
+ }
567
+ .lg-menu::after {
568
+ display: none;
569
+ }
570
+ .lg-menu__content {
571
+ position: absolute;
572
+ top: 0;
573
+ right: 0;
574
+ z-index: 1;
575
+ box-sizing: border-box;
576
+ padding: 6px;
577
+ transform-origin: top right;
578
+ }
579
+ .lg-menu-anchor[data-align=start] .lg-menu__content {
580
+ right: auto;
581
+ left: 0;
582
+ transform-origin: top left;
583
+ }
584
+ .lg-menu__item {
585
+ display: flex;
586
+ align-items: center;
587
+ gap: 12px;
588
+ width: 100%;
589
+ min-height: 44px;
590
+ padding: 0 14px;
591
+ border: 0;
592
+ border-radius: 18px;
593
+ background: none;
594
+ color: inherit;
595
+ font: inherit;
596
+ font-size: 15px;
597
+ text-align: left;
598
+ cursor: pointer;
599
+ user-select: none;
600
+ -webkit-user-select: none;
601
+ -webkit-touch-callout: none;
602
+ -webkit-tap-highlight-color: transparent;
603
+ }
604
+ .lg-menu__item:hover,
605
+ .lg-menu__item[data-active],
606
+ .lg-menu__item:focus-visible {
607
+ background: color-mix(in srgb, var(--lg-fg) 8%, transparent);
608
+ outline: none;
609
+ }
610
+ .lg-menu__item:disabled {
611
+ opacity: 0.4;
612
+ cursor: default;
613
+ }
614
+ .lg-menu__item[data-destructive] {
615
+ color: var(--lg-tint-default, #ff3b30);
616
+ }
617
+ .lg-menu__icon {
618
+ display: grid;
619
+ place-items: center;
620
+ width: 20px;
621
+ height: 20px;
622
+ flex: none;
623
+ }
624
+ .lg-menu__icon > :is(svg, .lg-symbol) {
625
+ width: 100%;
626
+ height: 100%;
627
+ }
628
+ .lg-menu__label {
629
+ flex: 1;
630
+ min-width: 0;
631
+ overflow: hidden;
632
+ text-overflow: ellipsis;
633
+ white-space: nowrap;
634
+ }
635
+ .lg-menu__check {
636
+ display: grid;
637
+ place-items: center;
638
+ flex: none;
639
+ color: var(--lg-accent);
640
+ }
641
+
519
642
  /* src/components/internal/LensTrack.css */
520
643
  .lg-track {
521
644
  --lg-pad: 4px;
@@ -621,6 +744,10 @@
621
744
  }
622
745
  .lg-track__lens.lg-glass::before {
623
746
  opacity: calc(var(--lg-lift) * 1.2);
747
+ z-index: 2;
748
+ }
749
+ .lg-track__lens.lg-glass::after {
750
+ display: none;
624
751
  }
625
752
  .lg-track__select {
626
753
  z-index: 1;
@@ -632,7 +759,9 @@
632
759
  }
633
760
  .lg-track[data-lifted] .lg-track__lens.lg-glass {
634
761
  z-index: 4;
635
- -webkit-backdrop-filter: blur(0.6px) saturate(1.5) brightness(var(--lg-selection-lens-brightness));
762
+ }
763
+ .lg-track[data-lifted] .lg-track__lens.lg-glass[data-lg-refract] {
764
+ -webkit-backdrop-filter: var(--lg-filter, ) blur(0.3px) saturate(1.5) brightness(var(--lg-selection-lens-brightness));
636
765
  backdrop-filter: var(--lg-filter, ) blur(0.3px) saturate(1.5) brightness(var(--lg-selection-lens-brightness));
637
766
  }
638
767
  .lg-track:not([data-ready]) .lg-track__lens {
@@ -640,7 +769,7 @@
640
769
  }
641
770
  .lg-track--tabbar {
642
771
  --lg-navigation-fill: var(--lg-fill);
643
- --lg-selection-lens-fill: rgb(255 255 255 / 0.06);
772
+ --lg-selection-lens-fill: rgb(255 255 255 / 0.09);
644
773
  --lg-selection-lens-edge: rgb(255 255 255 / 0.25);
645
774
  --lg-selection-lens-bevel: inset 0 0 0 transparent;
646
775
  --lg-selection-lens-brightness: 1.06;
@@ -662,6 +791,10 @@
662
791
  .lg-track--tabbar .lg-nav__label {
663
792
  line-height: 1.1;
664
793
  }
794
+ .lg-track--tabbar.lg-track--icons-only .lg-nav__icon {
795
+ width: 28px;
796
+ height: 28px;
797
+ }
665
798
  .lg-track--tabbar.lg-track--labels-only {
666
799
  --lg-item-h: 44px;
667
800
  font-size: 15px;
@@ -690,6 +823,34 @@
690
823
  --lg-pad: 3px;
691
824
  font-size: 13px;
692
825
  }
826
+ .lg-track[data-lg-copy] > .lg-track__item {
827
+ color: var(--lg-track-active, var(--lg-accent));
828
+ }
829
+ .lg-track[data-lg-copy] .lg-nav__label {
830
+ background: none;
831
+ color: var(--lg-track-active, var(--lg-accent));
832
+ -webkit-text-fill-color: currentColor;
833
+ }
834
+ .lg-track[data-lg-copy] .lg-nav__icon > .lg-symbol {
835
+ background: var(--lg-track-active, var(--lg-accent));
836
+ }
837
+ [data-lg-copy] > :is(.lg-track__glass, .lg-track__select) {
838
+ visibility: hidden;
839
+ }
840
+ .lg-track[data-lifted]:not([data-lg-copy]) > .lg-track__item :is(.lg-nav__label, .lg-nav__icon) {
841
+ -webkit-mask: var(--lg-content-hide, none);
842
+ mask: var(--lg-content-hide, none);
843
+ -webkit-mask-composite:
844
+ source-out,
845
+ source-over,
846
+ source-over,
847
+ source-over;
848
+ mask-composite:
849
+ subtract,
850
+ add,
851
+ add,
852
+ add;
853
+ }
693
854
  .lg-track:not([data-lifted]) .lg-track__lens > .lg-mirror {
694
855
  visibility: hidden;
695
856
  }
@@ -697,6 +858,7 @@
697
858
  /* src/components/GlassSlider/GlassSlider.css */
698
859
  .lg-slider {
699
860
  --lg-lift: 0;
861
+ --lg-over: 0px;
700
862
  position: relative;
701
863
  width: 100%;
702
864
  height: 38px;
@@ -704,6 +866,9 @@
704
866
  touch-action: none;
705
867
  cursor: pointer;
706
868
  -webkit-tap-highlight-color: transparent;
869
+ user-select: none;
870
+ -webkit-user-select: none;
871
+ -webkit-touch-callout: none;
707
872
  }
708
873
  .lg-slider[data-lifted],
709
874
  .lg-slider[data-dragging] {
@@ -724,7 +889,7 @@
724
889
  .lg-slider__fill {
725
890
  display: block;
726
891
  height: 100%;
727
- width: calc(19px + (100% - 38px) * var(--lg-progress));
892
+ width: calc(19px + (100% - 38px) * var(--lg-progress) + 19px * (min(0, var(--lg-progress) / 0.12 - 1) + max(0, (var(--lg-progress) - 0.88) / 0.12)));
728
893
  border-radius: inherit;
729
894
  background: var(--lg-slider-fill, var(--lg-accent));
730
895
  }
@@ -732,6 +897,7 @@
732
897
  position: absolute;
733
898
  top: 50%;
734
899
  left: calc(19px + (100% - 38px) * var(--lg-progress));
900
+ translate: var(--lg-over) 0;
735
901
  width: 0;
736
902
  height: 0;
737
903
  pointer-events: none;
@@ -755,12 +921,12 @@
755
921
  transition: none;
756
922
  will-change: scale;
757
923
  }
758
- .lg-slider[data-lifted] .lg-slider__thumb.lg-glass {
759
- -webkit-backdrop-filter: blur(0.5px) saturate(1.6) brightness(1.08);
924
+ .lg-slider[data-lifted] .lg-slider__thumb.lg-glass[data-lg-refract] {
925
+ -webkit-backdrop-filter: var(--lg-filter, ) blur(0.3px) saturate(1.6) brightness(1.08);
760
926
  backdrop-filter: var(--lg-filter, ) blur(0.3px) saturate(1.6) brightness(1.08);
761
927
  }
762
928
  .lg-slider[data-mirror] > .lg-slider__rail {
763
- --x: calc(19px + (100% - 38px) * var(--lg-progress));
929
+ --x: calc(19px + (100% - 38px) * var(--lg-progress) + var(--lg-over));
764
930
  --r: calc(26px * var(--lg-lift));
765
931
  -webkit-mask-image:
766
932
  linear-gradient(
@@ -889,11 +1055,14 @@
889
1055
  margin: 0;
890
1056
  border: 0;
891
1057
  border-radius: 999px;
892
- background: var(--lg-track);
1058
+ background: none;
893
1059
  cursor: pointer;
894
1060
  touch-action: none;
895
1061
  -webkit-tap-highlight-color: transparent;
896
1062
  vertical-align: middle;
1063
+ user-select: none;
1064
+ -webkit-user-select: none;
1065
+ -webkit-touch-callout: none;
897
1066
  }
898
1067
  .lg-switch::before {
899
1068
  content: "";
@@ -903,6 +1072,34 @@
903
1072
  .lg-switch[data-lifted] {
904
1073
  z-index: 10;
905
1074
  }
1075
+ .lg-switch__track {
1076
+ position: absolute;
1077
+ inset: 0;
1078
+ border-radius: inherit;
1079
+ background: var(--lg-track);
1080
+ pointer-events: none;
1081
+ }
1082
+ .lg-switch[data-lifted]:not([data-lg-copy]) > .lg-switch__track,
1083
+ .lg-switch[data-lifted]:not([data-lg-copy]) > .lg-switch__fill {
1084
+ --a: clamp(0px, var(--lg-knob-x) - var(--lg-hole) - 7px, 100%);
1085
+ --b: clamp(0px, var(--lg-knob-x) - var(--lg-hole) + 5px, 100%);
1086
+ --c: clamp(0px, var(--lg-knob-x) + var(--lg-hole) - 5px, 100%);
1087
+ --d: clamp(0px, var(--lg-knob-x) + var(--lg-hole) + 7px, 100%);
1088
+ -webkit-mask-image:
1089
+ linear-gradient(
1090
+ 90deg,
1091
+ #000 var(--a),
1092
+ transparent var(--b),
1093
+ transparent var(--c),
1094
+ #000 var(--d));
1095
+ mask-image:
1096
+ linear-gradient(
1097
+ 90deg,
1098
+ #000 var(--a),
1099
+ transparent var(--b),
1100
+ transparent var(--c),
1101
+ #000 var(--d));
1102
+ }
906
1103
  .lg-switch__fill {
907
1104
  position: absolute;
908
1105
  inset: 0;