@cascivo/tokens 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/LICENSE +21 -0
- package/README.md +19 -0
- package/package.json +42 -0
- package/readme.body.md +1 -0
- package/src/functions.css +26 -0
- package/src/index.css +269 -0
- package/src/screens.ts +28 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 urbanisierung
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!-- generated by scripts/readme/generate.ts — edit readme.body.md, not this file -->
|
|
2
|
+
|
|
3
|
+
# @cascivo/tokens
|
|
4
|
+
|
|
5
|
+
> Three-level CSS design tokens (primitive → semantic → component)
|
|
6
|
+
|
|
7
|
+
[cascivo.com](https://cascivo.com) · [Docs](https://docs.cascivo.com) · [Storybook](https://storybook.cascivo.com) · [GitHub](https://github.com/urbanisierung/cascivo)
|
|
8
|
+
|
|
9
|
+
CSS design tokens for cascade — primitive, semantic, and component-level custom properties in a three-level system. Primitive tokens define the raw scale; semantic tokens map intent (`--cascivo-color-accent`); component tokens map usage (`--cascivo-button-bg`).
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
pnpm add @cascivo/tokens
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
[cascivo.com](https://cascivo.com) · [Docs](https://docs.cascivo.com) · [Storybook](https://storybook.cascivo.com) · [GitHub](https://github.com/urbanisierung/cascivo) · AI agents: use [`@cascivo/mcp`](https://github.com/urbanisierung/cascivo/tree/main/packages/mcp) and [`registry.json`](https://github.com/urbanisierung/cascivo/blob/main/registry.json) · MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cascivo/tokens",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Three-level CSS design tokens (primitive → semantic → component)",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"cascivo",
|
|
8
|
+
"css",
|
|
9
|
+
"css-custom-properties",
|
|
10
|
+
"css-tokens",
|
|
11
|
+
"design-system",
|
|
12
|
+
"design-tokens",
|
|
13
|
+
"react",
|
|
14
|
+
"signals"
|
|
15
|
+
],
|
|
16
|
+
"homepage": "https://github.com/urbanisierung/cascivo/tree/main/packages/tokens#readme",
|
|
17
|
+
"bugs": "https://github.com/urbanisierung/cascivo/issues",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "urbanisierung",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/urbanisierung/cascivo.git",
|
|
23
|
+
"directory": "packages/tokens"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"src/**/*.css",
|
|
27
|
+
"src/**/*.ts",
|
|
28
|
+
"!src/**/*.test.ts"
|
|
29
|
+
],
|
|
30
|
+
"exports": {
|
|
31
|
+
".": "./src/index.css",
|
|
32
|
+
"./screens": "./src/screens.ts"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public",
|
|
36
|
+
"provenance": true
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "echo 'tokens: CSS-only, no build'",
|
|
40
|
+
"test": "echo 'tokens: no tests yet'"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/readme.body.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CSS design tokens for cascade — primitive, semantic, and component-level custom properties in a three-level system. Primitive tokens define the raw scale; semantic tokens map intent (`--cascivo-color-accent`); component tokens map usage (`--cascivo-button-bg`).
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* packages/tokens/src/functions.css */
|
|
2
|
+
/*
|
|
3
|
+
* CSS @function helpers — progressive enhancement only.
|
|
4
|
+
*
|
|
5
|
+
* Browser support: Chrome 133+ (2025). Firefox and Safari: not yet.
|
|
6
|
+
* Every consumer of these functions MUST provide a static fallback for the
|
|
7
|
+
* same property immediately before the @function call. The css-fallback
|
|
8
|
+
* audit script (scripts/checks/css-fallback.ts) enforces this contract.
|
|
9
|
+
*
|
|
10
|
+
* Authoring rules:
|
|
11
|
+
* - No recursion (banned by spec).
|
|
12
|
+
* - Single `result` per function.
|
|
13
|
+
* - Use calc() to defer numeric validation.
|
|
14
|
+
* - Defaults on all optional args.
|
|
15
|
+
* - No variable-spreading (not yet supported).
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
@layer cascade.functions {
|
|
19
|
+
@function --cascivo-step(--n <number>, --base: 0.25rem) {
|
|
20
|
+
result: calc(var(--base) * var(--n));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@function --cascivo-scale(--n <number>, --ratio: 1.25, --base: 1rem) {
|
|
24
|
+
result: calc(var(--base) * var(--ratio) * var(--n));
|
|
25
|
+
}
|
|
26
|
+
}
|
package/src/index.css
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/* packages/tokens/src/index.css */
|
|
2
|
+
/* Cascade Design System — Primitive Tokens */
|
|
3
|
+
/* These are raw values. Never use directly in components. Use semantic tokens. */
|
|
4
|
+
|
|
5
|
+
@layer cascade.tokens {
|
|
6
|
+
:root {
|
|
7
|
+
/* ── Color Primitives ─────────────────────────────── */
|
|
8
|
+
|
|
9
|
+
/* Gray (near-achromatic, hue ≈ 264) */
|
|
10
|
+
--cascivo-gray-0: oklch(1 0 0);
|
|
11
|
+
--cascivo-gray-50: oklch(0.985 0.002 264);
|
|
12
|
+
--cascivo-gray-100: oklch(0.967 0.003 264);
|
|
13
|
+
--cascivo-gray-200: oklch(0.928 0.006 264);
|
|
14
|
+
--cascivo-gray-300: oklch(0.872 0.008 264);
|
|
15
|
+
--cascivo-gray-400: oklch(0.707 0.015 264);
|
|
16
|
+
--cascivo-gray-500: oklch(0.554 0.018 264);
|
|
17
|
+
--cascivo-gray-600: oklch(0.446 0.018 264);
|
|
18
|
+
--cascivo-gray-700: oklch(0.373 0.015 264);
|
|
19
|
+
--cascivo-gray-800: oklch(0.269 0.01 264);
|
|
20
|
+
--cascivo-gray-900: oklch(0.205 0.007 264);
|
|
21
|
+
--cascivo-gray-950: oklch(0.145 0.005 264);
|
|
22
|
+
|
|
23
|
+
/* Blue / accent (hue ≈ 250) */
|
|
24
|
+
--cascivo-blue-50: oklch(0.97 0.025 250);
|
|
25
|
+
--cascivo-blue-100: oklch(0.932 0.055 250);
|
|
26
|
+
--cascivo-blue-200: oklch(0.882 0.095 250);
|
|
27
|
+
--cascivo-blue-300: oklch(0.808 0.14 250);
|
|
28
|
+
--cascivo-blue-400: oklch(0.707 0.18 250);
|
|
29
|
+
--cascivo-blue-500: oklch(0.623 0.214 250);
|
|
30
|
+
--cascivo-blue-600: oklch(0.546 0.224 250);
|
|
31
|
+
--cascivo-blue-700: oklch(0.452 0.196 250);
|
|
32
|
+
--cascivo-blue-800: oklch(0.373 0.155 250);
|
|
33
|
+
--cascivo-blue-900: oklch(0.29 0.105 250);
|
|
34
|
+
--cascivo-blue-950: oklch(0.205 0.065 250);
|
|
35
|
+
|
|
36
|
+
/* Green (hue ≈ 145) */
|
|
37
|
+
--cascivo-green-50: oklch(0.982 0.018 145);
|
|
38
|
+
--cascivo-green-100: oklch(0.962 0.044 145);
|
|
39
|
+
--cascivo-green-200: oklch(0.925 0.084 145);
|
|
40
|
+
--cascivo-green-400: oklch(0.75 0.15 145);
|
|
41
|
+
--cascivo-green-500: oklch(0.648 0.15 145);
|
|
42
|
+
--cascivo-green-600: oklch(0.548 0.14 145);
|
|
43
|
+
--cascivo-green-700: oklch(0.448 0.12 145);
|
|
44
|
+
--cascivo-green-900: oklch(0.28 0.075 145);
|
|
45
|
+
|
|
46
|
+
/* Red (hue ≈ 22) */
|
|
47
|
+
--cascivo-red-50: oklch(0.971 0.013 22);
|
|
48
|
+
--cascivo-red-100: oklch(0.936 0.032 22);
|
|
49
|
+
--cascivo-red-200: oklch(0.885 0.062 22);
|
|
50
|
+
--cascivo-red-400: oklch(0.72 0.16 22);
|
|
51
|
+
--cascivo-red-500: oklch(0.628 0.188 22);
|
|
52
|
+
--cascivo-red-600: oklch(0.54 0.188 22);
|
|
53
|
+
--cascivo-red-700: oklch(0.448 0.17 22);
|
|
54
|
+
--cascivo-red-900: oklch(0.28 0.1 22);
|
|
55
|
+
|
|
56
|
+
/* Orange (hue ≈ 40) */
|
|
57
|
+
--cascivo-orange-50: oklch(0.98 0.02 75);
|
|
58
|
+
--cascivo-orange-100: oklch(0.96 0.045 75);
|
|
59
|
+
--cascivo-orange-400: oklch(0.82 0.13 60);
|
|
60
|
+
--cascivo-orange-500: oklch(0.768 0.145 55);
|
|
61
|
+
--cascivo-orange-600: oklch(0.68 0.155 50);
|
|
62
|
+
|
|
63
|
+
/* Yellow / amber (hue ≈ 75) */
|
|
64
|
+
--cascivo-yellow-50: oklch(0.987 0.026 95);
|
|
65
|
+
--cascivo-yellow-100: oklch(0.973 0.05 95);
|
|
66
|
+
--cascivo-yellow-400: oklch(0.868 0.145 80);
|
|
67
|
+
--cascivo-yellow-500: oklch(0.768 0.145 75);
|
|
68
|
+
|
|
69
|
+
/* Warm neutrals */
|
|
70
|
+
--cascivo-warm-50: oklch(0.982 0.008 80);
|
|
71
|
+
--cascivo-warm-100: oklch(0.962 0.016 80);
|
|
72
|
+
--cascivo-warm-200: oklch(0.92 0.025 78);
|
|
73
|
+
--cascivo-warm-300: oklch(0.87 0.035 75);
|
|
74
|
+
--cascivo-warm-400: oklch(0.76 0.045 70);
|
|
75
|
+
--cascivo-warm-500: oklch(0.64 0.045 65);
|
|
76
|
+
--cascivo-warm-600: oklch(0.52 0.04 60);
|
|
77
|
+
--cascivo-warm-700: oklch(0.42 0.03 55);
|
|
78
|
+
--cascivo-warm-800: oklch(0.31 0.022 50);
|
|
79
|
+
--cascivo-warm-900: oklch(0.21 0.015 50);
|
|
80
|
+
|
|
81
|
+
/* ── Spacing ──────────────────────────────────────── */
|
|
82
|
+
--cascivo-space-0: 0px;
|
|
83
|
+
--cascivo-space-1: 0.25rem; /* 4px */
|
|
84
|
+
--cascivo-space-2: 0.5rem; /* 8px */
|
|
85
|
+
--cascivo-space-3: 0.75rem; /* 12px */
|
|
86
|
+
--cascivo-space-4: 1rem; /* 16px */
|
|
87
|
+
--cascivo-space-5: 1.25rem; /* 20px */
|
|
88
|
+
--cascivo-space-6: 1.5rem; /* 24px */
|
|
89
|
+
--cascivo-space-8: 2rem; /* 32px */
|
|
90
|
+
--cascivo-space-10: 2.5rem; /* 40px */
|
|
91
|
+
--cascivo-space-12: 3rem; /* 48px */
|
|
92
|
+
--cascivo-space-16: 4rem; /* 64px */
|
|
93
|
+
--cascivo-space-20: 5rem; /* 80px */
|
|
94
|
+
--cascivo-space-24: 6rem; /* 96px */
|
|
95
|
+
|
|
96
|
+
/* ── Typography ───────────────────────────────────── */
|
|
97
|
+
--cascivo-font-sans:
|
|
98
|
+
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
99
|
+
--cascivo-font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
|
|
100
|
+
|
|
101
|
+
--cascivo-text-xs: 0.75rem; /* 12px */
|
|
102
|
+
--cascivo-text-sm: 0.875rem; /* 14px */
|
|
103
|
+
--cascivo-text-base: 1rem; /* 16px */
|
|
104
|
+
--cascivo-text-lg: 1.125rem; /* 18px */
|
|
105
|
+
--cascivo-text-xl: 1.25rem; /* 20px */
|
|
106
|
+
--cascivo-text-2xl: 1.5rem; /* 24px */
|
|
107
|
+
--cascivo-text-3xl: 1.875rem; /* 30px */
|
|
108
|
+
|
|
109
|
+
--cascivo-font-normal: 400;
|
|
110
|
+
--cascivo-font-medium: 500;
|
|
111
|
+
--cascivo-font-semibold: 600;
|
|
112
|
+
--cascivo-font-bold: 700;
|
|
113
|
+
|
|
114
|
+
--cascivo-leading-none: 1;
|
|
115
|
+
--cascivo-leading-tight: 1.25;
|
|
116
|
+
--cascivo-leading-snug: 1.375;
|
|
117
|
+
--cascivo-leading-normal: 1.5;
|
|
118
|
+
--cascivo-leading-relaxed: 1.625;
|
|
119
|
+
|
|
120
|
+
--cascivo-tracking-tight: -0.025em;
|
|
121
|
+
--cascivo-tracking-normal: 0em;
|
|
122
|
+
--cascivo-tracking-wide: 0.025em;
|
|
123
|
+
|
|
124
|
+
/* ── Border Radius — Primitive ───────────────────── */
|
|
125
|
+
--cascivo-radius-none: 0px;
|
|
126
|
+
--cascivo-radius-sm: 0.25rem; /* 4px */
|
|
127
|
+
--cascivo-radius-md: 0.375rem; /* 6px */
|
|
128
|
+
--cascivo-radius-lg: 0.5rem; /* 8px */
|
|
129
|
+
--cascivo-radius-xl: 0.75rem; /* 12px */
|
|
130
|
+
--cascivo-radius-2xl: 1rem; /* 16px */
|
|
131
|
+
--cascivo-radius-full: 9999px;
|
|
132
|
+
|
|
133
|
+
/* ── Border Radius — Semantic (one-knob; themes retune --cascivo-radius-base only) ── */
|
|
134
|
+
--cascivo-radius-base: 0.375rem; /* 6px controls */
|
|
135
|
+
--cascivo-radius-control: var(--cascivo-radius-base);
|
|
136
|
+
--cascivo-radius-field: var(--cascivo-radius-base);
|
|
137
|
+
--cascivo-radius-item: calc(var(--cascivo-radius-base) * 0.66); /* ~4px menu/list rows */
|
|
138
|
+
--cascivo-radius-surface: calc(var(--cascivo-radius-base) * 1.66); /* ~10px cards */
|
|
139
|
+
--cascivo-radius-overlay: calc(var(--cascivo-radius-base) * 2); /* ~12px modals/popovers */
|
|
140
|
+
--cascivo-radius-indicator: calc(var(--cascivo-radius-base) / 2);
|
|
141
|
+
|
|
142
|
+
/* ── Shadows — rationed: surfaces flat/xs, floating layers get ONE soft shadow ── */
|
|
143
|
+
--cascivo-shadow-xs: 0 1px 2px oklch(0 0 0 / 0.05);
|
|
144
|
+
--cascivo-shadow-sm: 0 1px 3px oklch(0 0 0 / 0.07), 0 1px 2px oklch(0 0 0 / 0.04);
|
|
145
|
+
--cascivo-shadow-md: 0 2px 8px oklch(0 0 0 / 0.07), 0 1px 2px oklch(0 0 0 / 0.04);
|
|
146
|
+
--cascivo-shadow-overlay: 0 4px 32px oklch(0 0 0 / 0.16), 0 0 0 1px oklch(0 0 0 / 0.04);
|
|
147
|
+
/* legacy aliases — keep existing component CSS working */
|
|
148
|
+
--cascivo-shadow-lg: var(--cascivo-shadow-overlay);
|
|
149
|
+
--cascivo-shadow-xl: var(--cascivo-shadow-overlay);
|
|
150
|
+
|
|
151
|
+
/* ── Focus Ring — soft halo (≥3:1 contrast) ──────── */
|
|
152
|
+
--cascivo-ring-width: 3px;
|
|
153
|
+
--cascivo-ring-offset: 0px;
|
|
154
|
+
--cascivo-ring-color: color-mix(
|
|
155
|
+
in oklch,
|
|
156
|
+
var(--cascivo-color-accent, oklch(0.623 0.214 250)) 55%,
|
|
157
|
+
transparent
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
/* ── Primary — semantic defaults (themes override) ── */
|
|
161
|
+
--cascivo-color-primary: oklch(0.205 0 0);
|
|
162
|
+
--cascivo-color-primary-fg: oklch(0.985 0 0);
|
|
163
|
+
--cascivo-color-primary-hover: oklch(0.27 0 0);
|
|
164
|
+
--cascivo-color-primary-active: oklch(0.32 0 0);
|
|
165
|
+
--cascivo-color-active-bg: oklch(0.145 0.005 264 / 6%);
|
|
166
|
+
|
|
167
|
+
/* ── Density Controls ────────────────────────────── */
|
|
168
|
+
/* Button is the height reference — all interactive controls derive from these. */
|
|
169
|
+
/* Coarse pointer: use --cascivo-target-min-coarse (2.75rem/44px) via min-block-size. */
|
|
170
|
+
--cascivo-control-height-sm: 2rem; /* 32px — Button sm */
|
|
171
|
+
--cascivo-control-height-md: 2.5rem; /* 40px — Button md */
|
|
172
|
+
--cascivo-control-height-lg: 3rem; /* 48px — Button lg */
|
|
173
|
+
|
|
174
|
+
/* ── Semantic Borders ────────────────────────────── */
|
|
175
|
+
--cascivo-border-subtle: oklch(0.928 0.006 264);
|
|
176
|
+
--cascivo-border-default: oklch(0.872 0.008 264);
|
|
177
|
+
--cascivo-border-strong: oklch(0.707 0.015 264);
|
|
178
|
+
|
|
179
|
+
/* ── Animation ────────────────────────────────────── */
|
|
180
|
+
--cascivo-ease-in: cubic-bezier(0.4, 0, 1, 1);
|
|
181
|
+
--cascivo-ease-out: cubic-bezier(0, 0, 0.2, 1);
|
|
182
|
+
--cascivo-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
183
|
+
--cascivo-duration-75: 75ms;
|
|
184
|
+
--cascivo-duration-100: 100ms;
|
|
185
|
+
--cascivo-duration-150: 150ms;
|
|
186
|
+
--cascivo-duration-200: 200ms;
|
|
187
|
+
--cascivo-duration-300: 300ms;
|
|
188
|
+
--cascivo-duration-500: 500ms;
|
|
189
|
+
|
|
190
|
+
/* Semantic motion — components reference intent, themes tune character */
|
|
191
|
+
--cascivo-motion-enter: var(--cascivo-duration-200) var(--cascivo-ease-out);
|
|
192
|
+
--cascivo-motion-exit: var(--cascivo-duration-150) var(--cascivo-ease-in);
|
|
193
|
+
--cascivo-motion-emphasis: var(--cascivo-duration-300) var(--cascivo-ease-in-out);
|
|
194
|
+
|
|
195
|
+
/* ── Chart Categorical Color Ramp ───────────────── */
|
|
196
|
+
--cascivo-chart-1: oklch(0.74 0.13 70); /* Okabe-Ito orange #E69F00 */
|
|
197
|
+
--cascivo-chart-2: oklch(0.74 0.11 240); /* Okabe-Ito sky blue #56B4E9 */
|
|
198
|
+
--cascivo-chart-3: oklch(0.66 0.13 165); /* Okabe-Ito bluish green #009E73 */
|
|
199
|
+
--cascivo-chart-4: oklch(0.93 0.16 100); /* Okabe-Ito yellow #F0E442 */
|
|
200
|
+
--cascivo-chart-5: oklch(0.5 0.13 250); /* Okabe-Ito blue #0072B2 */
|
|
201
|
+
--cascivo-chart-6: oklch(0.6 0.16 40); /* Okabe-Ito vermillion #D55E00 */
|
|
202
|
+
--cascivo-chart-7: oklch(0.66 0.12 350); /* Okabe-Ito reddish purple #CC79A7 */
|
|
203
|
+
--cascivo-chart-8: oklch(0.55 0.02 280); /* neutral grey (screen adaptation) */
|
|
204
|
+
--cascivo-chart-grid: var(--cascivo-gray-200);
|
|
205
|
+
--cascivo-chart-axis: var(--cascivo-gray-400);
|
|
206
|
+
|
|
207
|
+
/* ── Brand (apps/logo/OG only — never used in component CSS) ── */
|
|
208
|
+
--cascivo-brand-primary: oklch(
|
|
209
|
+
0.55 0.15 240
|
|
210
|
+
); /* cascade blue — hero, CTA, logo gradient start */
|
|
211
|
+
--cascivo-brand-accent: oklch(0.72 0.13 195); /* flow teal — gradient end, accents */
|
|
212
|
+
--cascivo-brand-ink: oklch(
|
|
213
|
+
0.22 0.03 250
|
|
214
|
+
); /* near-black cool — wordmark, body on brand surface */
|
|
215
|
+
--cascivo-brand-paper: oklch(0.99 0.005 250); /* off-white brand surface */
|
|
216
|
+
--cascivo-brand-gradient-start: oklch(0.55 0.15 240);
|
|
217
|
+
--cascivo-brand-gradient-end: oklch(0.72 0.13 195);
|
|
218
|
+
|
|
219
|
+
/* ── Z-Index ──────────────────────────────────────── */
|
|
220
|
+
--cascivo-z-base: 0;
|
|
221
|
+
--cascivo-z-raised: 10;
|
|
222
|
+
--cascivo-z-dropdown: 100;
|
|
223
|
+
--cascivo-z-overlay: 200;
|
|
224
|
+
--cascivo-z-modal: 300;
|
|
225
|
+
--cascivo-z-toast: 400;
|
|
226
|
+
--cascivo-z-tooltip: 500;
|
|
227
|
+
|
|
228
|
+
/* ── Shell ──────────────────────────────────────────── */
|
|
229
|
+
--cascivo-shell-header-block-size: 3rem;
|
|
230
|
+
--cascivo-shell-panel-inline-size: 20rem;
|
|
231
|
+
--cascivo-shell-aside-inline-size: 18rem;
|
|
232
|
+
|
|
233
|
+
/* ── Breakpoint Scale ────────────────────────────── */
|
|
234
|
+
/* Breakpoints are a lint-guarded constant. Use these exact values in @media/@container; */
|
|
235
|
+
/* do NOT invent off-scale widths. @media/@container CANNOT read these custom properties — */
|
|
236
|
+
/* copy the numeric value. Canonical scale: sm=30rem md=40rem lg=64rem xl=80rem */
|
|
237
|
+
/* Lint: scripts/checks/breakpoint.test.ts — added in v20-t2. */
|
|
238
|
+
--cascivo-screen-sm: 30rem; /* 480px — small phone/narrow viewport */
|
|
239
|
+
--cascivo-screen-md: 40rem; /* 640px — tablet/wide phone (load-bearing: columns/grid/header) */
|
|
240
|
+
--cascivo-screen-lg: 64rem; /* 1024px — desktop (load-bearing: app-shell drawer) */
|
|
241
|
+
--cascivo-screen-xl: 80rem; /* 1280px — wide desktop */
|
|
242
|
+
|
|
243
|
+
/* ── Fluid Typography ────────────────────────────── */
|
|
244
|
+
/* Additive fluid variants — fixed tokens are preserved as the static fallback. */
|
|
245
|
+
/* clamp(min, vw-slope, max) where max = current fixed value so desktop ceiling is frozen. */
|
|
246
|
+
--cascivo-text-2xl-fluid: clamp(1.25rem, 1rem + 1.25vw, 1.5rem); /* 20→24px */
|
|
247
|
+
--cascivo-text-3xl-fluid: clamp(1.5rem, 1.125rem + 1.875vw, 1.875rem); /* 24→30px */
|
|
248
|
+
|
|
249
|
+
/* ── Coarse-pointer touch target ─────────────────── */
|
|
250
|
+
/* Controls should reach this minimum under @media (pointer: coarse) — added in v20-t3. */
|
|
251
|
+
--cascivo-target-min-coarse: 2.75rem; /* 44px — Apple HIG comfortable touch target */
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* All cascade motion derives from the duration tokens, so collapsing them
|
|
255
|
+
disables every transition/animation library-wide. Continuous progress
|
|
256
|
+
indicators (Spinner) use literal durations and opt out deliberately. */
|
|
257
|
+
@media (prefers-reduced-motion: reduce) {
|
|
258
|
+
:root {
|
|
259
|
+
--cascivo-duration-75: 0.01ms;
|
|
260
|
+
--cascivo-duration-100: 0.01ms;
|
|
261
|
+
--cascivo-duration-150: 0.01ms;
|
|
262
|
+
--cascivo-duration-200: 0.01ms;
|
|
263
|
+
--cascivo-duration-300: 0.01ms;
|
|
264
|
+
--cascivo-duration-500: 0.01ms;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
@import './functions.css';
|
package/src/screens.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical breakpoint scale for cascivo.
|
|
3
|
+
*
|
|
4
|
+
* These match the --cascivo-screen-* CSS custom properties in index.css.
|
|
5
|
+
* Use SCREEN.*.px for matchMedia and Playwright numeric widths.
|
|
6
|
+
* Use minWidth() / maxWidth() to build matchMedia strings.
|
|
7
|
+
*
|
|
8
|
+
* CSS @media/@container CANNOT read var() — copy the rem value directly.
|
|
9
|
+
* The breakpoint:check lint (scripts/checks/breakpoint.test.ts) guards drift.
|
|
10
|
+
*/
|
|
11
|
+
export const SCREEN = {
|
|
12
|
+
sm: { rem: '30rem', px: 480 },
|
|
13
|
+
md: { rem: '40rem', px: 640 },
|
|
14
|
+
lg: { rem: '64rem', px: 1024 },
|
|
15
|
+
xl: { rem: '80rem', px: 1280 },
|
|
16
|
+
} as const
|
|
17
|
+
|
|
18
|
+
export type ScreenKey = keyof typeof SCREEN
|
|
19
|
+
|
|
20
|
+
/** Returns a min-width matchMedia string, e.g. '(min-width: 64rem)' */
|
|
21
|
+
export function minWidth(bp: ScreenKey): string {
|
|
22
|
+
return `(min-width: ${SCREEN[bp].rem})`
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Returns a max-width matchMedia string, e.g. '(max-width: 64rem)' */
|
|
26
|
+
export function maxWidth(bp: ScreenKey): string {
|
|
27
|
+
return `(max-width: ${SCREEN[bp].rem})`
|
|
28
|
+
}
|