shadcn-glass-ui 1.0.11 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/CHANGELOG.md +213 -0
  2. package/README.md +174 -17
  3. package/context7.json +58 -0
  4. package/dist/cli/index.cjs +470 -0
  5. package/dist/cli/index.cjs.map +1 -0
  6. package/dist/cli/index.d.ts +18 -0
  7. package/dist/cli/index.js +469 -0
  8. package/dist/cli/index.js.map +1 -0
  9. package/dist/components.cjs +4 -4
  10. package/dist/components.d.ts +153 -22
  11. package/dist/components.js +2 -2
  12. package/dist/hooks.cjs +2 -2
  13. package/dist/index.cjs +872 -5
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.ts +0 -2390
  16. package/dist/index.js +844 -3
  17. package/dist/index.js.map +1 -1
  18. package/dist/r/ai-card-glass.json +1 -1
  19. package/dist/r/avatar-glass.json +1 -1
  20. package/dist/r/circular-metric-glass.json +1 -1
  21. package/dist/r/circular-progress-glass.json +1 -1
  22. package/dist/r/combobox-glass.json +1 -1
  23. package/dist/r/flag-alert-glass.json +1 -1
  24. package/dist/r/flags-section-glass.json +1 -1
  25. package/dist/r/insight-card-glass.json +26 -0
  26. package/dist/r/interactive-card.json +1 -1
  27. package/dist/r/language-bar-glass.json +1 -1
  28. package/dist/r/metric-card-glass.json +3 -2
  29. package/dist/r/metrics-grid-glass.json +1 -1
  30. package/dist/r/modal-glass.json +1 -1
  31. package/dist/r/progress-glass.json +1 -1
  32. package/dist/r/registry.json +19 -1
  33. package/dist/r/segmented-control-glass.json +1 -1
  34. package/dist/r/sparkline-glass.json +26 -0
  35. package/dist/r/stepper-glass.json +41 -0
  36. package/dist/r/tabs-glass.json +1 -1
  37. package/dist/r/trust-score-card-glass.json +1 -1
  38. package/dist/r/year-card-glass.json +1 -1
  39. package/dist/shadcn-glass-ui.css +1 -1
  40. package/dist/{theme-context-XtasSxRT.cjs → theme-context-CVW50BKW.cjs} +2 -2
  41. package/dist/{theme-context-XtasSxRT.cjs.map → theme-context-CVW50BKW.cjs.map} +1 -1
  42. package/dist/themes.cjs +1 -1
  43. package/dist/trust-score-card-glass-BcZbul0P.js +26895 -0
  44. package/dist/trust-score-card-glass-BcZbul0P.js.map +1 -0
  45. package/dist/trust-score-card-glass-r3qM09Jp.cjs +27689 -0
  46. package/dist/trust-score-card-glass-r3qM09Jp.cjs.map +1 -0
  47. package/dist/{use-focus-BbpE2qGq.cjs → use-focus-ZE8ozmZE.cjs} +2 -2
  48. package/dist/{use-focus-BbpE2qGq.cjs.map → use-focus-ZE8ozmZE.cjs.map} +1 -1
  49. package/dist/{use-wallpaper-tint-CIqtoETa.cjs → use-wallpaper-tint-BuS80tbN.cjs} +2 -2
  50. package/dist/{use-wallpaper-tint-CIqtoETa.cjs.map → use-wallpaper-tint-BuS80tbN.cjs.map} +1 -1
  51. package/dist/{utils-CGCOTvxT.js → utils-CcyeqpKQ.js} +1 -1
  52. package/dist/{utils-CGCOTvxT.js.map → utils-CcyeqpKQ.js.map} +1 -1
  53. package/dist/{utils-CriE74ig.cjs → utils-DLXayspX.cjs} +2 -2
  54. package/dist/{utils-CriE74ig.cjs.map → utils-DLXayspX.cjs.map} +1 -1
  55. package/dist/utils.cjs +1 -1
  56. package/dist/utils.js +1 -1
  57. package/docs/AI_IMPROVEMENTS_COMPLETE.md +574 -0
  58. package/docs/AI_USAGE.md +1328 -0
  59. package/docs/API_PATTERNS_COMPARISON.md +418 -0
  60. package/docs/BEST_PRACTICES.md +800 -0
  61. package/docs/COMPLIANCE_CHECKLIST.md +307 -0
  62. package/docs/COMPLIANCE_TESTING.md +436 -0
  63. package/docs/COMPONENTS_CATALOG.md +1076 -0
  64. package/docs/CSS_VARIABLES_AUDIT.md +306 -0
  65. package/docs/CSS_VARIABLES_REFACTORING_PLAN.md +330 -0
  66. package/docs/EXPORTS_MAP.json +875 -0
  67. package/docs/EXPORTS_STRUCTURE.md +729 -0
  68. package/docs/GETTING_STARTED.md +655 -0
  69. package/docs/METRIC_CARD_API_REDESIGN.md +354 -0
  70. package/docs/PRIMITIVE_MAPPING.md +404 -0
  71. package/docs/PUBLISHING.md +593 -0
  72. package/docs/REGISTRY_SUMMARY.md +96 -0
  73. package/docs/REGISTRY_USAGE.md +339 -0
  74. package/docs/SECURITY.md +117 -0
  75. package/docs/THEME_CREATION_GUIDE.md +455 -0
  76. package/docs/TOKEN_ARCHITECTURE.md +365 -0
  77. package/docs/announcements/v1.0.5-devto.md +363 -0
  78. package/docs/announcements/v1.0.5-reddit.md +115 -0
  79. package/docs/announcements/v1.0.5-twitter.md +70 -0
  80. package/docs/api/README.md +725 -0
  81. package/docs/api/functions/ThemeProvider.md +21 -0
  82. package/docs/api/functions/cn.md +27 -0
  83. package/docs/api/functions/getNextTheme.md +21 -0
  84. package/docs/api/functions/getThemeConfig.md +21 -0
  85. package/docs/api/functions/useFocus.md +53 -0
  86. package/docs/api/functions/useHover.md +47 -0
  87. package/docs/api/functions/useResponsive.md +31 -0
  88. package/docs/api/functions/useTheme.md +15 -0
  89. package/docs/api/functions/useWallpaperTint.md +36 -0
  90. package/docs/api/globals.md +139 -0
  91. package/docs/api/interfaces/AlertGlassProps.md +131 -0
  92. package/docs/api/interfaces/AvatarGlassProps.md +114 -0
  93. package/docs/api/interfaces/BadgeGlassProps.md +118 -0
  94. package/docs/api/interfaces/ButtonGlassProps.md +179 -0
  95. package/docs/api/interfaces/CheckboxGlassProps.md +125 -0
  96. package/docs/api/interfaces/DropdownGlassProps.md +123 -0
  97. package/docs/api/interfaces/DropdownItem.md +53 -0
  98. package/docs/api/interfaces/GlassCardProps.md +151 -0
  99. package/docs/api/interfaces/InputGlassProps.md +169 -0
  100. package/docs/api/interfaces/NotificationGlassProps.md +67 -0
  101. package/docs/api/interfaces/ProgressGlassProps.md +49 -0
  102. package/docs/api/interfaces/SkeletonGlassProps.md +41 -0
  103. package/docs/api/interfaces/SliderGlassProps.md +107 -0
  104. package/docs/api/interfaces/TabItem.md +25 -0
  105. package/docs/api/interfaces/ThemeConfig.md +25 -0
  106. package/docs/api/interfaces/ThemeContextValue.md +47 -0
  107. package/docs/api/interfaces/ToggleGlassProps.md +59 -0
  108. package/docs/api/interfaces/TooltipGlassProps.md +119 -0
  109. package/docs/api/type-aliases/AlertType.md +11 -0
  110. package/docs/api/type-aliases/AlertVariant.md +11 -0
  111. package/docs/api/type-aliases/AvatarSize.md +11 -0
  112. package/docs/api/type-aliases/AvatarStatus.md +13 -0
  113. package/docs/api/type-aliases/BadgeSize.md +11 -0
  114. package/docs/api/type-aliases/BadgeVariant.md +11 -0
  115. package/docs/api/type-aliases/ButtonGlassSize.md +11 -0
  116. package/docs/api/type-aliases/ButtonGlassVariant.md +11 -0
  117. package/docs/api/type-aliases/DropdownAlign.md +11 -0
  118. package/docs/api/type-aliases/GlowType.md +11 -0
  119. package/docs/api/type-aliases/InputGlassSize.md +11 -0
  120. package/docs/api/type-aliases/IntensityType.md +11 -0
  121. package/docs/api/type-aliases/ModalSize.md +11 -0
  122. package/docs/api/type-aliases/NotificationType.md +11 -0
  123. package/docs/api/type-aliases/PaddingType.md +11 -0
  124. package/docs/api/type-aliases/ProgressGradient.md +11 -0
  125. package/docs/api/type-aliases/ProgressSize.md +11 -0
  126. package/docs/api/type-aliases/SkeletonVariant.md +11 -0
  127. package/docs/api/type-aliases/Theme.md +11 -0
  128. package/docs/api/type-aliases/ToggleGlassSize.md +11 -0
  129. package/docs/api/type-aliases/TooltipPosition.md +11 -0
  130. package/docs/api/variables/AICardGlass.md +11 -0
  131. package/docs/api/variables/AlertGlass.md +11 -0
  132. package/docs/api/variables/AvatarGlass.md +11 -0
  133. package/docs/api/variables/BadgeGlass.md +11 -0
  134. package/docs/api/variables/BaseProgressGlass.md +11 -0
  135. package/docs/api/variables/ButtonGlass.md +11 -0
  136. package/docs/api/variables/CareerStatsGlass.md +11 -0
  137. package/docs/api/variables/CareerStatsHeaderGlass.md +11 -0
  138. package/docs/api/variables/CheckboxGlass.md +11 -0
  139. package/docs/api/variables/CircularMetricGlass.md +22 -0
  140. package/docs/api/variables/CircularProgressGlass.md +11 -0
  141. package/docs/api/variables/ComboBoxGlass.md +27 -0
  142. package/docs/api/variables/ContributionMetricsGlass.md +11 -0
  143. package/docs/api/variables/DropdownGlass.md +11 -0
  144. package/docs/api/variables/ExpandableHeaderGlass.md +11 -0
  145. package/docs/api/variables/FlagAlertGlass.md +11 -0
  146. package/docs/api/variables/FlagsSectionGlass.md +11 -0
  147. package/docs/api/variables/FormFieldWrapper.md +44 -0
  148. package/docs/api/variables/GlassCard.md +11 -0
  149. package/docs/api/variables/HeaderBrandingGlass.md +11 -0
  150. package/docs/api/variables/HeaderNavGlass.md +11 -0
  151. package/docs/api/variables/IconButtonGlass.md +11 -0
  152. package/docs/api/variables/InputGlass.md +11 -0
  153. package/docs/api/variables/InteractiveCard.md +45 -0
  154. package/docs/api/variables/LanguageBarGlass.md +11 -0
  155. package/docs/api/variables/MetricCardGlass.md +11 -0
  156. package/docs/api/variables/MetricsGridGlass.md +11 -0
  157. package/docs/api/variables/ModalGlass.md +72 -0
  158. package/docs/api/variables/NotificationGlass.md +11 -0
  159. package/docs/api/variables/PopoverGlass.md +11 -0
  160. package/docs/api/variables/ProfileAvatarGlass.md +11 -0
  161. package/docs/api/variables/ProfileHeaderGlass.md +11 -0
  162. package/docs/api/variables/ProgressGlass.md +11 -0
  163. package/docs/api/variables/ProjectsListGlass.md +11 -0
  164. package/docs/api/variables/RainbowProgressGlass.md +11 -0
  165. package/docs/api/variables/RepositoryCardGlass.md +11 -0
  166. package/docs/api/variables/RepositoryHeaderGlass.md +11 -0
  167. package/docs/api/variables/RepositoryMetadataGlass.md +11 -0
  168. package/docs/api/variables/SearchBoxGlass.md +11 -0
  169. package/docs/api/variables/SegmentedControlGlass.md +11 -0
  170. package/docs/api/variables/SkeletonGlass.md +11 -0
  171. package/docs/api/variables/SliderGlass.md +11 -0
  172. package/docs/api/variables/SortDropdownGlass.md +11 -0
  173. package/docs/api/variables/StatItemGlass.md +11 -0
  174. package/docs/api/variables/StatusIndicatorGlass.md +11 -0
  175. package/docs/api/variables/THEMES.md +11 -0
  176. package/docs/api/variables/THEME_CONFIG.md +11 -0
  177. package/docs/api/variables/TabsGlass.md +52 -0
  178. package/docs/api/variables/ThemeToggleGlass.md +11 -0
  179. package/docs/api/variables/ToggleGlass.md +11 -0
  180. package/docs/api/variables/TooltipGlass.md +11 -0
  181. package/docs/api/variables/TouchTarget.md +35 -0
  182. package/docs/api/variables/TrustScoreCardGlass.md +11 -0
  183. package/docs/api/variables/TrustScoreDisplayGlass.md +11 -0
  184. package/docs/api/variables/UserInfoGlass.md +11 -0
  185. package/docs/api/variables/UserStatsLineGlass.md +11 -0
  186. package/docs/api/variables/YearCardGlass.md +11 -0
  187. package/docs/api/variables/alertVariants.md +21 -0
  188. package/docs/api/variables/avatarSizes.md +21 -0
  189. package/docs/api/variables/badgeVariants.md +21 -0
  190. package/docs/api/variables/buttonGlassVariants.md +21 -0
  191. package/docs/api/variables/cardIntensity.md +21 -0
  192. package/docs/api/variables/dropdownAlign.md +21 -0
  193. package/docs/api/variables/inputVariants.md +21 -0
  194. package/docs/api/variables/modalSizes.md +21 -0
  195. package/docs/api/variables/notificationVariants.md +21 -0
  196. package/docs/api/variables/progressSizes.md +21 -0
  197. package/docs/api/variables/shadcnAlertVariants.md +21 -0
  198. package/docs/api/variables/shadcnBadgeVariants.md +21 -0
  199. package/docs/api/variables/shadcnButtonVariants.md +21 -0
  200. package/docs/api/variables/skeletonVariants.md +21 -0
  201. package/docs/api/variables/statusSizes.md +21 -0
  202. package/docs/api/variables/toggleSizes.md +21 -0
  203. package/docs/api/variables/tooltipPositions.md +21 -0
  204. package/docs/design-system/UI_DESIGN.md +628 -0
  205. package/docs/migration/CSS_VARIABLES_MIGRATION_2.0.md +325 -0
  206. package/docs/migration/modal-glass-compound-api.md +458 -0
  207. package/docs/migration/select-to-combobox.md +386 -0
  208. package/docs/migration/tabs-glass-compound-api.md +579 -0
  209. package/docs/technical/DEPENDENCIES.md +291 -0
  210. package/docs/visual-testing-guide.md +324 -0
  211. package/package.json +20 -3
  212. package/dist/trust-score-card-glass-CNcQveNY.cjs +0 -8231
  213. package/dist/trust-score-card-glass-CNcQveNY.cjs.map +0 -1
  214. package/dist/trust-score-card-glass-CowcDyxH.js +0 -7795
  215. package/dist/trust-score-card-glass-CowcDyxH.js.map +0 -1
@@ -0,0 +1,628 @@
1
+ # Visual Design System Guidelines v1.0
2
+
3
+ ## Glassmorphism Design System for shadcn/ui
4
+
5
+ This document establishes authoritative visual design principles for a premium glassmorphism design
6
+ system built on shadcn/ui, supporting three themes: **Glass Dark**, **Aurora**, and **Light**. Every
7
+ specification is actionable with concrete pixel values, grounded in research from Material Design 3,
8
+ Apple Human Interface Guidelines, IBM Carbon, and industry best practices.
9
+
10
+ ---
11
+
12
+ ## Foundational principles drive visual harmony
13
+
14
+ The glassmorphism aesthetic demands **more generous spacing**, **stronger contrast safeguards**, and
15
+ **restrained application** compared to conventional design systems. Glass effects work best when
16
+ used sparingly—reserve translucent surfaces for **2-3 focal elements per view** maximum. The core
17
+ visual language relies on **backdrop blur**, **translucent backgrounds**, **subtle borders**, and
18
+ **glow accents** to create depth without traditional shadows.
19
+
20
+ Three mathematical foundations underpin this system: an **8px base grid** for all spacing, a **1.25
21
+ modular scale** for typography, and **OKLCH color space** for perceptually uniform theming. These
22
+ choices ensure visual consistency while enabling the premium, modern aesthetic that defines
23
+ exceptional glassmorphism implementations like Apple's Control Center and Microsoft's Fluent
24
+ Acrylic.
25
+
26
+ ---
27
+
28
+ ## Spacing and layout: the 8px foundation
29
+
30
+ The spacing system uses an **8px base unit** with 4px increments for fine-tuning, matching the
31
+ approach of Material Design 3, IBM Carbon, and Atlassian. This base provides generous breathing room
32
+ essential for glassmorphism—blur effects require surrounding space to appear correctly, and
33
+ translucent surfaces need visual separation to maintain figure/ground relationships.
34
+
35
+ Glassmorphism specifically demands **25-50% more internal padding** than conventional card designs.
36
+ Where a standard card might use 16px padding, glass cards should use 24-32px to achieve the premium
37
+ aesthetic and ensure text readability against variable backgrounds.
38
+
39
+ ### Complete spacing token scale
40
+
41
+ | Token | Value | Use Case |
42
+ | --------------- | ----- | ------------------------------------- |
43
+ | `--spacing-0` | 0 | Reset |
44
+ | `--spacing-0-5` | 2px | Hairline borders, micro adjustments |
45
+ | `--spacing-1` | 4px | Icon gaps, minimal spacing |
46
+ | `--spacing-2` | 8px | Base unit, tight component spacing |
47
+ | `--spacing-3` | 12px | Compact component gaps, form elements |
48
+ | `--spacing-4` | 16px | Standard spacing, button padding |
49
+ | `--spacing-5` | 20px | Comfortable gaps |
50
+ | `--spacing-6` | 24px | Glass card padding (default) |
51
+ | `--spacing-7` | 28px | Premium glass spacing |
52
+ | `--spacing-8` | 32px | Section spacing, large gaps |
53
+ | `--spacing-10` | 40px | Major spacing |
54
+ | `--spacing-12` | 48px | Section breaks |
55
+ | `--spacing-16` | 64px | Page-level spacing |
56
+ | `--spacing-20` | 80px | Hero sections |
57
+ | `--spacing-24` | 96px | Maximum component spacing |
58
+
59
+ **Touch targets** must meet the **44×44px minimum** (Apple HIG) or **48×48dp** (Material Design).
60
+ For glassmorphism buttons, use `min-height: 44px` with `padding: 12px 24px` to ensure both
61
+ accessibility compliance and visual balance.
62
+
63
+ **Responsive spacing** uses CSS `clamp()` for fluid scaling:
64
+
65
+ ```css
66
+ --spacing-fluid-md: clamp(20px, 1.25rem + 1vw, 32px);
67
+ --spacing-fluid-lg: clamp(32px, 2rem + 2vw, 56px);
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Typography creates readable hierarchy on glass
73
+
74
+ The type system uses a **1.25 major third modular scale** starting from a 16px base—this ratio
75
+ provides sufficient hierarchy without the dramatic jumps of the golden ratio, making it ideal for UI
76
+ applications. Body text must be **minimum 16px** (iOS auto-zoom prevention, accessibility
77
+ compliance), with **font-weight 500** recommended on glass backgrounds for enhanced readability.
78
+
79
+ **Inter** is the recommended primary typeface for its tall x-height (69%), optical sizing support,
80
+ and screen optimization. For glassmorphism specifically, avoid thin font weights (300 or below)—the
81
+ translucent backgrounds swallow lightweight type.
82
+
83
+ ### Typography token scale
84
+
85
+ | Token | Size | Line Height | Letter Spacing | Use Case |
86
+ | ------------------ | ----------------------------------------- | ----------- | -------------- | ---------------------- |
87
+ | `--font-size-xs` | clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem) | 1.33 | 0.025em | Captions, timestamps |
88
+ | `--font-size-sm` | clamp(0.875rem, 0.8rem + 0.375vw, 1rem) | 1.5 | 0 | Secondary text, labels |
89
+ | `--font-size-base` | clamp(1rem, 0.95rem + 0.25vw, 1.125rem) | 1.5 | 0 | Body text |
90
+ | `--font-size-lg` | clamp(1.125rem, 1rem + 0.5vw, 1.25rem) | 1.5 | 0 | Large body, lead text |
91
+ | `--font-size-xl` | clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem) | 1.25 | -0.01em | H5, subheadings |
92
+ | `--font-size-2xl` | clamp(1.5rem, 1.25rem + 1.25vw, 2rem) | 1.25 | -0.015em | H4, card titles |
93
+ | `--font-size-3xl` | clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem) | 1.2 | -0.02em | H3, section headers |
94
+ | `--font-size-4xl` | clamp(2.25rem, 1.75rem + 2.5vw, 3rem) | 1.1 | -0.025em | H2, page titles |
95
+ | `--font-size-5xl` | clamp(3rem, 2rem + 5vw, 4.5rem) | 1 | -0.03em | H1, hero headlines |
96
+
97
+ ### Text on glass backgrounds requires enhancement
98
+
99
+ Text readability on translucent surfaces is the critical accessibility challenge for glassmorphism.
100
+ Apply these techniques:
101
+
102
+ **Text shadow for light text on glass:**
103
+
104
+ ```css
105
+ --text-shadow-glass: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
106
+ ```
107
+
108
+ **Semi-opaque backing for critical content:**
109
+
110
+ ```css
111
+ .glass-text-container {
112
+ background: rgba(0, 0, 0, 0.3);
113
+ padding: 1rem;
114
+ border-radius: 8px;
115
+ }
116
+ ```
117
+
118
+ ---
119
+
120
+ ## Color system built on OKLCH
121
+
122
+ **OKLCH** (Oklab Lightness, Chroma, Hue) is the recommended color format for 2024-2025, offering
123
+ perceptual uniformity—equal numerical changes produce equal perceived changes across all hues. This
124
+ eliminates the HSL problem where "50% lightness" appears vastly different between blue and yellow.
125
+
126
+ The color architecture follows a **three-tier token hierarchy**:
127
+
128
+ 1. **Primitive tokens**: Raw color values (e.g., `--color-blue-500`)
129
+ 2. **Semantic tokens**: Purpose-based references (e.g., `--color-text-primary`)
130
+ 3. **Component tokens**: Specific applications (e.g., `--button-primary-bg`)
131
+
132
+ ### Glassmorphism-specific color values
133
+
134
+ | Token | Glass Dark | Aurora | Light |
135
+ | ------------- | ------------------------ | ----------------------- | ----------------------- |
136
+ | Background | `#0a0a0f` | `#050510` | `#f8f9fa` |
137
+ | Glass surface | `rgba(255,255,255,0.08)` | `rgba(100,80,200,0.08)` | `rgba(255,255,255,0.7)` |
138
+ | Glass border | `rgba(255,255,255,0.12)` | `rgba(150,100,255,0.2)` | `rgba(0,0,0,0.08)` |
139
+ | Text primary | `#e0e0e0` | `#f0f0ff` | `#1a1a1a` |
140
+ | Glow accent | `rgba(100,150,255,0.3)` | `rgba(150,100,255,0.4)` | `rgba(99,102,241,0.15)` |
141
+
142
+ ### Opacity guidelines for glass surfaces
143
+
144
+ | Context | Opacity Range | Notes |
145
+ | ------------------- | ------------- | ----------------------------------- |
146
+ | Decorative glass | 5-10% | Subtle effect, requires strong blur |
147
+ | Standard cards | 15-25% | **Sweet spot** for balance |
148
+ | Text containers | 30-50% | Higher opacity for readability |
149
+ | Navigation/overlays | 40-75% | Maximum legibility required |
150
+
151
+ **Critical rule**: Always test contrast against the **worst-case background**—the darkest or
152
+ lightest area that might appear behind the glass element. Target **4.5:1** for body text, **3:1**
153
+ for large text and UI components.
154
+
155
+ **Dark mode**: Avoid pure black (`#000000`)—use `#121212` or `#0a0a0f` as base surfaces. Elevation
156
+ increases through lighter surface colors, not stronger shadows.
157
+
158
+ ---
159
+
160
+ ## Border radius creates cohesive shapes
161
+
162
+ The radius system follows an **exponential progression** that creates natural visual hierarchy.
163
+ Glassmorphism requires **slightly larger radii** than conventional design (add 2-4px) because
164
+ backdrop blur softens perceived edges.
165
+
166
+ ### Border radius token scale
167
+
168
+ | Token | Value | Use Case |
169
+ | --------------- | ------ | -------------------------------- |
170
+ | `--radius-none` | 0 | Sharp corners when intentional |
171
+ | `--radius-sm` | 4px | Badges, tags, small chips |
172
+ | `--radius-md` | 8px | Buttons, inputs, tooltips |
173
+ | `--radius-lg` | 12px | Cards, dropdown menus |
174
+ | `--radius-xl` | 16px | Modal dialogs, glass panels |
175
+ | `--radius-2xl` | 24px | Hero cards, feature sections |
176
+ | `--radius-full` | 9999px | Pills, avatars, circular buttons |
177
+
178
+ **Nested element formula**: `inner-radius = outer-radius - padding`
179
+
180
+ ```css
181
+ .glass-card {
182
+ --card-padding: 16px;
183
+ --card-radius: 16px;
184
+ --card-inner-radius: calc(var(--card-radius) - var(--card-padding));
185
+ padding: var(--card-padding);
186
+ border-radius: var(--card-radius);
187
+ }
188
+ .glass-card-inner {
189
+ border-radius: var(--card-inner-radius);
190
+ }
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Shadows and elevation through glow
196
+
197
+ Glassmorphism replaces traditional drop shadows with **glow effects, blur depth, and translucency**
198
+ as primary elevation indicators. Reserve conventional shadows for grounding elements; use glows for
199
+ accent and focus states.
200
+
201
+ ### Shadow and glow token scale
202
+
203
+ ```css
204
+ /* Standard shadows (layered for realism) */
205
+ --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
206
+ --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
207
+ --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
208
+ --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
209
+
210
+ /* Glass-specific shadows */
211
+ --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.12);
212
+ --shadow-glass-lg: 0 16px 48px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1);
213
+ --shadow-glass-inner: inset 0 1px 1px rgba(255, 255, 255, 0.1);
214
+ --shadow-glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.15);
215
+
216
+ /* Accent glows */
217
+ --shadow-glow-primary: 0 0 40px rgba(99, 102, 241, 0.4), 0 0 80px rgba(99, 102, 241, 0.2);
218
+ --shadow-glow-secondary: 0 0 40px rgba(168, 85, 247, 0.35), 0 0 80px rgba(168, 85, 247, 0.15);
219
+ ```
220
+
221
+ **Elevation levels simplified for glassmorphism:**
222
+
223
+ - **Level 0**: Base surface (no shadow, standard blur)
224
+ - **Level 1**: Floating cards (`--shadow-glass` + blur 12px)
225
+ - **Level 2**: Modals/dialogs (`--shadow-glass-lg` + blur 16-24px)
226
+ - **Level 3**: Priority overlays (strong shadow + maximum blur)
227
+
228
+ ---
229
+
230
+ ## Glassmorphism implementation specifications
231
+
232
+ ### Core CSS properties
233
+
234
+ ```css
235
+ .glass-surface {
236
+ background: rgba(255, 255, 255, 0.15);
237
+ backdrop-filter: blur(16px) saturate(180%);
238
+ -webkit-backdrop-filter: blur(16px) saturate(180%);
239
+ border: 1px solid rgba(255, 255, 255, 0.18);
240
+ border-top-color: rgba(255, 255, 255, 0.35); /* Top edge shine */
241
+ border-radius: 16px;
242
+ box-shadow:
243
+ 0 8px 32px rgba(0, 0, 0, 0.12),
244
+ inset 0 1px 0 rgba(255, 255, 255, 0.15);
245
+ }
246
+ ```
247
+
248
+ ### Blur value recommendations
249
+
250
+ Blur values follow 8px increments for consistent progression:
251
+
252
+ | Token | Value | Use Case | Performance |
253
+ | ------------ | ----- | -------------------------- | ------------- |
254
+ | `--blur-sm` | 8px | Subtle glass effect | Good |
255
+ | `--blur-md` | 16px | Standard cards/panels | Moderate |
256
+ | `--blur-lg` | 24px | Overlays/modals | Moderate |
257
+ | `--blur-xl` | 32px | Heavy background treatment | Use sparingly |
258
+
259
+ **Note:** These tokens are defined in `src/styles/tokens/primitives.css` using Tailwind CSS 4 `@theme` directive.
260
+
261
+ ### Border specifications
262
+
263
+ | Token | Value |
264
+ | -------------------------- | ------------------------------- |
265
+ | `--glass-border-width` | 1px |
266
+ | `--glass-border-opacity` | 0.18 (18% white) |
267
+ | `--glass-border-highlight` | 0.35 (35% white, top edge only) |
268
+
269
+ **Gradient border implementation:**
270
+
271
+ ```css
272
+ border-image: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1)) 1;
273
+ ```
274
+
275
+ ### When to use glow effects
276
+
277
+ Use glows **sparingly** for:
278
+
279
+ - Active/focused states on interactive elements
280
+ - Primary CTA emphasis
281
+ - Brand highlight moments
282
+ - Dark mode visibility enhancement
283
+
284
+ **Avoid** glow on: every element, decorative purposes, small components.
285
+
286
+ ---
287
+
288
+ ## Component design specifications
289
+
290
+ ### Button
291
+
292
+ | Property | Small | Default | Large |
293
+ | ------------- | ----- | ------- | ----- |
294
+ | Height | 32px | 40px | 48px |
295
+ | Padding (H) | 12px | 16px | 24px |
296
+ | Padding (V) | 6px | 10px | 12px |
297
+ | Border Radius | 8px | 8px | 12px |
298
+ | Font Size | 14px | 14px | 16px |
299
+ | Font Weight | 500 | 500 | 500 |
300
+ | Min Width | 64px | 80px | 96px |
301
+
302
+ **Primary button**: Solid accent fill, no glass effect **Secondary button**: Glass surface with
303
+ `rgba(255,255,255,0.1)` background **Ghost button**: Transparent with 1px border, visible on solid
304
+ backgrounds only
305
+
306
+ ### Input
307
+
308
+ | Property | Value |
309
+ | ------------- | ---------------------------------------------------------- |
310
+ | Height | 40px (44px on mobile) |
311
+ | Padding | 12px 16px |
312
+ | Border Radius | 8px |
313
+ | Border | 1px solid `--glass-border-color` |
314
+ | Font Size | 16px (prevents iOS zoom) |
315
+ | Background | `rgba(0,0,0,0.2)` (dark) / `rgba(255,255,255,0.8)` (light) |
316
+
317
+ **Critical**: Form inputs should use **higher opacity backgrounds** than decorative
318
+ glass—readability is paramount.
319
+
320
+ ### Card
321
+
322
+ | Property | Compact | Default | Featured |
323
+ | ------------- | ---------------- | ---------------- | ---------------- |
324
+ | Padding | 16px | 24px | 32px |
325
+ | Border Radius | 12px | 16px | 20px |
326
+ | Background | 15% opacity | 20% opacity | 20% opacity |
327
+ | Blur | 12px | 16px | 16px |
328
+ | Border | 1px, 15% opacity | 1px, 18% opacity | 1px, 20% opacity |
329
+
330
+ ### Modal/Dialog
331
+
332
+ | Property | Value |
333
+ | ------------- | -------------------------------------------- |
334
+ | Padding | 24px (body), 20px (header/footer) |
335
+ | Border Radius | 20px |
336
+ | Max Width | 480px (small), 640px (medium), 800px (large) |
337
+ | Background | `rgba(255,255,255,0.25)` |
338
+ | Blur | 24px |
339
+ | Scrim | `rgba(0,0,0,0.5)` |
340
+
341
+ ### Dropdown
342
+
343
+ | Property | Value |
344
+ | ------------------- | ----------------------- |
345
+ | Padding (container) | 8px |
346
+ | Padding (item) | 10px 16px |
347
+ | Border Radius | 12px |
348
+ | Background | `rgba(255,255,255,0.2)` |
349
+ | Blur | 16px |
350
+ | Min Width | 180px |
351
+
352
+ ### Badge
353
+
354
+ | Property | Value |
355
+ | ------------- | ---------------------------- |
356
+ | Height | 20px-24px |
357
+ | Padding | 2px 8px |
358
+ | Border Radius | 4px (default), 9999px (pill) |
359
+ | Font Size | 12px |
360
+ | Font Weight | 500 |
361
+
362
+ **Note**: Glass effects don't work on small elements—use solid or near-solid backgrounds for badges.
363
+
364
+ ### Avatar
365
+
366
+ | Size | Dimensions | Border Radius |
367
+ | ---- | ---------- | ------------- |
368
+ | xs | 24px | 9999px |
369
+ | sm | 32px | 9999px |
370
+ | md | 40px | 9999px |
371
+ | lg | 56px | 9999px |
372
+ | xl | 80px | 9999px |
373
+
374
+ ### Tooltip
375
+
376
+ | Property | Value |
377
+ | ------------- | ------------------------------------------ |
378
+ | Padding | 8px 12px |
379
+ | Border Radius | 6px |
380
+ | Font Size | 12px-14px |
381
+ | Background | Solid `#1a1a2e` (dark) / `#ffffff` (light) |
382
+ | Max Width | 240px |
383
+
384
+ **Critical**: Tooltips should use **solid backgrounds**, not glass—they need maximum readability.
385
+
386
+ ---
387
+
388
+ ## Accessibility requirements
389
+
390
+ ### Contrast ratios
391
+
392
+ | Element | WCAG AA (Required) | WCAG AAA (Enhanced) |
393
+ | ------------------------------- | ------------------ | ------------------- |
394
+ | Normal text (<18pt) | **4.5:1** | 7:1 |
395
+ | Large text (≥18pt or 14pt bold) | **3:1** | 4.5:1 |
396
+ | UI components | **3:1** | N/A |
397
+
398
+ **Testing on glass**: Always test against worst-case background scenarios—check both lightest and
399
+ darkest possible backgrounds that might show through.
400
+
401
+ ### Focus states
402
+
403
+ ```css
404
+ .interactive:focus-visible {
405
+ outline: none;
406
+ box-shadow:
407
+ 0 0 0 2px rgba(255, 255, 255, 0.9),
408
+ /* Inner ring */ 0 0 0 4px rgba(0, 0, 0, 0.8); /* Outer ring */
409
+ }
410
+ ```
411
+
412
+ The double-outline technique ensures focus visibility on any background—critical for glass
413
+ components.
414
+
415
+ ### Touch targets
416
+
417
+ Minimum **44×44px** (Apple) or **48×48dp** (Material Design). Visual element can be smaller if tap
418
+ area meets requirements.
419
+
420
+ ### Motion and animation
421
+
422
+ ```css
423
+ @media (prefers-reduced-motion: reduce) {
424
+ *,
425
+ *::before,
426
+ *::after {
427
+ animation-duration: 0.01ms !important;
428
+ animation-iteration-count: 1 !important;
429
+ transition-duration: 0.01ms !important;
430
+ }
431
+ }
432
+ ```
433
+
434
+ **Safe animation properties**: Only animate `transform` and `opacity`—these are GPU-accelerated and
435
+ performant.
436
+
437
+ **Never exceed**: 3 flashes per second (seizure prevention).
438
+
439
+ ---
440
+
441
+ ## Performance optimization
442
+
443
+ ### backdrop-filter impact
444
+
445
+ - GPU-intensive; limit to 2-3 elements per view
446
+ - Reduce blur on mobile: `blur(8px)` instead of `blur(16px)`
447
+ - Use `transform: translateZ(0)` for hardware acceleration
448
+ - Never animate blur values—causes severe jank
449
+
450
+ ### Fallback for older browsers
451
+
452
+ ```css
453
+ .glass-panel {
454
+ background: rgba(0, 0, 0, 0.85); /* Solid fallback */
455
+ }
456
+
457
+ @supports (backdrop-filter: blur(10px)) {
458
+ .glass-panel {
459
+ background: rgba(0, 0, 0, 0.2);
460
+ backdrop-filter: blur(16px);
461
+ }
462
+ }
463
+ ```
464
+
465
+ ### Shadow animation technique
466
+
467
+ Never animate `box-shadow` directly—it triggers paint on every frame. Instead:
468
+
469
+ ```css
470
+ .card {
471
+ position: relative;
472
+ }
473
+ .card::after {
474
+ content: '';
475
+ position: absolute;
476
+ inset: 0;
477
+ box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
478
+ opacity: 0;
479
+ transition: opacity 0.3s;
480
+ border-radius: inherit;
481
+ z-index: -1;
482
+ }
483
+ .card:hover::after {
484
+ opacity: 1;
485
+ }
486
+ ```
487
+
488
+ ---
489
+
490
+ ## Antipatterns checklist
491
+
492
+ ### Layout mistakes
493
+
494
+ - ❌ Inconsistent spacing throughout UI—use spacing tokens
495
+ - ❌ Spacing too tight (cramped)—glass needs breathing room
496
+ - ❌ Breaking the grid—align all elements consistently
497
+ - ❌ Ignoring vertical rhythm—base all spacing on 8px unit
498
+
499
+ ### Typography mistakes
500
+
501
+ - ❌ More than 6-8 font sizes—limit to modular scale
502
+ - ❌ Text contrast below 4.5:1—test against worst-case backgrounds
503
+ - ❌ Centered long-form text—left-align body content
504
+ - ❌ Line length over 75 characters—use max-width on containers
505
+
506
+ ### Color mistakes
507
+
508
+ - ❌ Rainbow interfaces—limit to 2 primary + 2 accent colors
509
+ - ❌ Color alone conveying information—always pair with icons/text
510
+ - ❌ Pure black (#000) on pure white (#fff)—use off-black/off-white
511
+ - ❌ Insufficient contrast on glass—increase opacity or add overlays
512
+
513
+ ### Glassmorphism-specific mistakes
514
+
515
+ - ❌ **Too many glass layers**—maximum 2-3 per view
516
+ - ❌ **Glass on glass on glass**—use solid backgrounds between layers
517
+ - ❌ **Glow effects everywhere**—reserve for focus/active states only
518
+ - ❌ **Glass on small elements**—badges/chips don't work with blur
519
+ - ❌ **No fallback for backdrop-filter**—always provide @supports fallback
520
+ - ❌ **Blur over 24px on mobile**—reduce for performance
521
+ - ❌ **Text without shadow on glass**—add text-shadow for readability
522
+ - ❌ **Inconsistent blur values**—use defined blur tokens
523
+
524
+ ### Accessibility mistakes
525
+
526
+ - ❌ Touch targets under 44px—ensure minimum tap area
527
+ - ❌ Missing focus states—provide visible keyboard focus
528
+ - ❌ Auto-playing animations—respect prefers-reduced-motion
529
+ - ❌ No high-contrast fallback—support system accessibility modes
530
+
531
+ ---
532
+
533
+ ## Complete design token reference
534
+
535
+ ```css
536
+ :root {
537
+ /* ========== SPACING ========== */
538
+ --spacing-0: 0;
539
+ --spacing-0-5: 2px;
540
+ --spacing-1: 4px;
541
+ --spacing-2: 8px;
542
+ --spacing-3: 12px;
543
+ --spacing-4: 16px;
544
+ --spacing-5: 20px;
545
+ --spacing-6: 24px;
546
+ --spacing-7: 28px;
547
+ --spacing-8: 32px;
548
+ --spacing-10: 40px;
549
+ --spacing-12: 48px;
550
+ --spacing-16: 64px;
551
+ --spacing-20: 80px;
552
+ --spacing-24: 96px;
553
+
554
+ /* ========== TYPOGRAPHY ========== */
555
+ --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
556
+ --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
557
+
558
+ --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
559
+ --font-size-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
560
+ --font-size-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
561
+ --font-size-lg: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
562
+ --font-size-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
563
+ --font-size-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
564
+ --font-size-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem);
565
+ --font-size-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3rem);
566
+ --font-size-5xl: clamp(3rem, 2rem + 5vw, 4.5rem);
567
+
568
+ --line-height-tight: 1.1;
569
+ --line-height-snug: 1.25;
570
+ --line-height-normal: 1.5;
571
+ --line-height-relaxed: 1.625;
572
+
573
+ --font-weight-normal: 400;
574
+ --font-weight-medium: 500;
575
+ --font-weight-semibold: 600;
576
+ --font-weight-bold: 700;
577
+
578
+ /* ========== BORDER RADIUS ========== */
579
+ --radius-none: 0;
580
+ --radius-sm: 4px;
581
+ --radius-md: 8px;
582
+ --radius-lg: 12px;
583
+ --radius-xl: 16px;
584
+ --radius-2xl: 24px;
585
+ --radius-full: 9999px;
586
+
587
+ /* ========== SHADOWS ========== */
588
+ --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
589
+ --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
590
+ --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
591
+ --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
592
+ --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.12);
593
+ --shadow-glass-lg: 0 16px 48px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1);
594
+ --shadow-glow-primary: 0 0 40px rgba(99, 102, 241, 0.4), 0 0 80px rgba(99, 102, 241, 0.2);
595
+ --shadow-glow-secondary: 0 0 40px rgba(168, 85, 247, 0.35), 0 0 80px rgba(168, 85, 247, 0.15);
596
+
597
+ /* ========== GLASSMORPHISM ========== */
598
+ --blur-sm: 8px; /* Subtle glass effect */
599
+ --blur-md: 16px; /* Standard cards/panels */
600
+ --blur-lg: 24px; /* Overlays/modals */
601
+ --blur-xl: 32px; /* Heavy background treatment */
602
+ --glass-opacity-surface: 0.2;
603
+ --glass-opacity-overlay: 0.4;
604
+ --glass-border-width: 1px;
605
+ --glass-border-opacity: 0.18;
606
+ --glass-saturation: 1.8;
607
+
608
+ /* ========== TEXT SHADOWS ========== */
609
+ --text-shadow-glass: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
610
+ }
611
+ ```
612
+
613
+ ---
614
+
615
+ ## Conclusion
616
+
617
+ This design system prioritizes **restraint and contrast** over visual excess. Glassmorphism achieves
618
+ its premium aesthetic through selective application—translucent surfaces work as focal points, not
619
+ ubiquitous backgrounds. The 8px spacing grid, 1.25 type scale, and OKLCH color foundation provide
620
+ mathematical consistency, while the accessibility-first approach ensures the design works for all
621
+ users.
622
+
623
+ The key differentiator between amateur and professional glassmorphism lies in three principles:
624
+ **generous spacing** that gives blur effects room to breathe, **sufficient contrast** that maintains
625
+ readability regardless of background, and **performance consciousness** that limits blur to
626
+ essential elements. Apply glass effects to 2-3 key surfaces per view, ensure 4.5:1 text contrast,
627
+ and always provide fallbacks—these rules transform glassmorphism from a trendy gimmick into a
628
+ sustainable design language.