@foundrykit/tailwind 1.0.5 → 1.0.6
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/.turbo/turbo-build.log +5 -0
- package/.turbo/turbo-type-check.log +5 -0
- package/CHANGELOG.md +6 -0
- package/README.md +12 -343
- package/package.json +7 -6
- package/src/globals.css +176 -43
- package/test/tokens.test.mjs +102 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @foundrykit/tailwind
|
|
2
2
|
|
|
3
|
+
## 1.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#43](https://github.com/umi-labs/foundry/pull/43) [`b6fc94d`](https://github.com/umi-labs/foundry/commit/b6fc94d3b0f172aa309388f61bd5306af6405fdf) Thanks [@sneddonisaac](https://github.com/sneddonisaac)! - Package metadata now points at the `umi-labs/foundry` monorepo, and releases publish through npm trusted publishing.
|
|
8
|
+
|
|
3
9
|
## 1.0.5
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,362 +1,31 @@
|
|
|
1
1
|
# @foundrykit/tailwind
|
|
2
2
|
|
|
3
|
-
Tailwind CSS
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Features
|
|
8
|
-
|
|
9
|
-
- **Design tokens** - Consistent colors, spacing, typography, and other design
|
|
10
|
-
values
|
|
11
|
-
- **Component utilities** - Pre-built utility classes for common component
|
|
12
|
-
patterns
|
|
13
|
-
- **Theme integration** - Seamless integration with your existing theme
|
|
14
|
-
- **CSS variables** - Modern CSS custom properties for dynamic theming
|
|
15
|
-
- **Tailwind v4** - Built for the latest Tailwind CSS version
|
|
3
|
+
Shared Tailwind CSS v4 theme for the FoundryKit design system. Ships a single
|
|
4
|
+
`globals.css` with design tokens (OKLCH color variables, light/dark theme),
|
|
5
|
+
`tailwindcss` and `tw-animate-css` imports, and workspace `@source` scanning.
|
|
16
6
|
|
|
17
7
|
## Installation
|
|
18
8
|
|
|
19
9
|
```bash
|
|
20
|
-
pnpm add @foundrykit/tailwind
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Quick Start
|
|
24
|
-
|
|
25
|
-
### 1. Import the CSS
|
|
26
|
-
|
|
27
|
-
In your main CSS file (e.g., `globals.css`):
|
|
28
|
-
|
|
29
|
-
```css
|
|
30
|
-
@import '@foundrykit/tailwind/globals.css';
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### 2. Use in Components
|
|
34
|
-
|
|
35
|
-
```tsx
|
|
36
|
-
import { Button } from '@foundrykit/primitives/button';
|
|
37
|
-
|
|
38
|
-
function MyComponent() {
|
|
39
|
-
return (
|
|
40
|
-
<Button className='bg-primary text-primary-foreground hover:bg-primary/90'>
|
|
41
|
-
Click me
|
|
42
|
-
</Button>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Design Tokens
|
|
48
|
-
|
|
49
|
-
### Colors
|
|
50
|
-
|
|
51
|
-
The package provides a comprehensive color system:
|
|
52
|
-
|
|
53
|
-
```css
|
|
54
|
-
/* Primary colors */
|
|
55
|
-
--color-primary: 222.2 84% 4.9%;
|
|
56
|
-
--color-primary-foreground: 210 40% 98%;
|
|
57
|
-
|
|
58
|
-
/* Secondary colors */
|
|
59
|
-
--color-secondary: 210 40% 96%;
|
|
60
|
-
--color-secondary-foreground: 222.2 84% 4.9%;
|
|
61
|
-
|
|
62
|
-
/* Accent colors */
|
|
63
|
-
--color-accent: 210 40% 96%;
|
|
64
|
-
--color-accent-foreground: 222.2 84% 4.9%;
|
|
65
|
-
|
|
66
|
-
/* Semantic colors */
|
|
67
|
-
--color-destructive: 0 84.2% 60.2%;
|
|
68
|
-
--color-destructive-foreground: 210 40% 98%;
|
|
69
|
-
--color-muted: 210 40% 96%;
|
|
70
|
-
--color-muted-foreground: 215.4 16.3% 46.9%;
|
|
71
|
-
--color-border: 214.3 31.8% 91.4%;
|
|
72
|
-
--color-input: 214.3 31.8% 91.4%;
|
|
73
|
-
--color-ring: 222.2 84% 4.9%;
|
|
74
|
-
--color-background: 0 0% 100%;
|
|
75
|
-
--color-foreground: 222.2 84% 4.9%;
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Spacing
|
|
79
|
-
|
|
80
|
-
Consistent spacing scale:
|
|
81
|
-
|
|
82
|
-
```css
|
|
83
|
-
--spacing-0: 0px;
|
|
84
|
-
--spacing-1: 0.25rem;
|
|
85
|
-
--spacing-2: 0.5rem;
|
|
86
|
-
--spacing-3: 0.75rem;
|
|
87
|
-
--spacing-4: 1rem;
|
|
88
|
-
--spacing-5: 1.25rem;
|
|
89
|
-
--spacing-6: 1.5rem;
|
|
90
|
-
--spacing-8: 2rem;
|
|
91
|
-
--spacing-10: 2.5rem;
|
|
92
|
-
--spacing-12: 3rem;
|
|
93
|
-
--spacing-16: 4rem;
|
|
94
|
-
--spacing-20: 5rem;
|
|
95
|
-
--spacing-24: 6rem;
|
|
96
|
-
--spacing-32: 8rem;
|
|
97
|
-
--spacing-40: 10rem;
|
|
98
|
-
--spacing-48: 12rem;
|
|
99
|
-
--spacing-56: 14rem;
|
|
100
|
-
--spacing-64: 16rem;
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Typography
|
|
104
|
-
|
|
105
|
-
Typography tokens for consistent text styling:
|
|
106
|
-
|
|
107
|
-
```css
|
|
108
|
-
/* Font families */
|
|
109
|
-
--font-sans: ui-sans-serif, system-ui, sans-serif;
|
|
110
|
-
--font-serif: ui-serif, Georgia, serif;
|
|
111
|
-
--font-mono: ui-monospace, SFMono-Regular, monospace;
|
|
112
|
-
|
|
113
|
-
/* Font sizes */
|
|
114
|
-
--font-size-xs: 0.75rem;
|
|
115
|
-
--font-size-sm: 0.875rem;
|
|
116
|
-
--font-size-base: 1rem;
|
|
117
|
-
--font-size-lg: 1.125rem;
|
|
118
|
-
--font-size-xl: 1.25rem;
|
|
119
|
-
--font-size-2xl: 1.5rem;
|
|
120
|
-
--font-size-3xl: 1.875rem;
|
|
121
|
-
--font-size-4xl: 2.25rem;
|
|
122
|
-
--font-size-5xl: 3rem;
|
|
123
|
-
--font-size-6xl: 3.75rem;
|
|
124
|
-
|
|
125
|
-
/* Font weights */
|
|
126
|
-
--font-weight-thin: 100;
|
|
127
|
-
--font-weight-extralight: 200;
|
|
128
|
-
--font-weight-light: 300;
|
|
129
|
-
--font-weight-normal: 400;
|
|
130
|
-
--font-weight-medium: 500;
|
|
131
|
-
--font-weight-semibold: 600;
|
|
132
|
-
--font-weight-bold: 700;
|
|
133
|
-
--font-weight-extrabold: 800;
|
|
134
|
-
--font-weight-black: 900;
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Border Radius
|
|
138
|
-
|
|
139
|
-
Consistent border radius values:
|
|
140
|
-
|
|
141
|
-
```css
|
|
142
|
-
--radius-none: 0px;
|
|
143
|
-
--radius-sm: 0.125rem;
|
|
144
|
-
--radius-base: 0.25rem;
|
|
145
|
-
--radius-md: 0.375rem;
|
|
146
|
-
--radius-lg: 0.5rem;
|
|
147
|
-
--radius-xl: 0.75rem;
|
|
148
|
-
--radius-2xl: 1rem;
|
|
149
|
-
--radius-3xl: 1.5rem;
|
|
150
|
-
--radius-full: 9999px;
|
|
10
|
+
pnpm add @foundrykit/tailwind tailwindcss tw-animate-css
|
|
151
11
|
```
|
|
152
12
|
|
|
153
13
|
## Usage
|
|
154
14
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
```tsx
|
|
158
|
-
import { Button } from '@foundrykit/primitives/button';
|
|
159
|
-
|
|
160
|
-
function StyledButton() {
|
|
161
|
-
return (
|
|
162
|
-
<Button
|
|
163
|
-
className='
|
|
164
|
-
bg-primary text-primary-foreground
|
|
165
|
-
hover:bg-primary/90
|
|
166
|
-
rounded-md px-4 py-2
|
|
167
|
-
font-medium transition-colors
|
|
168
|
-
'
|
|
169
|
-
>
|
|
170
|
-
Styled Button
|
|
171
|
-
</Button>
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### Using Design Tokens
|
|
177
|
-
|
|
178
|
-
```tsx
|
|
179
|
-
function Card() {
|
|
180
|
-
return (
|
|
181
|
-
<div
|
|
182
|
-
className='
|
|
183
|
-
bg-background text-foreground
|
|
184
|
-
border-border rounded-lg border
|
|
185
|
-
p-6 shadow-sm
|
|
186
|
-
'
|
|
187
|
-
>
|
|
188
|
-
<h3 className='mb-2 text-lg font-semibold'>Card Title</h3>
|
|
189
|
-
<p className='text-muted-foreground'>Card content goes here</p>
|
|
190
|
-
</div>
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### Responsive Design
|
|
196
|
-
|
|
197
|
-
```tsx
|
|
198
|
-
function ResponsiveComponent() {
|
|
199
|
-
return (
|
|
200
|
-
<div
|
|
201
|
-
className='
|
|
202
|
-
grid grid-cols-1 gap-4 p-4
|
|
203
|
-
md:grid-cols-2 md:gap-6 md:p-6
|
|
204
|
-
lg:grid-cols-3 lg:gap-8 lg:p-8
|
|
205
|
-
'
|
|
206
|
-
>
|
|
207
|
-
{/* Content */}
|
|
208
|
-
</div>
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
### Dark Mode Support
|
|
214
|
-
|
|
215
|
-
```tsx
|
|
216
|
-
function ThemeAwareComponent() {
|
|
217
|
-
return (
|
|
218
|
-
<div
|
|
219
|
-
className='
|
|
220
|
-
bg-background text-foreground
|
|
221
|
-
dark:bg-background dark:text-foreground
|
|
222
|
-
border-border dark:border-border border
|
|
223
|
-
'
|
|
224
|
-
>
|
|
225
|
-
<p className='text-muted-foreground dark:text-muted-foreground'>
|
|
226
|
-
This component adapts to light and dark themes
|
|
227
|
-
</p>
|
|
228
|
-
</div>
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
## Customization
|
|
234
|
-
|
|
235
|
-
### Extending the Theme
|
|
236
|
-
|
|
237
|
-
Create your own `globals.css` to extend the theme:
|
|
238
|
-
|
|
239
|
-
```css
|
|
240
|
-
@import '@foundrykit/tailwind/globals.css';
|
|
241
|
-
|
|
242
|
-
/* Custom design tokens */
|
|
243
|
-
:root {
|
|
244
|
-
--color-brand: 220 14% 96%;
|
|
245
|
-
--color-brand-foreground: 220 9% 46%;
|
|
246
|
-
|
|
247
|
-
--font-size-custom: 1.1rem;
|
|
248
|
-
--spacing-custom: 1.75rem;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/* Custom utilities */
|
|
252
|
-
@utility custom-button {
|
|
253
|
-
@apply bg-brand text-brand-foreground px-custom rounded-md py-2;
|
|
254
|
-
}
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
### Component-Specific Styles
|
|
258
|
-
|
|
259
|
-
```css
|
|
260
|
-
/* Custom component styles */
|
|
261
|
-
@utility button-primary {
|
|
262
|
-
@apply bg-primary text-primary-foreground hover:bg-primary/90;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
@utility button-secondary {
|
|
266
|
-
@apply bg-secondary text-secondary-foreground hover:bg-secondary/80;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
@utility card-elevated {
|
|
270
|
-
@apply bg-background border-border rounded-lg border shadow-lg;
|
|
271
|
-
}
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
### Custom Color Palette
|
|
275
|
-
|
|
276
|
-
```css
|
|
277
|
-
/* Define custom colors */
|
|
278
|
-
:root {
|
|
279
|
-
--color-custom-blue: 221 83% 53%;
|
|
280
|
-
--color-custom-green: 142 76% 36%;
|
|
281
|
-
--color-custom-purple: 262 83% 58%;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/* Use in components */
|
|
285
|
-
.custom-button {
|
|
286
|
-
background-color: hsl(var(--color-custom-blue));
|
|
287
|
-
color: white;
|
|
288
|
-
}
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
## Integration with Frameworks
|
|
292
|
-
|
|
293
|
-
### Next.js
|
|
294
|
-
|
|
295
|
-
In your `app/globals.css`:
|
|
296
|
-
|
|
297
|
-
```css
|
|
298
|
-
@import '@foundrykit/tailwind/globals.css';
|
|
299
|
-
|
|
300
|
-
/* Your custom styles */
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
### React (Vite)
|
|
304
|
-
|
|
305
|
-
In your `src/index.css`:
|
|
306
|
-
|
|
307
|
-
```css
|
|
308
|
-
@import '@foundrykit/tailwind/globals.css';
|
|
309
|
-
|
|
310
|
-
/* Your custom styles */
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
### Vue
|
|
314
|
-
|
|
315
|
-
In your `src/assets/main.css`:
|
|
15
|
+
Import the stylesheet once at the root of your app (for example in your global
|
|
16
|
+
CSS entry):
|
|
316
17
|
|
|
317
18
|
```css
|
|
318
|
-
@import
|
|
319
|
-
|
|
320
|
-
/* Your custom styles */
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
## Performance
|
|
324
|
-
|
|
325
|
-
### Optimized Bundle
|
|
326
|
-
|
|
327
|
-
- Tree-shakable CSS
|
|
328
|
-
- Minimal runtime overhead
|
|
329
|
-
- Efficient class generation
|
|
330
|
-
- Optimized for Tailwind v4
|
|
331
|
-
|
|
332
|
-
### Best Practices
|
|
333
|
-
|
|
334
|
-
```tsx
|
|
335
|
-
// ✅ Good - Use semantic class names
|
|
336
|
-
<div className="bg-background text-foreground p-4 rounded-lg">
|
|
337
|
-
|
|
338
|
-
// ❌ Avoid - Hard-coded values
|
|
339
|
-
<div className="bg-white text-black p-4 rounded-lg">
|
|
19
|
+
@import "@foundrykit/tailwind/globals.css";
|
|
340
20
|
```
|
|
341
21
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
1. **Update imports** - Use the new CSS import syntax
|
|
347
|
-
2. **Remove config files** - Tailwind v4 uses CSS-based configuration
|
|
348
|
-
3. **Update class names** - Some utilities may have changed
|
|
349
|
-
4. **Test thoroughly** - Verify all styles work as expected
|
|
350
|
-
|
|
351
|
-
## Contributing
|
|
22
|
+
This pulls in Tailwind v4, the animation utilities, and the FoundryKit token
|
|
23
|
+
variables (`--background`, `--foreground`, `--primary`, chart colors, etc.),
|
|
24
|
+
which are consumed by FoundryKit components.
|
|
352
25
|
|
|
353
|
-
|
|
26
|
+
## Exports
|
|
354
27
|
|
|
355
|
-
|
|
356
|
-
2. Ensure accessibility compliance
|
|
357
|
-
3. Test with both light and dark themes
|
|
358
|
-
4. Update this README
|
|
359
|
-
5. Maintain backward compatibility
|
|
28
|
+
- `@foundrykit/tailwind/globals.css` — the complete Tailwind v4 theme and tokens.
|
|
360
29
|
|
|
361
30
|
## License
|
|
362
31
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foundrykit/tailwind",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -16,18 +16,19 @@
|
|
|
16
16
|
"tailwindcss": "^4.1.1",
|
|
17
17
|
"tw-animate-css": "^1.2.0"
|
|
18
18
|
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"eslint": "^9.0.0",
|
|
21
|
-
"@foundrykit/eslint-config": "1.0.5"
|
|
22
|
-
},
|
|
23
19
|
"peerDependencies": {
|
|
24
20
|
"tailwindcss": "^4.1.1",
|
|
25
21
|
"tw-animate-css": "^1.2.0"
|
|
26
22
|
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/umi-labs/foundry.git",
|
|
26
|
+
"directory": "packages/tailwind"
|
|
27
|
+
},
|
|
27
28
|
"scripts": {
|
|
28
29
|
"build": "echo 'No build required for CSS package'",
|
|
29
30
|
"dev": "echo 'No dev build required for CSS package'",
|
|
30
|
-
"lint": "
|
|
31
|
+
"lint": "echo 'No lintable files in CSS package'",
|
|
31
32
|
"type-check": "echo 'No TypeScript files to check'"
|
|
32
33
|
}
|
|
33
34
|
}
|
package/src/globals.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
@import
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
@import "tw-animate-css";
|
|
3
3
|
@source "../../../apps/**/*.{ts,tsx}";
|
|
4
4
|
@source "../../../components/**/*.{ts,tsx}";
|
|
5
5
|
@source "../**/*.{ts,tsx}";
|
|
@@ -10,30 +10,148 @@
|
|
|
10
10
|
/* When consumed from npm: scan installed @foundrykit packages */
|
|
11
11
|
@source "../../../node_modules/@foundrykit/**/*.{ts,tsx,js,jsx,mjs,cjs}";
|
|
12
12
|
|
|
13
|
-
@import 'tw-animate-css';
|
|
14
|
-
|
|
15
13
|
@custom-variant dark (&:is(.dark *));
|
|
16
14
|
|
|
15
|
+
/* ---------------------------------------------------------------------------
|
|
16
|
+
Tier 1 — primitive color scales (Umi palette). Constant across light/dark.
|
|
17
|
+
50 = lightest, 950 = darkest, 500 = brand base. Defined in @theme so they
|
|
18
|
+
generate utilities (bg-primary-500, text-accent-200, border-warning-700, …).
|
|
19
|
+
--------------------------------------------------------------------------- */
|
|
20
|
+
@theme {
|
|
21
|
+
/* primary — Umi Blue #368DB1 */
|
|
22
|
+
--color-primary-50: oklch(0.985 0.0176 229.12);
|
|
23
|
+
--color-primary-100: oklch(0.9094 0.0294 229.12);
|
|
24
|
+
--color-primary-200: oklch(0.8337 0.049 229.12);
|
|
25
|
+
--color-primary-300: oklch(0.7581 0.0686 229.12);
|
|
26
|
+
--color-primary-400: oklch(0.6824 0.0882 229.12);
|
|
27
|
+
--color-primary-500: oklch(0.6068 0.0981 229.12);
|
|
28
|
+
--color-primary-600: oklch(0.5254 0.0981 229.12);
|
|
29
|
+
--color-primary-700: oklch(0.4441 0.0931 229.12);
|
|
30
|
+
--color-primary-800: oklch(0.3627 0.0833 229.12);
|
|
31
|
+
--color-primary-900: oklch(0.2814 0.0706 229.12);
|
|
32
|
+
--color-primary-950: oklch(0.2 0.0637 229.12);
|
|
33
|
+
|
|
34
|
+
/* secondary — Umi Black #313E4E */
|
|
35
|
+
--color-secondary-50: oklch(0.985 0.0059 253.87);
|
|
36
|
+
--color-secondary-100: oklch(0.8598 0.0098 253.87);
|
|
37
|
+
--color-secondary-200: oklch(0.7347 0.0164 253.87);
|
|
38
|
+
--color-secondary-300: oklch(0.6095 0.0229 253.87);
|
|
39
|
+
--color-secondary-400: oklch(0.4843 0.0295 253.87);
|
|
40
|
+
--color-secondary-500: oklch(0.3591 0.0327 253.87);
|
|
41
|
+
--color-secondary-600: oklch(0.3273 0.0327 253.87);
|
|
42
|
+
--color-secondary-700: oklch(0.2955 0.0311 253.87);
|
|
43
|
+
--color-secondary-800: oklch(0.2637 0.0278 253.87);
|
|
44
|
+
--color-secondary-900: oklch(0.2318 0.0236 253.87);
|
|
45
|
+
--color-secondary-950: oklch(0.2 0.0213 253.87);
|
|
46
|
+
|
|
47
|
+
/* tertiary — Umi Yellow #FFE48C */
|
|
48
|
+
--color-tertiary-50: oklch(0.985 0.0201 92.92);
|
|
49
|
+
--color-tertiary-100: oklch(0.9725 0.0335 92.92);
|
|
50
|
+
--color-tertiary-200: oklch(0.9599 0.0559 92.92);
|
|
51
|
+
--color-tertiary-300: oklch(0.9474 0.0783 92.92);
|
|
52
|
+
--color-tertiary-400: oklch(0.9349 0.1006 92.92);
|
|
53
|
+
--color-tertiary-500: oklch(0.9224 0.1118 92.92);
|
|
54
|
+
--color-tertiary-600: oklch(0.7779 0.1118 92.92);
|
|
55
|
+
--color-tertiary-700: oklch(0.6334 0.1062 92.92);
|
|
56
|
+
--color-tertiary-800: oklch(0.4889 0.0951 92.92);
|
|
57
|
+
--color-tertiary-900: oklch(0.3445 0.0805 92.92);
|
|
58
|
+
--color-tertiary-950: oklch(0.2 0.0727 92.92);
|
|
59
|
+
|
|
60
|
+
/* accent — Umi Light Blue #90DEE6 */
|
|
61
|
+
--color-accent-50: oklch(0.985 0.0139 204.05);
|
|
62
|
+
--color-accent-100: oklch(0.9586 0.0232 204.05);
|
|
63
|
+
--color-accent-200: oklch(0.9322 0.0387 204.05);
|
|
64
|
+
--color-accent-300: oklch(0.9057 0.0542 204.05);
|
|
65
|
+
--color-accent-400: oklch(0.8793 0.0697 204.05);
|
|
66
|
+
--color-accent-500: oklch(0.8529 0.0774 204.05);
|
|
67
|
+
--color-accent-600: oklch(0.7223 0.0774 204.05);
|
|
68
|
+
--color-accent-700: oklch(0.5917 0.0736 204.05);
|
|
69
|
+
--color-accent-800: oklch(0.4612 0.0658 204.05);
|
|
70
|
+
--color-accent-900: oklch(0.3306 0.0557 204.05);
|
|
71
|
+
--color-accent-950: oklch(0.2 0.0503 204.05);
|
|
72
|
+
|
|
73
|
+
/* destructive — Error #B42318 */
|
|
74
|
+
--color-destructive-50: oklch(0.985 0.0328 29.51);
|
|
75
|
+
--color-destructive-100: oklch(0.8881 0.0546 29.51);
|
|
76
|
+
--color-destructive-200: oklch(0.7911 0.091 29.51);
|
|
77
|
+
--color-destructive-300: oklch(0.6942 0.1274 29.51);
|
|
78
|
+
--color-destructive-400: oklch(0.5973 0.1638 29.51);
|
|
79
|
+
--color-destructive-500: oklch(0.5003 0.1821 29.51);
|
|
80
|
+
--color-destructive-600: oklch(0.4403 0.1821 29.51);
|
|
81
|
+
--color-destructive-700: oklch(0.3802 0.1729 29.51);
|
|
82
|
+
--color-destructive-800: oklch(0.3201 0.1547 29.51);
|
|
83
|
+
--color-destructive-900: oklch(0.2601 0.1311 29.51);
|
|
84
|
+
--color-destructive-950: oklch(0.2 0.1183 29.51);
|
|
85
|
+
|
|
86
|
+
/* success — Success #027A48 */
|
|
87
|
+
--color-success-50: oklch(0.985 0.0219 156.56);
|
|
88
|
+
--color-success-100: oklch(0.89 0.0365 156.56);
|
|
89
|
+
--color-success-200: oklch(0.795 0.0609 156.56);
|
|
90
|
+
--color-success-300: oklch(0.7 0.0853 156.56);
|
|
91
|
+
--color-success-400: oklch(0.605 0.1096 156.56);
|
|
92
|
+
--color-success-500: oklch(0.51 0.1218 156.56);
|
|
93
|
+
--color-success-600: oklch(0.448 0.1218 156.56);
|
|
94
|
+
--color-success-700: oklch(0.386 0.1157 156.56);
|
|
95
|
+
--color-success-800: oklch(0.324 0.1036 156.56);
|
|
96
|
+
--color-success-900: oklch(0.262 0.0877 156.56);
|
|
97
|
+
--color-success-950: oklch(0.2 0.0792 156.56);
|
|
98
|
+
|
|
99
|
+
/* warning — Warning #FF9800 */
|
|
100
|
+
--color-warning-50: oklch(0.985 0.0313 64.05);
|
|
101
|
+
--color-warning-100: oklch(0.9421 0.0522 64.05);
|
|
102
|
+
--color-warning-200: oklch(0.8991 0.0871 64.05);
|
|
103
|
+
--color-warning-300: oklch(0.8562 0.1219 64.05);
|
|
104
|
+
--color-warning-400: oklch(0.8132 0.1567 64.05);
|
|
105
|
+
--color-warning-500: oklch(0.7703 0.1741 64.05);
|
|
106
|
+
--color-warning-600: oklch(0.6562 0.1741 64.05);
|
|
107
|
+
--color-warning-700: oklch(0.5422 0.1654 64.05);
|
|
108
|
+
--color-warning-800: oklch(0.4281 0.148 64.05);
|
|
109
|
+
--color-warning-900: oklch(0.3141 0.1254 64.05);
|
|
110
|
+
--color-warning-950: oklch(0.2 0.1132 64.05);
|
|
111
|
+
|
|
112
|
+
/* neutral — cool grey (Umi Black family); drives surfaces/text/borders */
|
|
113
|
+
--color-neutral-50: oklch(0.985 0.0042 250.59);
|
|
114
|
+
--color-neutral-100: oklch(0.8883 0.007 250.59);
|
|
115
|
+
--color-neutral-200: oklch(0.7917 0.0117 250.59);
|
|
116
|
+
--color-neutral-300: oklch(0.695 0.0164 250.59);
|
|
117
|
+
--color-neutral-400: oklch(0.5984 0.0211 250.59);
|
|
118
|
+
--color-neutral-500: oklch(0.5017 0.0235 250.59);
|
|
119
|
+
--color-neutral-600: oklch(0.4414 0.0235 250.59);
|
|
120
|
+
--color-neutral-700: oklch(0.381 0.0223 250.59);
|
|
121
|
+
--color-neutral-800: oklch(0.3207 0.02 250.59);
|
|
122
|
+
--color-neutral-900: oklch(0.2603 0.0169 250.59);
|
|
123
|
+
--color-neutral-950: oklch(0.2 0.0153 250.59);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* ---------------------------------------------------------------------------
|
|
127
|
+
Tier 2 — semantic roles (light). Reference Tier-1 steps; flip in .dark.
|
|
128
|
+
--------------------------------------------------------------------------- */
|
|
17
129
|
:root {
|
|
18
|
-
--background:
|
|
19
|
-
--foreground:
|
|
20
|
-
--card:
|
|
21
|
-
--card-foreground:
|
|
22
|
-
--popover:
|
|
23
|
-
--popover-foreground:
|
|
24
|
-
--primary:
|
|
25
|
-
--primary-foreground:
|
|
26
|
-
--secondary:
|
|
27
|
-
--secondary-foreground:
|
|
28
|
-
--
|
|
29
|
-
--
|
|
30
|
-
--accent:
|
|
31
|
-
--accent-foreground:
|
|
32
|
-
--
|
|
33
|
-
--
|
|
34
|
-
--
|
|
35
|
-
--
|
|
36
|
-
--
|
|
130
|
+
--background: var(--color-neutral-50);
|
|
131
|
+
--foreground: var(--color-neutral-900);
|
|
132
|
+
--card: var(--color-neutral-50);
|
|
133
|
+
--card-foreground: var(--color-neutral-900);
|
|
134
|
+
--popover: var(--color-neutral-50);
|
|
135
|
+
--popover-foreground: var(--color-neutral-900);
|
|
136
|
+
--primary: var(--color-primary-600);
|
|
137
|
+
--primary-foreground: var(--color-primary-50);
|
|
138
|
+
--secondary: var(--color-secondary-500);
|
|
139
|
+
--secondary-foreground: var(--color-secondary-50);
|
|
140
|
+
--tertiary: var(--color-tertiary-500);
|
|
141
|
+
--tertiary-foreground: var(--color-tertiary-950);
|
|
142
|
+
--accent: var(--color-accent-100);
|
|
143
|
+
--accent-foreground: var(--color-accent-900);
|
|
144
|
+
--muted: var(--color-neutral-100);
|
|
145
|
+
--muted-foreground: var(--color-neutral-600);
|
|
146
|
+
--destructive: var(--color-destructive-500);
|
|
147
|
+
--destructive-foreground: var(--color-destructive-50);
|
|
148
|
+
--success: var(--color-success-500);
|
|
149
|
+
--success-foreground: var(--color-success-50);
|
|
150
|
+
--warning: var(--color-warning-500);
|
|
151
|
+
--warning-foreground: var(--color-warning-950);
|
|
152
|
+
--border: var(--color-neutral-200);
|
|
153
|
+
--input: var(--color-neutral-200);
|
|
154
|
+
--ring: var(--color-primary-500);
|
|
37
155
|
--chart-1: oklch(0.646 0.222 41.116);
|
|
38
156
|
--chart-2: oklch(0.6 0.118 184.704);
|
|
39
157
|
--chart-3: oklch(0.398 0.07 227.392);
|
|
@@ -51,25 +169,31 @@
|
|
|
51
169
|
}
|
|
52
170
|
|
|
53
171
|
.dark {
|
|
54
|
-
--background:
|
|
55
|
-
--foreground:
|
|
56
|
-
--card:
|
|
57
|
-
--card-foreground:
|
|
58
|
-
--popover:
|
|
59
|
-
--popover-foreground:
|
|
60
|
-
--primary:
|
|
61
|
-
--primary-foreground:
|
|
62
|
-
--secondary:
|
|
63
|
-
--secondary-foreground:
|
|
64
|
-
--
|
|
65
|
-
--
|
|
66
|
-
--accent:
|
|
67
|
-
--accent-foreground:
|
|
68
|
-
--
|
|
69
|
-
--
|
|
70
|
-
--
|
|
71
|
-
--
|
|
72
|
-
--
|
|
172
|
+
--background: var(--color-neutral-950);
|
|
173
|
+
--foreground: var(--color-neutral-50);
|
|
174
|
+
--card: var(--color-neutral-900);
|
|
175
|
+
--card-foreground: var(--color-neutral-50);
|
|
176
|
+
--popover: var(--color-neutral-900);
|
|
177
|
+
--popover-foreground: var(--color-neutral-50);
|
|
178
|
+
--primary: var(--color-primary-400);
|
|
179
|
+
--primary-foreground: var(--color-primary-950);
|
|
180
|
+
--secondary: var(--color-secondary-700);
|
|
181
|
+
--secondary-foreground: var(--color-secondary-50);
|
|
182
|
+
--tertiary: var(--color-tertiary-500);
|
|
183
|
+
--tertiary-foreground: var(--color-tertiary-950);
|
|
184
|
+
--accent: var(--color-accent-900);
|
|
185
|
+
--accent-foreground: var(--color-accent-50);
|
|
186
|
+
--muted: var(--color-neutral-800);
|
|
187
|
+
--muted-foreground: var(--color-neutral-400);
|
|
188
|
+
--destructive: var(--color-destructive-500);
|
|
189
|
+
--destructive-foreground: var(--color-destructive-50);
|
|
190
|
+
--success: var(--color-success-500);
|
|
191
|
+
--success-foreground: var(--color-success-50);
|
|
192
|
+
--warning: var(--color-warning-500);
|
|
193
|
+
--warning-foreground: var(--color-warning-950);
|
|
194
|
+
--border: var(--color-neutral-800);
|
|
195
|
+
--input: var(--color-neutral-800);
|
|
196
|
+
--ring: var(--color-primary-400);
|
|
73
197
|
--chart-1: oklch(0.488 0.243 264.376);
|
|
74
198
|
--chart-2: oklch(0.696 0.17 162.48);
|
|
75
199
|
--chart-3: oklch(0.769 0.188 70.08);
|
|
@@ -85,6 +209,9 @@
|
|
|
85
209
|
--sidebar-ring: oklch(0.439 0 0);
|
|
86
210
|
}
|
|
87
211
|
|
|
212
|
+
/* ---------------------------------------------------------------------------
|
|
213
|
+
Re-expose semantic roles as Tailwind color utilities, reactive to .dark.
|
|
214
|
+
--------------------------------------------------------------------------- */
|
|
88
215
|
@theme inline {
|
|
89
216
|
--color-background: var(--background);
|
|
90
217
|
--color-foreground: var(--foreground);
|
|
@@ -96,12 +223,18 @@
|
|
|
96
223
|
--color-primary-foreground: var(--primary-foreground);
|
|
97
224
|
--color-secondary: var(--secondary);
|
|
98
225
|
--color-secondary-foreground: var(--secondary-foreground);
|
|
226
|
+
--color-tertiary: var(--tertiary);
|
|
227
|
+
--color-tertiary-foreground: var(--tertiary-foreground);
|
|
99
228
|
--color-muted: var(--muted);
|
|
100
229
|
--color-muted-foreground: var(--muted-foreground);
|
|
101
230
|
--color-accent: var(--accent);
|
|
102
231
|
--color-accent-foreground: var(--accent-foreground);
|
|
103
232
|
--color-destructive: var(--destructive);
|
|
104
233
|
--color-destructive-foreground: var(--destructive-foreground);
|
|
234
|
+
--color-success: var(--success);
|
|
235
|
+
--color-success-foreground: var(--success-foreground);
|
|
236
|
+
--color-warning: var(--warning);
|
|
237
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
105
238
|
--color-border: var(--border);
|
|
106
239
|
--color-input: var(--input);
|
|
107
240
|
--color-ring: var(--ring);
|
|
@@ -133,7 +266,7 @@
|
|
|
133
266
|
}
|
|
134
267
|
|
|
135
268
|
button:not(:disabled),
|
|
136
|
-
[role=
|
|
269
|
+
[role="button"]:not(:disabled) {
|
|
137
270
|
cursor: pointer;
|
|
138
271
|
}
|
|
139
272
|
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { test } from 'node:test';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
const css = readFileSync(
|
|
7
|
+
fileURLToPath(new URL('../src/globals.css', import.meta.url)),
|
|
8
|
+
'utf8'
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
const ROLES = [
|
|
12
|
+
'primary',
|
|
13
|
+
'secondary',
|
|
14
|
+
'tertiary',
|
|
15
|
+
'accent',
|
|
16
|
+
'destructive',
|
|
17
|
+
'success',
|
|
18
|
+
'warning',
|
|
19
|
+
'neutral',
|
|
20
|
+
];
|
|
21
|
+
const STEPS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
22
|
+
|
|
23
|
+
test('every scale defines all 11 steps', () => {
|
|
24
|
+
for (const role of ROLES) {
|
|
25
|
+
for (const step of STEPS) {
|
|
26
|
+
assert.match(
|
|
27
|
+
css,
|
|
28
|
+
new RegExp(`--color-${role}-${step}:\\s*oklch\\(`),
|
|
29
|
+
`missing --color-${role}-${step}`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('each scale lightness is strictly decreasing 50 -> 950', () => {
|
|
36
|
+
for (const role of ROLES) {
|
|
37
|
+
const ls = STEPS.map(step => {
|
|
38
|
+
const m = css.match(
|
|
39
|
+
new RegExp(`--color-${role}-${step}:\\s*oklch\\(([0-9.]+)`)
|
|
40
|
+
);
|
|
41
|
+
assert.ok(m, `no oklch lightness for --color-${role}-${step}`);
|
|
42
|
+
return Number(m[1]);
|
|
43
|
+
});
|
|
44
|
+
for (let i = 1; i < ls.length; i++) {
|
|
45
|
+
assert.ok(
|
|
46
|
+
ls[i] < ls[i - 1],
|
|
47
|
+
`${role}: L[${STEPS[i]}]=${ls[i]} not < L[${STEPS[i - 1]}]=${ls[i - 1]}`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('all semantic roles and their foregrounds are defined', () => {
|
|
54
|
+
const SEMANTIC = [
|
|
55
|
+
'primary',
|
|
56
|
+
'secondary',
|
|
57
|
+
'tertiary',
|
|
58
|
+
'accent',
|
|
59
|
+
'destructive',
|
|
60
|
+
'success',
|
|
61
|
+
'warning',
|
|
62
|
+
];
|
|
63
|
+
for (const role of SEMANTIC) {
|
|
64
|
+
assert.match(
|
|
65
|
+
css,
|
|
66
|
+
new RegExp(`(?<!-)--${role}:\\s*var\\(`),
|
|
67
|
+
`missing --${role}`
|
|
68
|
+
);
|
|
69
|
+
assert.match(
|
|
70
|
+
css,
|
|
71
|
+
new RegExp(`--${role}-foreground:\\s*var\\(`),
|
|
72
|
+
`missing --${role}-foreground`
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
for (const t of [
|
|
76
|
+
'background',
|
|
77
|
+
'foreground',
|
|
78
|
+
'muted',
|
|
79
|
+
'border',
|
|
80
|
+
'input',
|
|
81
|
+
'ring',
|
|
82
|
+
]) {
|
|
83
|
+
assert.match(css, new RegExp(`--${t}:\\s*var\\(`), `missing --${t}`);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('new roles are exposed as Tailwind utilities via @theme inline', () => {
|
|
88
|
+
for (const role of ['tertiary', 'success', 'warning']) {
|
|
89
|
+
assert.match(
|
|
90
|
+
css,
|
|
91
|
+
new RegExp(`--color-${role}:\\s*var\\(--${role}\\)`),
|
|
92
|
+
`missing @theme inline mapping for --color-${role}`
|
|
93
|
+
);
|
|
94
|
+
assert.match(
|
|
95
|
+
css,
|
|
96
|
+
new RegExp(
|
|
97
|
+
`--color-${role}-foreground:\\s*var\\(--${role}-foreground\\)`
|
|
98
|
+
),
|
|
99
|
+
`missing @theme inline mapping for --color-${role}-foreground`
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
});
|