liquidglass-tailwind 0.1.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "liquidglass-tailwind",
3
+ "version": "0.1.0",
4
+ "description": "Apple Liquid Glass design system for Tailwind CSS — glass surfaces, refraction, specular highlights, and accessible translucent UI components",
5
+ "type": "module",
6
+ "main": "dist/index.cjs",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ },
15
+ "./theme": {
16
+ "types": "./dist/theme.d.ts",
17
+ "import": "./dist/theme.js",
18
+ "require": "./dist/theme.cjs"
19
+ },
20
+ "./filters.css": "./dist/filters.css"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "skill",
25
+ "scripts"
26
+ ],
27
+ "scripts": {
28
+ "build": "tsup",
29
+ "dev": "tsup --watch",
30
+ "typecheck": "tsc --noEmit",
31
+ "lint": "eslint src/",
32
+ "postinstall": "node scripts/postinstall.mjs",
33
+ "prepublishOnly": "npm run build"
34
+ },
35
+ "keywords": [
36
+ "tailwindcss",
37
+ "tailwind",
38
+ "plugin",
39
+ "liquid-glass",
40
+ "glassmorphism",
41
+ "apple",
42
+ "ios26",
43
+ "design-system",
44
+ "ui"
45
+ ],
46
+ "author": "",
47
+ "license": "MIT",
48
+ "peerDependencies": {
49
+ "tailwindcss": ">=3.4.0 || >=4.0.0"
50
+ },
51
+ "devDependencies": {
52
+ "tailwindcss": "^4.0.0",
53
+ "tsup": "^8.0.0",
54
+ "typescript": "^5.5.0"
55
+ }
56
+ }
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { mkdirSync, copyFileSync, existsSync } from "fs";
4
+ import { join, dirname } from "path";
5
+ import { homedir } from "os";
6
+ import { fileURLToPath } from "url";
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const skillSource = join(__dirname, "..", "skill", "liquidglass-design.md");
10
+ const skillDir = join(homedir(), ".claude", "skills");
11
+ const skillDest = join(skillDir, "liquidglass-design.md");
12
+
13
+ // Skip in CI environments
14
+ if (process.env.CI || process.env.CONTINUOUS_INTEGRATION) {
15
+ process.exit(0);
16
+ }
17
+
18
+ try {
19
+ mkdirSync(skillDir, { recursive: true });
20
+ copyFileSync(skillSource, skillDest);
21
+ console.log(
22
+ "\x1b[36m✓\x1b[0m Liquid Glass skill installed → ~/.claude/skills/liquidglass-design.md"
23
+ );
24
+ } catch {
25
+ // Silent fail — skill install is optional, plugin works without it
26
+ }
@@ -0,0 +1,332 @@
1
+ # Liquid Glass Design — Tailwind CSS
2
+
3
+ Apply Apple's iOS 26 Liquid Glass design language to web projects using native Tailwind CSS.
4
+
5
+ ## When to Use
6
+
7
+ Use this skill when:
8
+ - Building UI components that follow Apple's Liquid Glass aesthetic
9
+ - Creating glassmorphism cards, buttons, navbars, modals, or sheets
10
+ - Applying frosted glass, refraction, specular highlights to web elements
11
+ - The user mentions "liquid glass", "glass design", "iOS 26 style", or "glassmorphism"
12
+
13
+ ## Core Design Principles
14
+
15
+ ### 1. Contextual Transparency
16
+ Elements are semi-transparent, revealing blurred content beneath. The material adapts to its background — never fully opaque, never fully transparent.
17
+
18
+ ### 2. Floating Controls
19
+ UI elements appear to levitate above the content layer with subtle shadows and elevation. Hierarchy comes from depth, not heavy borders.
20
+
21
+ ### 3. Harmonized Radii
22
+ All corners use consistent, generous border-radius. Apple favors squircle-like curves (superellipse) over standard circles.
23
+
24
+ ### 4. Edge-to-Edge Content
25
+ Content fills the viewport. Chrome (navbars, toolbars) is minimal and translucent, letting content breathe.
26
+
27
+ ### 5. Subtle Refraction
28
+ Light appears to bend through glass elements, creating slight distortion of the background. This is the key differentiator from basic glassmorphism.
29
+
30
+ ## Tailwind CSS Implementation
31
+
32
+ ### Design Tokens (Tailwind v4 `@theme`)
33
+
34
+ ```css
35
+ @theme {
36
+ /* Glass backgrounds */
37
+ --color-glass-light: rgba(255, 255, 255, 0.15);
38
+ --color-glass-medium: rgba(255, 255, 255, 0.10);
39
+ --color-glass-subtle: rgba(255, 255, 255, 0.08);
40
+ --color-glass-strong: rgba(255, 255, 255, 0.25);
41
+ --color-glass-dark: rgba(0, 0, 0, 0.15);
42
+
43
+ /* Glass borders */
44
+ --color-glass-border: rgba(255, 255, 255, 0.20);
45
+ --color-glass-border-subtle: rgba(255, 255, 255, 0.10);
46
+ --color-glass-border-strong: rgba(255, 255, 255, 0.30);
47
+
48
+ /* Shadows */
49
+ --shadow-glass: 0 8px 32px rgba(31, 38, 135, 0.15);
50
+ --shadow-glass-lg: 0 8px 32px rgba(31, 38, 135, 0.20), inset 0 4px 20px rgba(255, 255, 255, 0.15);
51
+ --shadow-glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.20);
52
+
53
+ /* Radii — squircle-inspired generous values */
54
+ --radius-glass-sm: 12px;
55
+ --radius-glass: 16px;
56
+ --radius-glass-lg: 24px;
57
+ --radius-glass-xl: 32px;
58
+ --radius-glass-pill: 9999px;
59
+ }
60
+ ```
61
+
62
+ ### Core Utility Classes
63
+
64
+ **Glass Surface (base pattern):**
65
+ ```
66
+ backdrop-blur-lg bg-[rgba(255,255,255,0.15)] border border-white/20
67
+ shadow-[0_8px_32px_rgba(31,38,135,0.15)]
68
+ ```
69
+
70
+ **Enhanced with saturation:**
71
+ ```
72
+ backdrop-blur-lg backdrop-saturate-[180%] bg-[rgba(255,255,255,0.15)]
73
+ border border-white/20
74
+ ```
75
+
76
+ ### Component Patterns
77
+
78
+ #### Glass Card
79
+ ```html
80
+ <div class="rounded-2xl bg-[rgba(255,255,255,0.15)] backdrop-blur-lg
81
+ backdrop-saturate-[180%] border border-white/20
82
+ shadow-[0_8px_32px_rgba(31,38,135,0.15)] p-6">
83
+ <!-- Content -->
84
+ </div>
85
+ ```
86
+
87
+ #### Glass Button — Primary
88
+ ```html
89
+ <button class="px-5 py-2.5 rounded-2xl text-white font-medium
90
+ bg-[rgba(255,255,255,0.15)] backdrop-blur-lg border border-white/15
91
+ shadow-lg hover:-translate-y-0.5 active:scale-95
92
+ transition-all duration-300">
93
+ Label
94
+ </button>
95
+ ```
96
+
97
+ #### Glass Button — Secondary
98
+ ```html
99
+ <button class="px-5 py-2.5 rounded-2xl text-white/90 font-medium
100
+ bg-[rgba(255,255,255,0.08)] backdrop-blur-lg border border-white/10
101
+ shadow-md hover:-translate-y-0.5 active:scale-95
102
+ transition-all duration-300">
103
+ Label
104
+ </button>
105
+ ```
106
+
107
+ #### Glass Button — Pill
108
+ ```html
109
+ <button class="px-5 py-2.5 rounded-full text-sm font-medium text-white/90
110
+ bg-[rgba(255,255,255,0.08)] backdrop-blur-lg border border-white/10
111
+ shadow-md hover:-translate-y-0.5 active:scale-95
112
+ transition-all duration-300">
113
+ Label
114
+ </button>
115
+ ```
116
+
117
+ #### Glass Button — FAB (Floating Action)
118
+ ```html
119
+ <button class="w-12 h-12 rounded-full flex items-center justify-center
120
+ text-white bg-[rgba(59,130,246,0.25)] backdrop-blur-lg
121
+ border border-blue-400/20 shadow-lg hover:-translate-y-0.5
122
+ active:scale-95 transition-all duration-300">
123
+ <svg>...</svg>
124
+ </button>
125
+ ```
126
+
127
+ #### Glass Navbar
128
+ ```html
129
+ <nav class="fixed top-0 inset-x-0 z-50 h-16
130
+ bg-[rgba(255,255,255,0.12)] backdrop-blur-xl backdrop-saturate-[180%]
131
+ border-b border-white/10">
132
+ <!-- Content -->
133
+ </nav>
134
+ ```
135
+
136
+ #### Glass Modal / Sheet
137
+ ```html
138
+ <div class="rounded-t-3xl bg-[rgba(255,255,255,0.15)] backdrop-blur-2xl
139
+ backdrop-saturate-[180%] border border-white/20
140
+ shadow-[0_-8px_32px_rgba(31,38,135,0.2)] p-6">
141
+ <!-- Content -->
142
+ </div>
143
+ ```
144
+
145
+ #### Glass Input
146
+ ```html
147
+ <input class="w-full px-4 py-3 rounded-xl text-white placeholder-white/50
148
+ bg-[rgba(255,255,255,0.08)] backdrop-blur-lg border border-white/15
149
+ focus:border-white/30 focus:bg-[rgba(255,255,255,0.12)]
150
+ outline-none transition-all duration-200" />
151
+ ```
152
+
153
+ #### Glass Segmented Control
154
+ ```html
155
+ <div class="inline-flex rounded-xl bg-[rgba(255,255,255,0.08)]
156
+ backdrop-blur-lg border border-white/10 p-1">
157
+ <button class="px-4 py-2 rounded-lg text-sm font-medium text-white
158
+ bg-[rgba(255,255,255,0.15)] shadow-sm">
159
+ Active
160
+ </button>
161
+ <button class="px-4 py-2 rounded-lg text-sm font-medium text-white/60
162
+ hover:text-white/80 transition-colors">
163
+ Inactive
164
+ </button>
165
+ </div>
166
+ ```
167
+
168
+ ### Specular Highlight (Shine Effect)
169
+
170
+ Add a `::after` pseudo-element for the characteristic rim light:
171
+
172
+ ```css
173
+ .glass-shine {
174
+ position: relative;
175
+ overflow: hidden;
176
+ }
177
+ .glass-shine::after {
178
+ content: '';
179
+ position: absolute;
180
+ inset: 0;
181
+ border-radius: inherit;
182
+ background: linear-gradient(
183
+ 135deg,
184
+ rgba(255, 255, 255, 0.25) 0%,
185
+ transparent 40%,
186
+ transparent 60%,
187
+ rgba(255, 255, 255, 0.05) 100%
188
+ );
189
+ pointer-events: none;
190
+ }
191
+ ```
192
+
193
+ Or as Tailwind arbitrary in a `@layer`:
194
+ ```css
195
+ @layer components {
196
+ .glass-shine {
197
+ @apply relative overflow-hidden;
198
+ }
199
+ .glass-shine::after {
200
+ content: '';
201
+ @apply absolute inset-0 rounded-[inherit] pointer-events-none;
202
+ background: linear-gradient(
203
+ 135deg,
204
+ rgba(255, 255, 255, 0.25) 0%,
205
+ transparent 40%,
206
+ transparent 60%,
207
+ rgba(255, 255, 255, 0.05) 100%
208
+ );
209
+ }
210
+ }
211
+ ```
212
+
213
+ ### SVG Refraction Filter (Advanced — Chromium Only)
214
+
215
+ For true liquid glass distortion, use an inline SVG filter:
216
+
217
+ ```html
218
+ <svg class="absolute w-0 h-0" aria-hidden="true">
219
+ <defs>
220
+ <filter id="liquid-glass" color-interpolation-filters="sRGB">
221
+ <feGaussianBlur in="SourceGraphic" stdDeviation="1" result="blur" />
222
+ <feImage href="/displacement-map.png"
223
+ x="0" y="0" width="300" height="56" result="map" />
224
+ <feDisplacementMap in="blur" in2="map"
225
+ scale="55" xChannelSelector="R" yChannelSelector="G"
226
+ result="displaced" />
227
+ <feColorMatrix in="displaced" type="saturate" values="1.5"
228
+ result="saturated" />
229
+ </filter>
230
+ </defs>
231
+ </svg>
232
+
233
+ <div class="backdrop-[url(#liquid-glass)_brightness(150%)]">
234
+ <!-- Element with refraction -->
235
+ </div>
236
+ ```
237
+
238
+ **Important:** `backdrop-filter: url(#svg-filter)` only works in Chromium. Always provide a fallback:
239
+ ```css
240
+ @supports not (backdrop-filter: url(#liquid-glass)) {
241
+ .glass-refraction {
242
+ backdrop-filter: blur(16px) saturate(180%);
243
+ background: rgba(255, 255, 255, 0.18);
244
+ }
245
+ }
246
+ ```
247
+
248
+ ### Dark Mode Adaptation
249
+
250
+ ```html
251
+ <!-- Light context -->
252
+ <div class="bg-[rgba(255,255,255,0.15)] border-white/20 text-gray-900">
253
+
254
+ <!-- Dark context -->
255
+ <div class="dark:bg-[rgba(0,0,0,0.25)] dark:border-white/10 dark:text-white">
256
+ ```
257
+
258
+ Adjust opacity ranges:
259
+ - **Light mode:** bg opacity 0.08–0.25, border-white/15–30
260
+ - **Dark mode:** bg opacity 0.15–0.35, border-white/5–15
261
+
262
+ ## Hierarchy Through Opacity
263
+
264
+ | Level | Background Opacity | Border Opacity | Blur |
265
+ |-------------|-------------------|----------------|----------|
266
+ | Primary | 0.15–0.25 | 0.20 | blur-lg |
267
+ | Secondary | 0.08–0.12 | 0.10–0.15 | blur-lg |
268
+ | Tertiary | 0.04–0.08 | 0.10 | blur-md |
269
+ | Elevated | 0.20–0.30 | 0.25–0.30 | blur-xl |
270
+
271
+ ## Animations
272
+
273
+ Liquid Glass favors smooth, spring-like transitions:
274
+
275
+ ```
276
+ /* Hover lift */
277
+ hover:-translate-y-0.5 transition-all duration-300
278
+
279
+ /* Press feedback */
280
+ active:scale-95 transition-transform duration-150
281
+
282
+ /* Entrance */
283
+ animate-in fade-in slide-in-from-bottom-4 duration-300
284
+
285
+ /* Keep it subtle — no bouncy or flashy animations */
286
+ ```
287
+
288
+ ## Accessibility Requirements
289
+
290
+ 1. **Contrast:** Always verify text contrast against translucent backgrounds. Use `text-white` with sufficient shadow or a darker glass surface if needed.
291
+ 2. **Reduce Transparency:** Respect `prefers-reduced-transparency`:
292
+ ```css
293
+ @media (prefers-reduced-transparency: reduce) {
294
+ .glass { backdrop-filter: none; background: rgba(30, 30, 30, 0.95); }
295
+ }
296
+ ```
297
+ 3. **Reduce Motion:** Respect `prefers-reduced-motion`:
298
+ ```css
299
+ @media (prefers-reduced-motion: reduce) {
300
+ .glass { transition: none; animation: none; }
301
+ }
302
+ ```
303
+ 4. **Dynamic Type:** Use relative units (`rem`, `em`) for font sizes.
304
+ 5. **Focus states:** Ensure visible focus rings on all interactive glass elements.
305
+
306
+ ## Performance Guidelines
307
+
308
+ - `backdrop-filter: blur()` triggers compositing — use sparingly on scroll-heavy views
309
+ - Avoid stacking more than 2-3 glass layers
310
+ - SVG displacement filters are expensive — reserve for hero elements
311
+ - Test on lower-end devices
312
+ - Prefer CSS-only effects over JS-driven animations
313
+
314
+ ## Anti-Patterns
315
+
316
+ - **Too much blur** — max `blur-xl` (20px) for most elements
317
+ - **Fully transparent backgrounds** — always have some tint (min 0.04 opacity)
318
+ - **Heavy borders** — keep borders at max 1px, low opacity
319
+ - **Inconsistent radii** — pick 2-3 radius values and stick to them
320
+ - **Glass on glass on glass** — avoid deep nesting of translucent layers
321
+ - **No fallback** — always degrade gracefully for unsupported browsers
322
+ - **Ignoring accessibility** — translucent != illegible
323
+
324
+ ## Package Reference
325
+
326
+ For a ready-to-use Tailwind plugin with all these patterns:
327
+
328
+ ```bash
329
+ npm install liquidglass-tailwind
330
+ ```
331
+
332
+ See `~/liquidglass-tailwind` for the source package.