glasslikeui 1.1.0 → 1.2.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 +21 -21
- package/README.md +215 -215
- package/dist/components/glass/Glass.svelte +165 -164
- package/dist/components/glass/GlassCard.svelte +71 -71
- package/dist/components/glass/GlassDimLayer.svelte +37 -37
- package/dist/components/glass/GlassEffectContainer.svelte +58 -58
- package/dist/components/glass/GlassMorph.svelte +42 -42
- package/dist/components/glass/GlassSection.svelte +82 -82
- package/dist/components/glass/LensFilters.svelte +41 -41
- package/dist/components/glass/Sheet.svelte +261 -266
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/interactive/Badge.svelte +52 -52
- package/dist/components/interactive/Button.svelte +168 -168
- package/dist/components/interactive/IconButton.svelte +74 -74
- package/dist/components/interactive/TabView.svelte +1 -1
- package/dist/components/layout/Divider.svelte +31 -31
- package/dist/components/layout/Grid.svelte +52 -52
- package/dist/components/layout/HStack.svelte +76 -76
- package/dist/components/layout/ScrollView.svelte +84 -83
- package/dist/components/layout/Spacer.svelte +18 -18
- package/dist/components/layout/VStack.svelte +56 -56
- package/dist/components/layout/ZStack.svelte +51 -51
- package/dist/components/list/List.svelte +50 -50
- package/dist/components/list/ListRow.svelte +181 -181
- package/dist/components/media/SymbolImage.svelte +46 -46
- package/dist/components/menu/Menu.svelte +189 -0
- package/dist/components/menu/Menu.svelte.d.ts +10 -0
- package/dist/components/menu/MenuItem.svelte +114 -0
- package/dist/components/menu/MenuItem.svelte.d.ts +12 -0
- package/dist/components/menu/index.d.ts +6 -0
- package/dist/components/menu/index.js +6 -0
- package/dist/components/navigation/NavigationBar.svelte +195 -195
- package/dist/components/navigation/NavigationLink.svelte +45 -45
- package/dist/components/typography/Text.svelte +98 -98
- package/dist/icons/index.js +4 -1
- package/dist/styles/glasslikeui.css +192 -192
- package/dist/styles/lens.css +93 -93
- package/dist/styles/squircle.css +17 -17
- package/dist/styles/typography.css +27 -27
- package/package.json +50 -50
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
children: Snippet;
|
|
6
|
-
size?: 'xs' | 'sm' | 'body' | 'callout' | 'headline' | 'title1' | 'title2' | 'title3' | 'largeTitle' | 'hero';
|
|
7
|
-
weight?: 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy';
|
|
8
|
-
color?: 'primary' | 'secondary' | 'tertiary' | 'accent' | 'white' | 'danger';
|
|
9
|
-
alignment?: 'leading' | 'center' | 'trailing';
|
|
10
|
-
gradient?: boolean;
|
|
11
|
-
class?: string;
|
|
12
|
-
id?: string | undefined;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
let {
|
|
16
|
-
children,
|
|
17
|
-
size = 'body',
|
|
18
|
-
weight = 'regular',
|
|
19
|
-
color = 'primary',
|
|
20
|
-
alignment = 'leading',
|
|
21
|
-
gradient = false,
|
|
22
|
-
class: className = '',
|
|
23
|
-
id
|
|
24
|
-
}: Props = $props();
|
|
25
|
-
|
|
26
|
-
const sizeMap = {
|
|
27
|
-
xs: { fontSize: '0.6875rem', lineHeight: '1.4' },
|
|
28
|
-
sm: { fontSize: '0.8125rem', lineHeight: '1.4' },
|
|
29
|
-
body: { fontSize: '1rem', lineHeight: '1.6' },
|
|
30
|
-
callout: { fontSize: '1.0625rem', lineHeight: '1.5' },
|
|
31
|
-
headline: { fontSize: '1.125rem', lineHeight: '1.4' },
|
|
32
|
-
title3: { fontSize: '1.25rem', lineHeight: '1.3' },
|
|
33
|
-
title2: { fontSize: '1.5rem', lineHeight: '1.25' },
|
|
34
|
-
title1: { fontSize: 'clamp(1.75rem, 4vw, 2rem)', lineHeight: '1.2' },
|
|
35
|
-
largeTitle: { fontSize: 'clamp(2rem, 5vw, 3rem)', lineHeight: '1.1' },
|
|
36
|
-
hero: { fontSize: 'clamp(3rem, 12vw, 6rem)', lineHeight: '1' }
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const weightMap = {
|
|
40
|
-
regular: 400,
|
|
41
|
-
medium: 500,
|
|
42
|
-
semibold: 600,
|
|
43
|
-
bold: 700,
|
|
44
|
-
heavy: 800
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const colorMap = {
|
|
48
|
-
primary: 'var(--color-text)',
|
|
49
|
-
secondary: 'var(--color-text-secondary)',
|
|
50
|
-
tertiary: 'var(--color-text-tertiary)',
|
|
51
|
-
accent: 'var(--color-accent)',
|
|
52
|
-
white: '#ffffff',
|
|
53
|
-
danger: 'var(--color-danger, #ef4444)'
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const alignmentMap = {
|
|
57
|
-
leading: 'left',
|
|
58
|
-
center: 'center',
|
|
59
|
-
trailing: 'right'
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const styles = $derived(sizeMap[size]);
|
|
63
|
-
</script>
|
|
64
|
-
|
|
65
|
-
<span
|
|
66
|
-
{id}
|
|
67
|
-
class="text {className}"
|
|
68
|
-
class:gradient
|
|
69
|
-
style="
|
|
70
|
-
--text-size: {styles.fontSize};
|
|
71
|
-
--text-line-height: {styles.lineHeight};
|
|
72
|
-
--text-weight: {weightMap[weight]};
|
|
73
|
-
--text-color: {colorMap[color]};
|
|
74
|
-
--text-align: {alignmentMap[alignment]};
|
|
75
|
-
"
|
|
76
|
-
>
|
|
77
|
-
{@render children()}
|
|
78
|
-
</span>
|
|
79
|
-
|
|
80
|
-
<style>
|
|
81
|
-
.text {
|
|
82
|
-
display: block;
|
|
83
|
-
font-family: var(--font-system);
|
|
84
|
-
font-size: calc(var(--text-size) * var(--dynamic-type-scale, 1));
|
|
85
|
-
line-height: var(--text-line-height);
|
|
86
|
-
font-weight: var(--text-weight);
|
|
87
|
-
color: var(--text-color);
|
|
88
|
-
text-align: var(--text-align);
|
|
89
|
-
letter-spacing: -0.01em;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.text.gradient {
|
|
93
|
-
background: var(--glass-text-gradient);
|
|
94
|
-
-webkit-background-clip: text;
|
|
95
|
-
-webkit-text-fill-color: transparent;
|
|
96
|
-
background-clip: text;
|
|
97
|
-
}
|
|
98
|
-
</style>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
children: Snippet;
|
|
6
|
+
size?: 'xs' | 'sm' | 'body' | 'callout' | 'headline' | 'title1' | 'title2' | 'title3' | 'largeTitle' | 'hero';
|
|
7
|
+
weight?: 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy';
|
|
8
|
+
color?: 'primary' | 'secondary' | 'tertiary' | 'accent' | 'white' | 'danger';
|
|
9
|
+
alignment?: 'leading' | 'center' | 'trailing';
|
|
10
|
+
gradient?: boolean;
|
|
11
|
+
class?: string;
|
|
12
|
+
id?: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
children,
|
|
17
|
+
size = 'body',
|
|
18
|
+
weight = 'regular',
|
|
19
|
+
color = 'primary',
|
|
20
|
+
alignment = 'leading',
|
|
21
|
+
gradient = false,
|
|
22
|
+
class: className = '',
|
|
23
|
+
id
|
|
24
|
+
}: Props = $props();
|
|
25
|
+
|
|
26
|
+
const sizeMap = {
|
|
27
|
+
xs: { fontSize: '0.6875rem', lineHeight: '1.4' },
|
|
28
|
+
sm: { fontSize: '0.8125rem', lineHeight: '1.4' },
|
|
29
|
+
body: { fontSize: '1rem', lineHeight: '1.6' },
|
|
30
|
+
callout: { fontSize: '1.0625rem', lineHeight: '1.5' },
|
|
31
|
+
headline: { fontSize: '1.125rem', lineHeight: '1.4' },
|
|
32
|
+
title3: { fontSize: '1.25rem', lineHeight: '1.3' },
|
|
33
|
+
title2: { fontSize: '1.5rem', lineHeight: '1.25' },
|
|
34
|
+
title1: { fontSize: 'clamp(1.75rem, 4vw, 2rem)', lineHeight: '1.2' },
|
|
35
|
+
largeTitle: { fontSize: 'clamp(2rem, 5vw, 3rem)', lineHeight: '1.1' },
|
|
36
|
+
hero: { fontSize: 'clamp(3rem, 12vw, 6rem)', lineHeight: '1' }
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const weightMap = {
|
|
40
|
+
regular: 400,
|
|
41
|
+
medium: 500,
|
|
42
|
+
semibold: 600,
|
|
43
|
+
bold: 700,
|
|
44
|
+
heavy: 800
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const colorMap = {
|
|
48
|
+
primary: 'var(--color-text)',
|
|
49
|
+
secondary: 'var(--color-text-secondary)',
|
|
50
|
+
tertiary: 'var(--color-text-tertiary)',
|
|
51
|
+
accent: 'var(--color-accent)',
|
|
52
|
+
white: '#ffffff',
|
|
53
|
+
danger: 'var(--color-danger, #ef4444)'
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const alignmentMap = {
|
|
57
|
+
leading: 'left',
|
|
58
|
+
center: 'center',
|
|
59
|
+
trailing: 'right'
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const styles = $derived(sizeMap[size]);
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<span
|
|
66
|
+
{id}
|
|
67
|
+
class="text {className}"
|
|
68
|
+
class:gradient
|
|
69
|
+
style="
|
|
70
|
+
--text-size: {styles.fontSize};
|
|
71
|
+
--text-line-height: {styles.lineHeight};
|
|
72
|
+
--text-weight: {weightMap[weight]};
|
|
73
|
+
--text-color: {colorMap[color]};
|
|
74
|
+
--text-align: {alignmentMap[alignment]};
|
|
75
|
+
"
|
|
76
|
+
>
|
|
77
|
+
{@render children()}
|
|
78
|
+
</span>
|
|
79
|
+
|
|
80
|
+
<style>
|
|
81
|
+
.text {
|
|
82
|
+
display: block;
|
|
83
|
+
font-family: var(--font-system);
|
|
84
|
+
font-size: calc(var(--text-size) * var(--dynamic-type-scale, 1));
|
|
85
|
+
line-height: var(--text-line-height);
|
|
86
|
+
font-weight: var(--text-weight);
|
|
87
|
+
color: var(--text-color);
|
|
88
|
+
text-align: var(--text-align);
|
|
89
|
+
letter-spacing: -0.01em;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.text.gradient {
|
|
93
|
+
background: var(--glass-text-gradient);
|
|
94
|
+
-webkit-background-clip: text;
|
|
95
|
+
-webkit-text-fill-color: transparent;
|
|
96
|
+
background-clip: text;
|
|
97
|
+
}
|
|
98
|
+
</style>
|
package/dist/icons/index.js
CHANGED
|
@@ -75,7 +75,10 @@ export var ICONS = {
|
|
|
75
75
|
// Status
|
|
76
76
|
'info': '<circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line>',
|
|
77
77
|
'warning': '<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line>',
|
|
78
|
-
'error': '<circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line>'
|
|
78
|
+
'error': '<circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line>',
|
|
79
|
+
// Weather / media
|
|
80
|
+
'cloud.sun': '<path d="M12 2v2"></path><path d="m4.93 4.93 1.41 1.41"></path><path d="M20 12h2"></path><path d="m19.07 4.93-1.41 1.41"></path><path d="M15.947 12.65a4 4 0 0 0-5.925-4.128"></path><path d="M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z"></path>',
|
|
81
|
+
'waveform': '<path d="M2 10v3"></path><path d="M6 6v11"></path><path d="M10 3v18"></path><path d="M14 8v7"></path><path d="M18 5v13"></path><path d="M22 10v3"></path>'
|
|
79
82
|
};
|
|
80
83
|
/** Default fallback icon name */
|
|
81
84
|
export var DEFAULT_ICON = 'star';
|
|
@@ -1,192 +1,192 @@
|
|
|
1
|
-
/* GlassLikeUI v1 design tokens.
|
|
2
|
-
* Import in your global styles. Mount <LensFilters /> once at app root
|
|
3
|
-
* for SVG filter defs.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
:root {
|
|
7
|
-
/* ========================================
|
|
8
|
-
Glass surface tokens (dark mode default)
|
|
9
|
-
======================================== */
|
|
10
|
-
|
|
11
|
-
/* Base surface color — variant-driven opacity applied at runtime */
|
|
12
|
-
--glass-surface-color: 28, 28, 30;
|
|
13
|
-
--glass-opacity: 0.30;
|
|
14
|
-
--glass-surface-bg: rgba(var(--glass-surface-color), var(--glass-opacity));
|
|
15
|
-
|
|
16
|
-
/* Core effect parameters (intensity-driven) */
|
|
17
|
-
--glass-blur: 20px;
|
|
18
|
-
--glass-displacement-scale: 8;
|
|
19
|
-
--glass-saturation: 1.8;
|
|
20
|
-
|
|
21
|
-
/* Edge + highlight tokens */
|
|
22
|
-
--glass-border: rgba(255, 255, 255, 0.12);
|
|
23
|
-
--glass-border-width: 0.5px;
|
|
24
|
-
--glass-highlight: rgba(255, 255, 255, 0.08);
|
|
25
|
-
--glass-shadow: rgba(0, 0, 0, 0.5);
|
|
26
|
-
--glass-shadow-inner: rgba(0, 0, 0, 0.2);
|
|
27
|
-
--glass-divider: rgba(255, 255, 255, 0.08);
|
|
28
|
-
--glass-handle: rgba(255, 255, 255, 0.3);
|
|
29
|
-
--glass-highlight-angle: 135deg;
|
|
30
|
-
--glass-motion-enabled: 1;
|
|
31
|
-
|
|
32
|
-
/* Interaction states */
|
|
33
|
-
--glass-hover-bg: rgba(255, 255, 255, 0.08);
|
|
34
|
-
--glass-hover-subtle: rgba(255, 255, 255, 0.04);
|
|
35
|
-
--glass-active-bg: rgba(255, 255, 255, 0.12);
|
|
36
|
-
--glass-active-subtle: rgba(255, 255, 255, 0.06);
|
|
37
|
-
|
|
38
|
-
/* Component helpers */
|
|
39
|
-
--glass-button-bg: rgba(255, 255, 255, 0.1);
|
|
40
|
-
--glass-button-hover: rgba(255, 255, 255, 0.15);
|
|
41
|
-
--glass-badge-bg: rgba(255, 255, 255, 0.08);
|
|
42
|
-
|
|
43
|
-
/* Navigation chrome */
|
|
44
|
-
--glass-nav-bg: rgba(0, 0, 0, 0.7);
|
|
45
|
-
--glass-blur-nav: 24px;
|
|
46
|
-
|
|
47
|
-
/* Sheet chrome */
|
|
48
|
-
--glass-sheet-bg: rgba(28, 28, 30, 0.80);
|
|
49
|
-
|
|
50
|
-
/* ========================================
|
|
51
|
-
Accent system
|
|
52
|
-
======================================== */
|
|
53
|
-
--color-accent: #0071e3;
|
|
54
|
-
--color-accent-hover: color-mix(in srgb, var(--color-accent) 85%, white);
|
|
55
|
-
--color-accent-active: color-mix(in srgb, var(--color-accent) 85%, black);
|
|
56
|
-
--color-accent-10: color-mix(in srgb, var(--color-accent) 10%, transparent);
|
|
57
|
-
--color-accent-15: color-mix(in srgb, var(--color-accent) 15%, transparent);
|
|
58
|
-
--color-accent-25: color-mix(in srgb, var(--color-accent) 25%, transparent);
|
|
59
|
-
--color-accent-50: color-mix(in srgb, var(--color-accent) 50%, transparent);
|
|
60
|
-
|
|
61
|
-
/* Semantic danger — adapts to light/dark via color-mix */
|
|
62
|
-
--color-danger: #ef4444;
|
|
63
|
-
--color-danger-hover: color-mix(in srgb, var(--color-danger) 85%, white);
|
|
64
|
-
--color-danger-active: color-mix(in srgb, var(--color-danger) 85%, black);
|
|
65
|
-
|
|
66
|
-
/* ========================================
|
|
67
|
-
Radius system
|
|
68
|
-
======================================== */
|
|
69
|
-
--glass-radius-sm: 12px;
|
|
70
|
-
--glass-radius-md: 18px;
|
|
71
|
-
--glass-radius-lg: 24px;
|
|
72
|
-
--glass-radius-xl: 32px;
|
|
73
|
-
--glass-radius-2xl: 44px;
|
|
74
|
-
--glass-radius-full: 9999px;
|
|
75
|
-
|
|
76
|
-
/* ========================================
|
|
77
|
-
Spacing system
|
|
78
|
-
======================================== */
|
|
79
|
-
--spacing-xs: 0.5rem;
|
|
80
|
-
--spacing-sm: 1rem;
|
|
81
|
-
--spacing-md: 1.5rem;
|
|
82
|
-
--spacing-lg: 2.5rem;
|
|
83
|
-
--spacing-xl: 4rem;
|
|
84
|
-
--spacing-2xl: 6rem;
|
|
85
|
-
|
|
86
|
-
/* ========================================
|
|
87
|
-
Transitions
|
|
88
|
-
======================================== */
|
|
89
|
-
--transition: 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
90
|
-
--transition-fast: 0.15s cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
91
|
-
--transition-spring: 0.4s cubic-bezier(0.32, 0.72, 0, 1);
|
|
92
|
-
|
|
93
|
-
/* ========================================
|
|
94
|
-
Layout caps
|
|
95
|
-
======================================== */
|
|
96
|
-
--max-width: 1200px;
|
|
97
|
-
--max-width-wide: 1440px;
|
|
98
|
-
|
|
99
|
-
/* Typography tokens are defined in styles/typography.css. */
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* ========================================
|
|
103
|
-
Light mode overrides
|
|
104
|
-
======================================== */
|
|
105
|
-
:root[data-theme='light'] {
|
|
106
|
-
--glass-surface-color: 255, 255, 255;
|
|
107
|
-
--glass-opacity: 0.22;
|
|
108
|
-
|
|
109
|
-
--glass-border: rgba(0, 0, 0, 0.06);
|
|
110
|
-
--glass-highlight: rgba(255, 255, 255, 0.8);
|
|
111
|
-
--glass-shadow: rgba(0, 0, 0, 0.12);
|
|
112
|
-
--glass-shadow-inner: rgba(0, 0, 0, 0.04);
|
|
113
|
-
--glass-divider: rgba(0, 0, 0, 0.06);
|
|
114
|
-
--glass-handle: rgba(0, 0, 0, 0.2);
|
|
115
|
-
|
|
116
|
-
--glass-hover-bg: rgba(0, 0, 0, 0.04);
|
|
117
|
-
--glass-hover-subtle: rgba(0, 0, 0, 0.02);
|
|
118
|
-
--glass-active-bg: rgba(0, 0, 0, 0.08);
|
|
119
|
-
--glass-active-subtle: rgba(0, 0, 0, 0.04);
|
|
120
|
-
|
|
121
|
-
--glass-button-bg: rgba(0, 0, 0, 0.05);
|
|
122
|
-
--glass-button-hover: rgba(0, 0, 0, 0.08);
|
|
123
|
-
--glass-badge-bg: rgba(0, 0, 0, 0.04);
|
|
124
|
-
|
|
125
|
-
--glass-nav-bg: rgba(255, 255, 255, 0.85);
|
|
126
|
-
--glass-sheet-bg: rgba(255, 255, 255, 0.88);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/* ========================================
|
|
130
|
-
Accessibility — dual path
|
|
131
|
-
Native media queries (Safari) + data-attribute fallback (cross-browser)
|
|
132
|
-
Consumers on Chrome/Firefox can wire matchMedia into data-attrs manually.
|
|
133
|
-
======================================== */
|
|
134
|
-
|
|
135
|
-
@media (prefers-reduced-transparency: reduce) {
|
|
136
|
-
:root {
|
|
137
|
-
--glass-opacity: 0.95;
|
|
138
|
-
--glass-blur: 0px;
|
|
139
|
-
--glass-displacement-scale: 0;
|
|
140
|
-
--glass-saturation: 1;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
:root[data-reduced-transparency='true'] {
|
|
144
|
-
--glass-opacity: 0.95;
|
|
145
|
-
--glass-blur: 0px;
|
|
146
|
-
--glass-displacement-scale: 0;
|
|
147
|
-
--glass-saturation: 1;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
@media (prefers-contrast: more) {
|
|
151
|
-
:root {
|
|
152
|
-
--glass-border-width: 1.5px;
|
|
153
|
-
--glass-opacity: 0.98;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
:root[data-contrast='more'] {
|
|
157
|
-
--glass-border-width: 1.5px;
|
|
158
|
-
--glass-opacity: 0.98;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
@media (prefers-reduced-motion: reduce) {
|
|
162
|
-
:root {
|
|
163
|
-
--transition: 0s;
|
|
164
|
-
--transition-fast: 0s;
|
|
165
|
-
--transition-spring: 0s;
|
|
166
|
-
--glass-motion-enabled: 0;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
:root[data-reduced-motion='true'] {
|
|
170
|
-
--transition: 0s;
|
|
171
|
-
--transition-fast: 0s;
|
|
172
|
-
--transition-spring: 0s;
|
|
173
|
-
--glass-motion-enabled: 0;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/* ========================================
|
|
177
|
-
No backdrop-filter support — opaque fallback
|
|
178
|
-
======================================== */
|
|
179
|
-
@supports not (backdrop-filter: blur(1px)) {
|
|
180
|
-
:root {
|
|
181
|
-
--glass-opacity: 0.92;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/* ========================================
|
|
186
|
-
Performance — reduce effect cost on small viewports
|
|
187
|
-
======================================== */
|
|
188
|
-
@media (max-width: 768px) {
|
|
189
|
-
:root {
|
|
190
|
-
--glass-blur-nav: 16px;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
1
|
+
/* GlassLikeUI v1 design tokens.
|
|
2
|
+
* Import in your global styles. Mount <LensFilters /> once at app root
|
|
3
|
+
* for SVG filter defs.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
/* ========================================
|
|
8
|
+
Glass surface tokens (dark mode default)
|
|
9
|
+
======================================== */
|
|
10
|
+
|
|
11
|
+
/* Base surface color — variant-driven opacity applied at runtime */
|
|
12
|
+
--glass-surface-color: 28, 28, 30;
|
|
13
|
+
--glass-opacity: 0.30;
|
|
14
|
+
--glass-surface-bg: rgba(var(--glass-surface-color), var(--glass-opacity));
|
|
15
|
+
|
|
16
|
+
/* Core effect parameters (intensity-driven) */
|
|
17
|
+
--glass-blur: 20px;
|
|
18
|
+
--glass-displacement-scale: 8;
|
|
19
|
+
--glass-saturation: 1.8;
|
|
20
|
+
|
|
21
|
+
/* Edge + highlight tokens */
|
|
22
|
+
--glass-border: rgba(255, 255, 255, 0.12);
|
|
23
|
+
--glass-border-width: 0.5px;
|
|
24
|
+
--glass-highlight: rgba(255, 255, 255, 0.08);
|
|
25
|
+
--glass-shadow: rgba(0, 0, 0, 0.5);
|
|
26
|
+
--glass-shadow-inner: rgba(0, 0, 0, 0.2);
|
|
27
|
+
--glass-divider: rgba(255, 255, 255, 0.08);
|
|
28
|
+
--glass-handle: rgba(255, 255, 255, 0.3);
|
|
29
|
+
--glass-highlight-angle: 135deg;
|
|
30
|
+
--glass-motion-enabled: 1;
|
|
31
|
+
|
|
32
|
+
/* Interaction states */
|
|
33
|
+
--glass-hover-bg: rgba(255, 255, 255, 0.08);
|
|
34
|
+
--glass-hover-subtle: rgba(255, 255, 255, 0.04);
|
|
35
|
+
--glass-active-bg: rgba(255, 255, 255, 0.12);
|
|
36
|
+
--glass-active-subtle: rgba(255, 255, 255, 0.06);
|
|
37
|
+
|
|
38
|
+
/* Component helpers */
|
|
39
|
+
--glass-button-bg: rgba(255, 255, 255, 0.1);
|
|
40
|
+
--glass-button-hover: rgba(255, 255, 255, 0.15);
|
|
41
|
+
--glass-badge-bg: rgba(255, 255, 255, 0.08);
|
|
42
|
+
|
|
43
|
+
/* Navigation chrome */
|
|
44
|
+
--glass-nav-bg: rgba(0, 0, 0, 0.7);
|
|
45
|
+
--glass-blur-nav: 24px;
|
|
46
|
+
|
|
47
|
+
/* Sheet chrome */
|
|
48
|
+
--glass-sheet-bg: rgba(28, 28, 30, 0.80);
|
|
49
|
+
|
|
50
|
+
/* ========================================
|
|
51
|
+
Accent system
|
|
52
|
+
======================================== */
|
|
53
|
+
--color-accent: #0071e3;
|
|
54
|
+
--color-accent-hover: color-mix(in srgb, var(--color-accent) 85%, white);
|
|
55
|
+
--color-accent-active: color-mix(in srgb, var(--color-accent) 85%, black);
|
|
56
|
+
--color-accent-10: color-mix(in srgb, var(--color-accent) 10%, transparent);
|
|
57
|
+
--color-accent-15: color-mix(in srgb, var(--color-accent) 15%, transparent);
|
|
58
|
+
--color-accent-25: color-mix(in srgb, var(--color-accent) 25%, transparent);
|
|
59
|
+
--color-accent-50: color-mix(in srgb, var(--color-accent) 50%, transparent);
|
|
60
|
+
|
|
61
|
+
/* Semantic danger — adapts to light/dark via color-mix */
|
|
62
|
+
--color-danger: #ef4444;
|
|
63
|
+
--color-danger-hover: color-mix(in srgb, var(--color-danger) 85%, white);
|
|
64
|
+
--color-danger-active: color-mix(in srgb, var(--color-danger) 85%, black);
|
|
65
|
+
|
|
66
|
+
/* ========================================
|
|
67
|
+
Radius system
|
|
68
|
+
======================================== */
|
|
69
|
+
--glass-radius-sm: 12px;
|
|
70
|
+
--glass-radius-md: 18px;
|
|
71
|
+
--glass-radius-lg: 24px;
|
|
72
|
+
--glass-radius-xl: 32px;
|
|
73
|
+
--glass-radius-2xl: 44px;
|
|
74
|
+
--glass-radius-full: 9999px;
|
|
75
|
+
|
|
76
|
+
/* ========================================
|
|
77
|
+
Spacing system
|
|
78
|
+
======================================== */
|
|
79
|
+
--spacing-xs: 0.5rem;
|
|
80
|
+
--spacing-sm: 1rem;
|
|
81
|
+
--spacing-md: 1.5rem;
|
|
82
|
+
--spacing-lg: 2.5rem;
|
|
83
|
+
--spacing-xl: 4rem;
|
|
84
|
+
--spacing-2xl: 6rem;
|
|
85
|
+
|
|
86
|
+
/* ========================================
|
|
87
|
+
Transitions
|
|
88
|
+
======================================== */
|
|
89
|
+
--transition: 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
90
|
+
--transition-fast: 0.15s cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
91
|
+
--transition-spring: 0.4s cubic-bezier(0.32, 0.72, 0, 1);
|
|
92
|
+
|
|
93
|
+
/* ========================================
|
|
94
|
+
Layout caps
|
|
95
|
+
======================================== */
|
|
96
|
+
--max-width: 1200px;
|
|
97
|
+
--max-width-wide: 1440px;
|
|
98
|
+
|
|
99
|
+
/* Typography tokens are defined in styles/typography.css. */
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* ========================================
|
|
103
|
+
Light mode overrides
|
|
104
|
+
======================================== */
|
|
105
|
+
:root[data-theme='light'] {
|
|
106
|
+
--glass-surface-color: 255, 255, 255;
|
|
107
|
+
--glass-opacity: 0.22;
|
|
108
|
+
|
|
109
|
+
--glass-border: rgba(0, 0, 0, 0.06);
|
|
110
|
+
--glass-highlight: rgba(255, 255, 255, 0.8);
|
|
111
|
+
--glass-shadow: rgba(0, 0, 0, 0.12);
|
|
112
|
+
--glass-shadow-inner: rgba(0, 0, 0, 0.04);
|
|
113
|
+
--glass-divider: rgba(0, 0, 0, 0.06);
|
|
114
|
+
--glass-handle: rgba(0, 0, 0, 0.2);
|
|
115
|
+
|
|
116
|
+
--glass-hover-bg: rgba(0, 0, 0, 0.04);
|
|
117
|
+
--glass-hover-subtle: rgba(0, 0, 0, 0.02);
|
|
118
|
+
--glass-active-bg: rgba(0, 0, 0, 0.08);
|
|
119
|
+
--glass-active-subtle: rgba(0, 0, 0, 0.04);
|
|
120
|
+
|
|
121
|
+
--glass-button-bg: rgba(0, 0, 0, 0.05);
|
|
122
|
+
--glass-button-hover: rgba(0, 0, 0, 0.08);
|
|
123
|
+
--glass-badge-bg: rgba(0, 0, 0, 0.04);
|
|
124
|
+
|
|
125
|
+
--glass-nav-bg: rgba(255, 255, 255, 0.85);
|
|
126
|
+
--glass-sheet-bg: rgba(255, 255, 255, 0.88);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* ========================================
|
|
130
|
+
Accessibility — dual path
|
|
131
|
+
Native media queries (Safari) + data-attribute fallback (cross-browser)
|
|
132
|
+
Consumers on Chrome/Firefox can wire matchMedia into data-attrs manually.
|
|
133
|
+
======================================== */
|
|
134
|
+
|
|
135
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
136
|
+
:root {
|
|
137
|
+
--glass-opacity: 0.95;
|
|
138
|
+
--glass-blur: 0px;
|
|
139
|
+
--glass-displacement-scale: 0;
|
|
140
|
+
--glass-saturation: 1;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
:root[data-reduced-transparency='true'] {
|
|
144
|
+
--glass-opacity: 0.95;
|
|
145
|
+
--glass-blur: 0px;
|
|
146
|
+
--glass-displacement-scale: 0;
|
|
147
|
+
--glass-saturation: 1;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@media (prefers-contrast: more) {
|
|
151
|
+
:root {
|
|
152
|
+
--glass-border-width: 1.5px;
|
|
153
|
+
--glass-opacity: 0.98;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
:root[data-contrast='more'] {
|
|
157
|
+
--glass-border-width: 1.5px;
|
|
158
|
+
--glass-opacity: 0.98;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@media (prefers-reduced-motion: reduce) {
|
|
162
|
+
:root {
|
|
163
|
+
--transition: 0s;
|
|
164
|
+
--transition-fast: 0s;
|
|
165
|
+
--transition-spring: 0s;
|
|
166
|
+
--glass-motion-enabled: 0;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
:root[data-reduced-motion='true'] {
|
|
170
|
+
--transition: 0s;
|
|
171
|
+
--transition-fast: 0s;
|
|
172
|
+
--transition-spring: 0s;
|
|
173
|
+
--glass-motion-enabled: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* ========================================
|
|
177
|
+
No backdrop-filter support — opaque fallback
|
|
178
|
+
======================================== */
|
|
179
|
+
@supports not (backdrop-filter: blur(1px)) {
|
|
180
|
+
:root {
|
|
181
|
+
--glass-opacity: 0.92;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* ========================================
|
|
186
|
+
Performance — reduce effect cost on small viewports
|
|
187
|
+
======================================== */
|
|
188
|
+
@media (max-width: 768px) {
|
|
189
|
+
:root {
|
|
190
|
+
--glass-blur-nav: 16px;
|
|
191
|
+
}
|
|
192
|
+
}
|