@wrikka/theme 0.0.0-stage → 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.
package/uno.config.ts ADDED
@@ -0,0 +1,246 @@
1
+ import { dirname } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import { defineConfig, presetWind4, transformerDirectives, transformerVariantGroup } from "unocss";
4
+
5
+ // Absolute globs so the shared config scans the same files no matter which
6
+ // workspace (and cwd) imports it.
7
+ const here = dirname(fileURLToPath(import.meta.url)).replaceAll("\\", "/");
8
+ const srcGlob = "/**/*.{html,js,ts,jsx,tsx}";
9
+
10
+ export default defineConfig({
11
+ content: {
12
+ filesystem: [
13
+ `${here}/src${srcGlob}`,
14
+ `${here}/../*/src${srcGlob}`,
15
+ `${here}/../../apps/*/src${srcGlob}`,
16
+ `${here}/../../tools/*/src${srcGlob}`,
17
+ ],
18
+ },
19
+ presets: [
20
+ presetWind4({
21
+ dark: {
22
+ dark: 'html[data-theme="dark"]',
23
+ light: 'html[data-theme="light"]',
24
+ },
25
+ preflights: {
26
+ reset: true,
27
+ },
28
+ }),
29
+ ],
30
+ transformers: [transformerDirectives(), transformerVariantGroup()],
31
+ rules: [
32
+ // presetWind4 doesn't emit named z-* utilities - map them to the --su-z-* token scale.
33
+ [
34
+ /^z-(base|dropdown|sticky|fixed|modal-backdrop|modal|popover|tooltip|toast)$/,
35
+ (m) => ({ "z-index": `var(--su-z-${m[1]})` }),
36
+ ],
37
+ // presetWind4 only resolves numeric/bracket durations - map the named scale to --su-duration-*.
38
+ [
39
+ /^duration-(fast|normal|slow|slower)$/,
40
+ (m) => ({
41
+ "--un-duration": `var(--su-duration-${m[1]})`,
42
+ "transition-duration": `var(--su-duration-${m[1]})`,
43
+ }),
44
+ ],
45
+ // Density metrics live on their own tokens, not the spacing scale.
46
+ [/^h-control-(sm|md|lg)$/, (m) => ({ height: `var(--su-control-h-${m[1]})` })],
47
+ [/^h-row$/, () => ({ height: "var(--su-row-h)" })],
48
+ ],
49
+ theme: {
50
+ colors: {
51
+ background: "hsl(var(--color-background))",
52
+ foreground: "hsl(var(--color-foreground))",
53
+ primary: {
54
+ DEFAULT: "hsl(var(--color-primary))",
55
+ hover: "hsl(var(--color-primary-hover))",
56
+ active: "hsl(var(--color-primary-active))",
57
+ foreground: "hsl(var(--color-primary-foreground))",
58
+ soft: {
59
+ DEFAULT: "hsl(var(--color-primary-soft))",
60
+ foreground: "hsl(var(--color-primary-soft-foreground))",
61
+ },
62
+ ink: "hsl(var(--color-primary-ink))",
63
+ deep: "hsl(var(--color-primary-deep))",
64
+ tint: "hsl(var(--color-primary) / var(--su-alpha-tint))",
65
+ "tint-strong": "hsl(var(--color-primary) / var(--su-alpha-tint-strong))",
66
+ faint: "hsl(var(--color-primary) / var(--su-alpha-faint))",
67
+ wash: "hsl(var(--color-primary) / var(--su-alpha-wash))",
68
+ },
69
+ secondary: {
70
+ DEFAULT: "hsl(var(--color-secondary))",
71
+ hover: "hsl(var(--color-secondary-hover))",
72
+ active: "hsl(var(--color-secondary-active))",
73
+ foreground: "hsl(var(--color-secondary-foreground))",
74
+ },
75
+ accent: {
76
+ DEFAULT: "hsl(var(--color-accent))",
77
+ hover: "hsl(var(--color-accent-hover))",
78
+ active: "hsl(var(--color-accent-active))",
79
+ foreground: "hsl(var(--color-accent-foreground))",
80
+ },
81
+ muted: {
82
+ DEFAULT: "hsl(var(--color-muted))",
83
+ foreground: "hsl(var(--color-muted-foreground))",
84
+ },
85
+ destructive: {
86
+ DEFAULT: "hsl(var(--color-destructive))",
87
+ hover: "hsl(var(--color-destructive-hover))",
88
+ active: "hsl(var(--color-destructive-active))",
89
+ foreground: "hsl(var(--color-destructive-foreground))",
90
+ soft: {
91
+ DEFAULT: "hsl(var(--color-destructive-soft))",
92
+ foreground: "hsl(var(--color-destructive-soft-foreground))",
93
+ },
94
+ },
95
+ success: {
96
+ DEFAULT: "hsl(var(--color-success))",
97
+ foreground: "hsl(var(--color-success-foreground))",
98
+ soft: {
99
+ DEFAULT: "hsl(var(--color-success-soft))",
100
+ foreground: "hsl(var(--color-success-soft-foreground))",
101
+ },
102
+ },
103
+ warning: {
104
+ DEFAULT: "hsl(var(--color-warning))",
105
+ foreground: "hsl(var(--color-warning-foreground))",
106
+ soft: {
107
+ DEFAULT: "hsl(var(--color-warning-soft))",
108
+ foreground: "hsl(var(--color-warning-soft-foreground))",
109
+ },
110
+ },
111
+ info: {
112
+ DEFAULT: "hsl(var(--color-info))",
113
+ foreground: "hsl(var(--color-info-foreground))",
114
+ soft: {
115
+ DEFAULT: "hsl(var(--color-info-soft))",
116
+ foreground: "hsl(var(--color-info-soft-foreground))",
117
+ },
118
+ },
119
+ border: {
120
+ DEFAULT: "hsl(var(--color-border))",
121
+ hover: "hsl(var(--color-border-hover))",
122
+ },
123
+ input: "hsl(var(--color-input))",
124
+ ring: "hsl(var(--color-ring))",
125
+ surface: {
126
+ DEFAULT: "hsl(var(--color-surface))",
127
+ foreground: "hsl(var(--color-surface-foreground))",
128
+ elevated: "hsl(var(--color-surface-elevated))",
129
+ },
130
+ card: {
131
+ DEFAULT: "hsl(var(--color-surface))",
132
+ foreground: "hsl(var(--color-surface-foreground))",
133
+ },
134
+ focus: "hsl(var(--color-focus))",
135
+ overlay: "hsl(var(--color-overlay))",
136
+ scrim: "hsl(var(--color-scrim))",
137
+ skeleton: {
138
+ DEFAULT: "hsl(var(--color-skeleton))",
139
+ shine: "hsl(var(--color-skeleton-shine))",
140
+ },
141
+ },
142
+ font: {
143
+ sans: "var(--su-font-sans)",
144
+ mono: "var(--su-font-mono)",
145
+ },
146
+ text: {
147
+ "3xs": {
148
+ fontSize: "var(--su-text-3xs)",
149
+ lineHeight: "var(--su-leading-normal)",
150
+ },
151
+ "2xs": {
152
+ fontSize: "var(--su-text-2xs)",
153
+ lineHeight: "var(--su-leading-normal)",
154
+ },
155
+ xs: {
156
+ fontSize: "var(--su-text-xs)",
157
+ lineHeight: "var(--su-leading-normal)",
158
+ },
159
+ sm: {
160
+ fontSize: "var(--su-text-sm)",
161
+ lineHeight: "var(--su-leading-normal)",
162
+ },
163
+ base: {
164
+ fontSize: "var(--su-text-base)",
165
+ lineHeight: "var(--su-leading-normal)",
166
+ },
167
+ lg: {
168
+ fontSize: "var(--su-text-lg)",
169
+ lineHeight: "var(--su-leading-normal)",
170
+ },
171
+ xl: {
172
+ fontSize: "var(--su-text-xl)",
173
+ lineHeight: "var(--su-leading-normal)",
174
+ },
175
+ "2xl": {
176
+ fontSize: "var(--su-text-2xl)",
177
+ lineHeight: "var(--su-leading-tight)",
178
+ },
179
+ "3xl": {
180
+ fontSize: "var(--su-text-3xl)",
181
+ lineHeight: "var(--su-leading-tight)",
182
+ },
183
+ "4xl": {
184
+ fontSize: "var(--su-text-4xl)",
185
+ lineHeight: "var(--su-leading-tight)",
186
+ },
187
+ "5xl": {
188
+ fontSize: "var(--su-text-5xl)",
189
+ lineHeight: "var(--su-leading-tight)",
190
+ },
191
+ "6xl": {
192
+ fontSize: "var(--su-text-6xl)",
193
+ lineHeight: "var(--su-leading-tight)",
194
+ },
195
+ "7xl": {
196
+ fontSize: "var(--su-text-7xl)",
197
+ lineHeight: "var(--su-leading-tight)",
198
+ },
199
+ "8xl": {
200
+ fontSize: "var(--su-text-8xl)",
201
+ lineHeight: "var(--su-leading-tight)",
202
+ },
203
+ "9xl": {
204
+ fontSize: "var(--su-text-9xl)",
205
+ lineHeight: "var(--su-leading-tight)",
206
+ },
207
+ },
208
+ leading: {
209
+ none: "var(--su-leading-none)",
210
+ tight: "var(--su-leading-tight)",
211
+ normal: "var(--su-leading-normal)",
212
+ relaxed: "var(--su-leading-relaxed)",
213
+ },
214
+ spacing: {
215
+ gutter: "var(--su-gutter)",
216
+ },
217
+ radius: {
218
+ // Wind4 defaults bare `rounded` to its own 0.25rem; route it through the
219
+ // token so a radius preset reaches every `rounded` utility.
220
+ DEFAULT: "var(--su-radius-sm)",
221
+ sm: "var(--su-radius-sm)",
222
+ md: "var(--su-radius-md)",
223
+ lg: "var(--su-radius-lg)",
224
+ xl: "var(--su-radius-xl)",
225
+ full: "var(--su-radius-full)",
226
+ },
227
+ shadow: {
228
+ sm: "var(--su-shadow-sm)",
229
+ md: "var(--su-shadow-md)",
230
+ lg: "var(--su-shadow-lg)",
231
+ xl: "var(--su-shadow-xl)",
232
+ glow: "var(--su-shadow-glow)",
233
+ },
234
+ duration: {
235
+ fast: "var(--su-duration-fast)",
236
+ normal: "var(--su-duration-normal)",
237
+ slow: "var(--su-duration-slow)",
238
+ slower: "var(--su-duration-slower)",
239
+ },
240
+ ease: {
241
+ standard: "var(--su-ease-standard)",
242
+ decelerate: "var(--su-ease-decelerate)",
243
+ accelerate: "var(--su-ease-accelerate)",
244
+ },
245
+ },
246
+ });