shadcn-glass-ui 1.0.11 → 2.0.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.
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 +5 -12
  19. package/dist/r/avatar-glass.json +5 -15
  20. package/dist/r/circular-metric-glass.json +5 -11
  21. package/dist/r/circular-progress-glass.json +5 -12
  22. package/dist/r/combobox-glass.json +5 -13
  23. package/dist/r/flag-alert-glass.json +5 -11
  24. package/dist/r/flags-section-glass.json +5 -12
  25. package/dist/r/insight-card-glass.json +17 -0
  26. package/dist/r/interactive-card.json +5 -12
  27. package/dist/r/language-bar-glass.json +5 -11
  28. package/dist/r/metric-card-glass.json +6 -13
  29. package/dist/r/metrics-grid-glass.json +5 -11
  30. package/dist/r/modal-glass.json +5 -15
  31. package/dist/r/progress-glass.json +5 -13
  32. package/dist/r/registry.json +20 -2
  33. package/dist/r/segmented-control-glass.json +5 -11
  34. package/dist/r/sparkline-glass.json +17 -0
  35. package/dist/r/stepper-glass.json +33 -0
  36. package/dist/r/tabs-glass.json +4 -9
  37. package/dist/r/trust-score-card-glass.json +5 -12
  38. package/dist/r/year-card-glass.json +5 -13
  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 +16 -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,306 @@
1
+ # CSS Variables Audit & Optimization Report
2
+
3
+ ## 📊 Summary
4
+
5
+ **Total CSS Variables:**
6
+
7
+ - Glass theme: 296 variables
8
+ - Light theme: 288 variables
9
+ - Aurora theme: 288 variables
10
+
11
+ **Status:** ✅ All deprecated aliases (`metric-emerald-*`, `metric-amber-*`, `metric-blue-*`,
12
+ `metric-red-*`) are **only used in CSS definitions** for backward compatibility. **No usage in
13
+ components or tests.**
14
+
15
+ ---
16
+
17
+ ## 🔍 Findings
18
+
19
+ ### 1. ✅ Deprecated Variables Usage: CLEAN
20
+
21
+ **Result:** No deprecated variable usage found in production code.
22
+
23
+ - ❌ `--metric-emerald-*` - Not used in components
24
+ - ❌ `--metric-amber-*` - Not used in components
25
+ - ❌ `--metric-blue-*` - Not used in components
26
+ - ❌ `--metric-red-*` - Not used in components
27
+
28
+ All components successfully migrated to:
29
+
30
+ - ✅ `--metric-success-*`
31
+ - ✅ `--metric-warning-*`
32
+ - ✅ `--metric-default-*`
33
+ - ✅ `--metric-destructive-*`
34
+
35
+ **Deprecated aliases remain only in CSS files** (glass.css, light.css, aurora.css) for backward
36
+ compatibility with external consumers.
37
+
38
+ ---
39
+
40
+ ### 2. 🎯 Duplicate Patterns Found
41
+
42
+ #### A. `transparent` Background Variables (19 occurrences in Glass)
43
+
44
+ **All these variables = `transparent` across all themes:**
45
+
46
+ ```css
47
+ /* Buttons */
48
+ --btn-ghost-bg: transparent;
49
+
50
+ /* Badges */
51
+ --badge-default-border: transparent;
52
+ --badge-secondary-border: transparent;
53
+ --badge-destructive-border: transparent;
54
+ --badge-outline-bg: transparent;
55
+ --badge-success-border: transparent;
56
+ --badge-warning-border: transparent;
57
+ --badge-info-border: transparent;
58
+
59
+ /* Tabs */
60
+ --tab-bg: transparent;
61
+
62
+ /* Metrics */
63
+ --metric-default-bg: transparent;
64
+ --metric-default-border: transparent;
65
+ --metric-secondary-bg: transparent;
66
+ --metric-secondary-border: transparent;
67
+ --metric-success-bg: transparent;
68
+ --metric-success-border: transparent;
69
+ --metric-warning-bg: transparent;
70
+ --metric-warning-border: transparent;
71
+ --metric-destructive-bg: transparent;
72
+ --metric-destructive-border: transparent;
73
+ ```
74
+
75
+ #### B. `none` Glow Variables (14 occurrences in Light theme)
76
+
77
+ **All glow effects in Light theme = `none`:**
78
+
79
+ ```css
80
+ --metric-default-glow: none;
81
+ --metric-secondary-glow: none;
82
+ --metric-success-glow: none;
83
+ --metric-warning-glow: none;
84
+ --metric-destructive-glow: none;
85
+ /* ... and 9 more */
86
+ ```
87
+
88
+ #### C. Glow Pattern Duplication
89
+
90
+ **Glass theme:** All glows use `0 0 12px <color> / 0.4` pattern
91
+
92
+ ```css
93
+ --metric-default-glow: 0 0 12px oklch(70.7% 0.143 250 / 0.4);
94
+ --metric-success-glow: 0 0 12px oklch(76.5% 0.147 163 / 0.4);
95
+ --metric-warning-glow: 0 0 12px oklch(82.8% 0.157 84 / 0.4);
96
+ --metric-destructive-glow: 0 0 12px oklch(71.2% 0.161 12 / 0.4);
97
+ ```
98
+
99
+ **Aurora theme:** All glows use `0 0 10px <color> / 0.35` pattern (except secondary:
100
+ `0 0 8px / 0.25`)
101
+
102
+ ```css
103
+ --metric-default-glow: 0 0 10px oklch(70.7% 0.143 250 / 0.35);
104
+ --metric-success-glow: 0 0 10px oklch(76.5% 0.147 163 / 0.35);
105
+ --metric-warning-glow: 0 0 10px oklch(82.8% 0.157 84 / 0.35);
106
+ --metric-destructive-glow: 0 0 10px oklch(71.5% 0.179 27 / 0.35);
107
+ ```
108
+
109
+ ---
110
+
111
+ ## 💡 Optimization Recommendations
112
+
113
+ ### Priority 1: Remove Unused Variables ⚠️
114
+
115
+ **Investigate if these `transparent` variables are actually used:**
116
+
117
+ If `--metric-*-bg` and `--metric-*-border` are never used (always transparent), they can be removed
118
+ entirely:
119
+
120
+ ```css
121
+ /* Can be removed if unused: */
122
+ --metric-default-bg: transparent; /* Used anywhere? */
123
+ --metric-default-border: transparent; /* Used anywhere? */
124
+ --metric-success-bg: transparent; /* Used anywhere? */
125
+ --metric-success-border: transparent; /* Used anywhere? */
126
+ /* ... etc */
127
+ ```
128
+
129
+ **Action:** Search codebase for usage of these variables. If unused, remove from all themes.
130
+
131
+ **Potential savings:** ~16 variables × 3 themes = 48 variable definitions
132
+
133
+ ---
134
+
135
+ ### Priority 2: Simplify Glow System 🎨
136
+
137
+ **Current:** Each metric variant has its own glow variable with repeated patterns.
138
+
139
+ **Proposal:** Use CSS functions or global glow intensity variables.
140
+
141
+ #### Option A: Glow Intensity Tokens
142
+
143
+ ```css
144
+ /* Global tokens (add to root or theme) */
145
+ --glow-radius-sm: 8px;
146
+ --glow-radius-md: 10px;
147
+ --glow-radius-lg: 12px;
148
+ --glow-opacity-light: 0.25;
149
+ --glow-opacity-medium: 0.35;
150
+ --glow-opacity-strong: 0.4;
151
+
152
+ /* Then in themes: */
153
+ [data-theme='glass'] {
154
+ --glow-radius: var(--glow-radius-lg); /* 12px */
155
+ --glow-opacity: var(--glow-opacity-strong); /* 0.4 */
156
+ }
157
+
158
+ [data-theme='aurora'] {
159
+ --glow-radius: var(--glow-radius-md); /* 10px */
160
+ --glow-opacity: var(--glow-opacity-medium); /* 0.35 */
161
+ }
162
+
163
+ [data-theme='light'] {
164
+ --glow-radius: 0;
165
+ --glow-opacity: 0;
166
+ }
167
+
168
+ /* Usage in metric variables: */
169
+ --metric-success-glow: 0 0 var(--glow-radius) oklch(76.5% 0.147 163 / var(--glow-opacity));
170
+ ```
171
+
172
+ **Savings:** Reduces pattern duplication, easier to adjust glow intensity globally.
173
+
174
+ ---
175
+
176
+ ### Priority 3: Consider Color Semantic Tokens 🎭
177
+
178
+ **Current issue:** Text colors differ between Glass/Aurora and Light themes.
179
+
180
+ **Example:**
181
+
182
+ ```css
183
+ /* Glass/Aurora */
184
+ --metric-success-text: oklch(76.5% 0.147 163); /* emerald-400 */
185
+
186
+ /* Light */
187
+ --metric-success-text: oklch(69.6% 0.155 163); /* emerald-500 */
188
+ ```
189
+
190
+ **Proposal:** Use semantic lightness tokens:
191
+
192
+ ```css
193
+ /* Root level */
194
+ --color-lightness-for-dark: 76.5%; /* 400-level colors */
195
+ --color-lightness-for-light: 69.6%; /* 500-level colors */
196
+
197
+ /* Then: */
198
+ [data-theme='glass'],
199
+ [data-theme='aurora'] {
200
+ --base-lightness: var(--color-lightness-for-dark);
201
+ }
202
+
203
+ [data-theme='light'] {
204
+ --base-lightness: var(--color-lightness-for-light);
205
+ }
206
+ ```
207
+
208
+ **Note:** This is more complex and may not be worth it unless you plan many more themes.
209
+
210
+ ---
211
+
212
+ ### Priority 4: Audit Deprecated Aliases Removal Timeline 📅
213
+
214
+ **Current status:** Deprecated aliases are defined but unused in codebase.
215
+
216
+ **Recommendation:**
217
+
218
+ 1. **v1.x** - Keep deprecated aliases (current state) ✅
219
+ 2. **v2.0** - Add deprecation warnings to CHANGELOG
220
+ 3. **v2.1** - Add console warnings when deprecated variables are detected
221
+ 4. **v3.0** - Remove deprecated aliases entirely
222
+
223
+ **Migration path for external consumers:**
224
+
225
+ ```md
226
+ ## Migration from v1.x to v2.x
227
+
228
+ Replace all deprecated metric color variables:
229
+
230
+ - `--metric-emerald-*` → `--metric-success-*`
231
+ - `--metric-amber-*` → `--metric-warning-*`
232
+ - `--metric-blue-*` → `--metric-default-*`
233
+ - `--metric-red-*` → `--metric-destructive-*`
234
+ ```
235
+
236
+ ---
237
+
238
+ ## 🚀 Implementation Priority
239
+
240
+ ### High Priority (Do Now)
241
+
242
+ 1. ✅ **Verify deprecated aliases are unused** - DONE
243
+ 2. 🔍 **Search for unused `transparent` variables** - TODO
244
+ 3. 📝 **Document removal timeline** - Add to CHANGELOG
245
+
246
+ ### Medium Priority (Consider for v2.0)
247
+
248
+ 4. 🎨 **Simplify glow system** with intensity tokens
249
+ 5. 📦 **Remove unused transparent variables** (if found)
250
+ 6. 🔧 **Add deprecation notices** to CHANGELOG
251
+
252
+ ### Low Priority (Future)
253
+
254
+ 7. 🎭 **Consider semantic color tokens** (if adding 5+ themes)
255
+ 8. 🧹 **Remove deprecated aliases** in v3.0
256
+
257
+ ---
258
+
259
+ ## 📝 Action Items
260
+
261
+ ### Immediate
262
+
263
+ - [ ] Search codebase for `--metric-*-bg` usage (bg variants)
264
+ - [ ] Search codebase for `--metric-*-border` usage (border variants)
265
+ - [ ] If unused, create PR to remove these variables from all themes
266
+
267
+ ### v2.0 Planning
268
+
269
+ - [x] Add deprecation notice to CHANGELOG.md (see [CHANGELOG.md](../CHANGELOG.md#unreleased))
270
+ - [ ] Update migration documentation
271
+ - [ ] Consider glow system refactoring
272
+
273
+ ### v3.0 Planning
274
+
275
+ - [ ] Remove all deprecated `--metric-emerald/amber/blue/red-*` aliases
276
+ - [ ] Update documentation
277
+
278
+ ---
279
+
280
+ ## 📊 Metrics
281
+
282
+ **Cleanup potential:**
283
+
284
+ - Unused transparent variables: Up to 48 definitions (16 vars × 3 themes)
285
+ - Deprecated aliases: 48 definitions (16 vars × 3 themes) - **keep for now**
286
+
287
+ **Total potential reduction:** ~96 variable definitions if all transparent vars are unused
288
+
289
+ **Actual impact:** Minimal - CSS variables are lightweight. Focus on:
290
+
291
+ 1. ✅ **Consistency** - Already achieved!
292
+ 2. 📚 **Maintainability** - Document removal timeline
293
+ 3. 🧹 **Cleanup** - Remove truly unused vars
294
+
295
+ ---
296
+
297
+ ## ✅ Conclusion
298
+
299
+ **Current state: EXCELLENT**
300
+
301
+ 1. ✅ No deprecated variable usage in components
302
+ 2. ✅ Consistent naming convention (shadcn/ui compatible)
303
+ 3. ✅ All tests passing with new variables
304
+ 4. 📋 Some optimization opportunities (transparent vars, glow patterns)
305
+
306
+ **Next steps:** Focus on Priority 1 (unused variable audit) and Priority 4 (deprecation timeline).
@@ -0,0 +1,330 @@
1
+ # CSS Variables Refactoring Plan
2
+
3
+ ## Problem Statement
4
+
5
+ Current state: **Massive color duplication** across 3 theme files (glass.css, light.css, aurora.css)
6
+
7
+ | Theme | Most Duplicated Color | Usage Count |
8
+ | ------ | --------------------------------- | ----------- |
9
+ | Glass | `oklch(66.6% 0.159 303)` (purple) | 33+ times |
10
+ | Light | `oklch(54.1% 0.175 293)` (violet) | 28 times |
11
+ | Aurora | `oklch(62.7% 0.159 291)` (violet) | 20+ times |
12
+
13
+ Additional duplication:
14
+
15
+ - White with various alphas: 40+ uses per theme
16
+ - Semantic colors (success/warning/error): 12-16 uses each
17
+ - Border colors: 15-24 uses per theme
18
+ - Surface colors: 8-11 uses per theme
19
+
20
+ **Total duplication**: ~70% of CSS variables are duplicated color values
21
+
22
+ ---
23
+
24
+ ## Proposed Architecture
25
+
26
+ ### Three-Layer System
27
+
28
+ ```
29
+ ┌─────────────────────────────────────────────┐
30
+ │ Layer 3: Component Variables (unchanged) │
31
+ │ --btn-primary-bg, --input-border, etc. │
32
+ └─────────────────────────────────────────────┘
33
+ ↓ references
34
+ ┌─────────────────────────────────────────────┐
35
+ │ Layer 2: Semantic Tokens (NEW) │
36
+ │ --semantic-primary, --semantic-surface, etc. │
37
+ └─────────────────────────────────────────────┘
38
+ ↓ references
39
+ ┌─────────────────────────────────────────────┐
40
+ │ Layer 1: Primitive Tokens (NEW) │
41
+ │ --primitive-purple-500, --primitive-white-08 │
42
+ └─────────────────────────────────────────────┘
43
+ ```
44
+
45
+ ---
46
+
47
+ ## Layer 1: Primitive Tokens (primitives.css)
48
+
49
+ **Purpose**: Define raw color values once, reused by all themes
50
+
51
+ ```css
52
+ /* primitives.css - NEW FILE */
53
+ :root {
54
+ /* ============================================
55
+ PRIMITIVE COLOR TOKENS
56
+ Raw OKLCH values - DO NOT use directly
57
+ ============================================ */
58
+
59
+ /* Purple scale (glass theme primary) */
60
+ --primitive-purple-300: oklch(79.5% 0.103 293);
61
+ --primitive-purple-500: oklch(66.6% 0.159 303);
62
+ --primitive-violet-500: oklch(62.7% 0.159 291);
63
+ --primitive-violet-400: oklch(71.4% 0.138 291);
64
+
65
+ /* Light theme primary */
66
+ --primitive-violet-light-500: oklch(54.1% 0.175 293);
67
+
68
+ /* Semantic colors (shared across themes) */
69
+ --primitive-emerald-400: oklch(76.5% 0.147 163);
70
+ --primitive-amber-400: oklch(82.8% 0.157 84);
71
+ --primitive-rose-400: oklch(71.2% 0.161 12);
72
+ --primitive-blue-400: oklch(70.7% 0.143 250);
73
+
74
+ /* Neutral scale */
75
+ --primitive-white: oklch(100% 0 0);
76
+ --primitive-black: oklch(0% 0 0);
77
+ --primitive-neutral-900: oklch(27.9% 0.041 260);
78
+ --primitive-neutral-800: oklch(37.2% 0.044 257);
79
+ --primitive-neutral-700: oklch(55.4% 0.046 257);
80
+ --primitive-neutral-200: oklch(92.9% 0.013 255);
81
+ --primitive-neutral-100: oklch(96.8% 0.007 247);
82
+
83
+ /* ============================================
84
+ ALPHA UTILITIES
85
+ For creating opacity variants
86
+ ============================================ */
87
+ --alpha-05: 0.05;
88
+ --alpha-08: 0.08;
89
+ --alpha-10: 0.1;
90
+ --alpha-15: 0.15;
91
+ --alpha-20: 0.2;
92
+ --alpha-25: 0.25;
93
+ --alpha-30: 0.3;
94
+ --alpha-40: 0.4;
95
+ --alpha-50: 0.5;
96
+ --alpha-60: 0.6;
97
+ --alpha-80: 0.8;
98
+ --alpha-90: 0.9;
99
+ }
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Layer 2: Semantic Tokens (in each theme file)
105
+
106
+ **Purpose**: Theme-specific semantic mappings
107
+
108
+ ```css
109
+ /* glass.css */
110
+ [data-theme='glass'] {
111
+ /* ============================================
112
+ SEMANTIC COLOR TOKENS
113
+ Theme-agnostic names for component use
114
+ ============================================ */
115
+
116
+ /* Primary accent */
117
+ --semantic-primary: var(--primitive-purple-500);
118
+ --semantic-primary-muted: oklch(from var(--primitive-purple-500) l c h / var(--alpha-30));
119
+ --semantic-primary-subtle: oklch(from var(--primitive-purple-500) l c h / var(--alpha-20));
120
+ --semantic-primary-text: var(--primitive-purple-300);
121
+
122
+ /* Secondary accent */
123
+ --semantic-secondary: var(--primitive-violet-500);
124
+
125
+ /* Surfaces */
126
+ --semantic-surface: oklch(from var(--primitive-white) l c h / var(--alpha-08));
127
+ --semantic-surface-subtle: oklch(from var(--primitive-white) l c h / var(--alpha-05));
128
+ --semantic-surface-medium: oklch(from var(--primitive-white) l c h / var(--alpha-15));
129
+ --semantic-surface-strong: oklch(from var(--primitive-white) l c h / var(--alpha-22));
130
+
131
+ /* Borders */
132
+ --semantic-border: oklch(from var(--primitive-white) l c h / var(--alpha-15));
133
+ --semantic-border-subtle: oklch(from var(--primitive-white) l c h / var(--alpha-10));
134
+ --semantic-border-strong: oklch(from var(--primitive-white) l c h / var(--alpha-25));
135
+
136
+ /* Text */
137
+ --semantic-text: oklch(from var(--primitive-white) l c h / var(--alpha-90));
138
+ --semantic-text-muted: oklch(from var(--primitive-white) l c h / var(--alpha-60));
139
+ --semantic-text-subtle: oklch(from var(--primitive-white) l c h / var(--alpha-50));
140
+ --semantic-text-disabled: oklch(from var(--primitive-white) l c h / var(--alpha-30));
141
+
142
+ /* Semantic states (shared across themes) */
143
+ --semantic-success: var(--primitive-emerald-400);
144
+ --semantic-warning: var(--primitive-amber-400);
145
+ --semantic-error: var(--primitive-rose-400);
146
+ --semantic-info: var(--primitive-blue-400);
147
+ }
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Layer 3: Component Variables (existing)
153
+
154
+ **No changes needed** - component variables reference semantic tokens:
155
+
156
+ ```css
157
+ /* BEFORE (current) */
158
+ --btn-primary-bg: linear-gradient(135deg, oklch(66.6% 0.159 303), oklch(62.7% 0.159 291));
159
+ --stepper-step-completed-bg: oklch(66.6% 0.159 303);
160
+
161
+ /* AFTER (refactored) */
162
+ --btn-primary-bg: linear-gradient(135deg, var(--semantic-primary), var(--semantic-secondary));
163
+ --stepper-step-completed-bg: var(--semantic-primary);
164
+ ```
165
+
166
+ ---
167
+
168
+ ## Modern CSS Features Used
169
+
170
+ ### 1. `oklch(from ...)` Relative Color Syntax
171
+
172
+ ```css
173
+ /* Create alpha variants from base color */
174
+ --semantic-primary-muted: oklch(from var(--primitive-purple-500) l c h / 0.3);
175
+ ```
176
+
177
+ **Browser support**: Chrome 119+, Safari 16.4+, Firefox 128+ (2024)
178
+
179
+ **Fallback strategy**: Define explicit values for older browsers
180
+
181
+ ### 2. CSS Custom Property Composition
182
+
183
+ ```css
184
+ --semantic-surface: oklch(from var(--primitive-white) l c h / var(--alpha-08));
185
+ ```
186
+
187
+ ---
188
+
189
+ ## Migration Strategy
190
+
191
+ ### Phase 1: Foundation (Week 1)
192
+
193
+ - ✅ Create `src/styles/primitives.css`
194
+ - ✅ Define all primitive tokens
195
+ - ✅ Import in main CSS entry point
196
+ - ✅ Add semantic tokens to glass.css
197
+
198
+ ### Phase 2: Glass Theme Refactor (Week 2)
199
+
200
+ - Refactor all component variables in glass.css
201
+ - Replace hardcoded OKLCH with semantic token references
202
+ - Test visual appearance (no regressions)
203
+ - Run Storybook visual tests
204
+
205
+ ### Phase 3: Light Theme Refactor (Week 3)
206
+
207
+ - Add semantic tokens to light.css
208
+ - Refactor component variables
209
+ - Test visual appearance
210
+
211
+ ### Phase 4: Aurora Theme Refactor (Week 4)
212
+
213
+ - Add semantic tokens to aurora.css
214
+ - Refactor component variables
215
+ - Test visual appearance
216
+
217
+ ### Phase 5: Cleanup & Documentation (Week 5)
218
+
219
+ - Remove old `--color-*` tokens (replaced by `--semantic-*`)
220
+ - Update documentation
221
+ - Add migration guide for consumers
222
+ - Performance testing
223
+
224
+ ---
225
+
226
+ ## Expected Benefits
227
+
228
+ | Metric | Before | After | Improvement |
229
+ | ------------------- | ---------- | ---------- | ----------------------- |
230
+ | Unique color values | ~120 | ~30 | **75% reduction** |
231
+ | Lines of CSS | ~1500 | ~800 | **47% reduction** |
232
+ | Theme file size | ~500 lines | ~250 lines | **50% reduction** |
233
+ | Maintenance burden | High | Low | Easier to change colors |
234
+ | New theme creation | 500 lines | 50 lines | **90% faster** |
235
+
236
+ ---
237
+
238
+ ## Risk Assessment
239
+
240
+ ### Low Risk
241
+
242
+ - ✅ No breaking changes to public API
243
+ - ✅ Component variables stay the same
244
+ - ✅ Only internal implementation changes
245
+
246
+ ### Medium Risk
247
+
248
+ - ⚠️ Browser compatibility (`oklch(from ...)` requires modern browsers)
249
+ - ⚠️ Visual testing needed to catch subtle color shifts
250
+
251
+ ### Mitigation
252
+
253
+ - Provide fallback for older browsers using explicit OKLCH values
254
+ - Run full visual regression suite on all 3 themes
255
+ - Document browser requirements in README
256
+
257
+ ---
258
+
259
+ ## File Structure
260
+
261
+ ```
262
+ src/styles/
263
+ ├── primitives.css # NEW - Primitive color tokens
264
+ ├── themes/
265
+ │ ├── glass.css # MODIFIED - Semantic tokens + component vars
266
+ │ ├── light.css # MODIFIED - Semantic tokens + component vars
267
+ │ └── aurora.css # MODIFIED - Semantic tokens + component vars
268
+ └── utilities/
269
+ └── glass-effects.css # Existing blur/backdrop utilities
270
+ ```
271
+
272
+ ---
273
+
274
+ ## Example: Before & After
275
+
276
+ ### BEFORE (glass.css - current)
277
+
278
+ ```css
279
+ /* 33+ duplicates of this color */
280
+ --btn-primary-bg: linear-gradient(135deg, oklch(66.6% 0.159 303), oklch(62.7% 0.159 291));
281
+ --btn-primary-glow: 0 0 30px oklch(66.6% 0.159 303 / 0.6);
282
+ --checkbox-checked-bg: oklch(66.6% 0.159 303);
283
+ --tab-active-bg: oklch(66.6% 0.159 303 / 0.2);
284
+ --stepper-step-completed-bg: oklch(66.6% 0.159 303);
285
+ --modal-glow: 0 0 60px oklch(66.6% 0.159 303 / 0.35);
286
+ --slider-thumb-border: oklch(66.6% 0.159 303);
287
+ /* ... 26 more uses ... */
288
+ ```
289
+
290
+ ### AFTER (glass.css - refactored)
291
+
292
+ ```css
293
+ /* Semantic tokens (once) */
294
+ --semantic-primary: var(--primitive-purple-500);
295
+ --semantic-primary-muted: oklch(from var(--semantic-primary) l c h / 0.3);
296
+ --semantic-primary-subtle: oklch(from var(--semantic-primary) l c h / 0.2);
297
+
298
+ /* Component variables (reference semantic tokens) */
299
+ --btn-primary-bg: linear-gradient(135deg, var(--semantic-primary), var(--semantic-secondary));
300
+ --btn-primary-glow: 0 0 30px var(--semantic-primary-glow);
301
+ --checkbox-checked-bg: var(--semantic-primary);
302
+ --tab-active-bg: var(--semantic-primary-subtle);
303
+ --stepper-step-completed-bg: var(--semantic-primary);
304
+ --modal-glow: 0 0 60px var(--semantic-primary-glow);
305
+ --slider-thumb-border: var(--semantic-primary);
306
+ ```
307
+
308
+ **Result**: 33 duplicates → 1 definition, 32 references
309
+
310
+ ---
311
+
312
+ ## Next Steps
313
+
314
+ 1. **Review & Approve** this plan
315
+ 2. **Create primitives.css** with all base tokens
316
+ 3. **Refactor glass.css** (most complex theme)
317
+ 4. **Test thoroughly** (visual regression suite)
318
+ 5. **Refactor light.css & aurora.css**
319
+ 6. **Document** for contributors
320
+
321
+ ---
322
+
323
+ ## Open Questions
324
+
325
+ 1. Should we use `oklch(from ...)` syntax or define explicit alpha variants?
326
+ - **Recommendation**: Use explicit variants for better browser support
327
+ 2. Keep `--color-*` tokens or rename to `--semantic-*`?
328
+ - **Recommendation**: Rename to `--semantic-*` for clarity
329
+ 3. Should primitives.css be imported automatically or manually?
330
+ - **Recommendation**: Import in main glass-theme.css for automatic inclusion