@loidolt/theme-tokens 0.2.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/dist/dark-auto.css +74 -0
- package/dist/dark.css +36 -0
- package/dist/index.d.ts +374 -0
- package/dist/index.js +261 -0
- package/dist/tokens.css +105 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Chris Loidolt
|
|
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 all
|
|
13
|
+
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.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* Generated from src/index.ts. Do not edit directly. */
|
|
2
|
+
[data-theme='dark'] {
|
|
3
|
+
color-scheme: dark;
|
|
4
|
+
--loidolt-background: #161814;
|
|
5
|
+
--loidolt-surface: #1e211c;
|
|
6
|
+
--loidolt-surface-alt: #24271f;
|
|
7
|
+
--loidolt-surface-sunken: #101210;
|
|
8
|
+
--loidolt-surface-inverse: #ebe7dc;
|
|
9
|
+
--loidolt-surface-input: #24271f;
|
|
10
|
+
--loidolt-text: #ebe7dc;
|
|
11
|
+
--loidolt-text-muted: #a8a394;
|
|
12
|
+
--loidolt-text-inverse: #161814;
|
|
13
|
+
--loidolt-text-accent: #f0895c;
|
|
14
|
+
--loidolt-border: #3a3d34;
|
|
15
|
+
--loidolt-border-soft: #2b2e26;
|
|
16
|
+
--loidolt-border-strong: #6a6e5f;
|
|
17
|
+
--loidolt-border-control: #787c6b;
|
|
18
|
+
--loidolt-accent: #e0672f;
|
|
19
|
+
--loidolt-accent-hover: #f0895c;
|
|
20
|
+
--loidolt-on-accent: #161814;
|
|
21
|
+
--loidolt-danger: #d75f55;
|
|
22
|
+
--loidolt-on-danger: #161814;
|
|
23
|
+
--loidolt-text-danger: #e88b81;
|
|
24
|
+
--loidolt-success: #7fa074;
|
|
25
|
+
--loidolt-on-success: #161814;
|
|
26
|
+
--loidolt-text-success: #93b287;
|
|
27
|
+
--loidolt-warning: #cc9a4e;
|
|
28
|
+
--loidolt-on-warning: #161814;
|
|
29
|
+
--loidolt-text-warning: #d9ab63;
|
|
30
|
+
--loidolt-info: #6ea5bd;
|
|
31
|
+
--loidolt-on-info: #161814;
|
|
32
|
+
--loidolt-text-info: #85b6ca;
|
|
33
|
+
--loidolt-focus-ring: #f0895c;
|
|
34
|
+
--loidolt-shadow-color: #000000;
|
|
35
|
+
--loidolt-scrim: color-mix(in srgb, var(--loidolt-shadow-color) 78%, transparent);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (prefers-color-scheme: dark) {
|
|
39
|
+
:root:not([data-theme='light']) {
|
|
40
|
+
color-scheme: dark;
|
|
41
|
+
--loidolt-background: #161814;
|
|
42
|
+
--loidolt-surface: #1e211c;
|
|
43
|
+
--loidolt-surface-alt: #24271f;
|
|
44
|
+
--loidolt-surface-sunken: #101210;
|
|
45
|
+
--loidolt-surface-inverse: #ebe7dc;
|
|
46
|
+
--loidolt-surface-input: #24271f;
|
|
47
|
+
--loidolt-text: #ebe7dc;
|
|
48
|
+
--loidolt-text-muted: #a8a394;
|
|
49
|
+
--loidolt-text-inverse: #161814;
|
|
50
|
+
--loidolt-text-accent: #f0895c;
|
|
51
|
+
--loidolt-border: #3a3d34;
|
|
52
|
+
--loidolt-border-soft: #2b2e26;
|
|
53
|
+
--loidolt-border-strong: #6a6e5f;
|
|
54
|
+
--loidolt-border-control: #787c6b;
|
|
55
|
+
--loidolt-accent: #e0672f;
|
|
56
|
+
--loidolt-accent-hover: #f0895c;
|
|
57
|
+
--loidolt-on-accent: #161814;
|
|
58
|
+
--loidolt-danger: #d75f55;
|
|
59
|
+
--loidolt-on-danger: #161814;
|
|
60
|
+
--loidolt-text-danger: #e88b81;
|
|
61
|
+
--loidolt-success: #7fa074;
|
|
62
|
+
--loidolt-on-success: #161814;
|
|
63
|
+
--loidolt-text-success: #93b287;
|
|
64
|
+
--loidolt-warning: #cc9a4e;
|
|
65
|
+
--loidolt-on-warning: #161814;
|
|
66
|
+
--loidolt-text-warning: #d9ab63;
|
|
67
|
+
--loidolt-info: #6ea5bd;
|
|
68
|
+
--loidolt-on-info: #161814;
|
|
69
|
+
--loidolt-text-info: #85b6ca;
|
|
70
|
+
--loidolt-focus-ring: #f0895c;
|
|
71
|
+
--loidolt-shadow-color: #000000;
|
|
72
|
+
--loidolt-scrim: color-mix(in srgb, var(--loidolt-shadow-color) 78%, transparent);
|
|
73
|
+
}
|
|
74
|
+
}
|
package/dist/dark.css
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* Generated from src/index.ts. Do not edit directly. */
|
|
2
|
+
[data-theme='dark'] {
|
|
3
|
+
color-scheme: dark;
|
|
4
|
+
--loidolt-background: #161814;
|
|
5
|
+
--loidolt-surface: #1e211c;
|
|
6
|
+
--loidolt-surface-alt: #24271f;
|
|
7
|
+
--loidolt-surface-sunken: #101210;
|
|
8
|
+
--loidolt-surface-inverse: #ebe7dc;
|
|
9
|
+
--loidolt-surface-input: #24271f;
|
|
10
|
+
--loidolt-text: #ebe7dc;
|
|
11
|
+
--loidolt-text-muted: #a8a394;
|
|
12
|
+
--loidolt-text-inverse: #161814;
|
|
13
|
+
--loidolt-text-accent: #f0895c;
|
|
14
|
+
--loidolt-border: #3a3d34;
|
|
15
|
+
--loidolt-border-soft: #2b2e26;
|
|
16
|
+
--loidolt-border-strong: #6a6e5f;
|
|
17
|
+
--loidolt-border-control: #787c6b;
|
|
18
|
+
--loidolt-accent: #e0672f;
|
|
19
|
+
--loidolt-accent-hover: #f0895c;
|
|
20
|
+
--loidolt-on-accent: #161814;
|
|
21
|
+
--loidolt-danger: #d75f55;
|
|
22
|
+
--loidolt-on-danger: #161814;
|
|
23
|
+
--loidolt-text-danger: #e88b81;
|
|
24
|
+
--loidolt-success: #7fa074;
|
|
25
|
+
--loidolt-on-success: #161814;
|
|
26
|
+
--loidolt-text-success: #93b287;
|
|
27
|
+
--loidolt-warning: #cc9a4e;
|
|
28
|
+
--loidolt-on-warning: #161814;
|
|
29
|
+
--loidolt-text-warning: #d9ab63;
|
|
30
|
+
--loidolt-info: #6ea5bd;
|
|
31
|
+
--loidolt-on-info: #161814;
|
|
32
|
+
--loidolt-text-info: #85b6ca;
|
|
33
|
+
--loidolt-focus-ring: #f0895c;
|
|
34
|
+
--loidolt-shadow-color: #000000;
|
|
35
|
+
--loidolt-scrim: color-mix(in srgb, var(--loidolt-shadow-color) 78%, transparent);
|
|
36
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design tokens for Loidolt applications.
|
|
3
|
+
*
|
|
4
|
+
* Two tiers:
|
|
5
|
+
* - **Primitives** (`--loidolt-color-*`, `--loidolt-space-*`, …) are the raw palette and scales.
|
|
6
|
+
* - **Semantic** (`--loidolt-surface`, `--loidolt-text`, …) name a *role*. Stylesheets and
|
|
7
|
+
* components consume only these, so a consumer can restyle the system — or add a dark
|
|
8
|
+
* mode — by redefining the semantic tier alone.
|
|
9
|
+
*/
|
|
10
|
+
/** A token whose value points at another token, emitted as `var(--loidolt-…)`. */
|
|
11
|
+
type TokenRef = {
|
|
12
|
+
readonly $ref: string;
|
|
13
|
+
};
|
|
14
|
+
/** `['font', 'lineHeight', 'tight']` → `--loidolt-font-line-height-tight`. */
|
|
15
|
+
declare const cssVarName: (path: readonly string[]) => string;
|
|
16
|
+
declare const colors: {
|
|
17
|
+
readonly paper: "#ebe7dc";
|
|
18
|
+
readonly panel: "#f5f2e9";
|
|
19
|
+
readonly panelAlt: "#efebe1";
|
|
20
|
+
readonly canvas: "#d8d3c7";
|
|
21
|
+
readonly canvasLine: "#c9c3b6";
|
|
22
|
+
readonly deep: "#20231d";
|
|
23
|
+
readonly muted: "#5f5b50";
|
|
24
|
+
readonly line: "#c8c1b1";
|
|
25
|
+
readonly lineSoft: "#ddd7c9";
|
|
26
|
+
readonly lineStrong: "#847d6a";
|
|
27
|
+
readonly white: "#ffffff";
|
|
28
|
+
readonly orange: "#c65224";
|
|
29
|
+
readonly orangeDark: "#a9441d";
|
|
30
|
+
readonly error: "#9b2822";
|
|
31
|
+
readonly success: "#3f5139";
|
|
32
|
+
readonly warning: "#7c4d17";
|
|
33
|
+
readonly info: "#265162";
|
|
34
|
+
};
|
|
35
|
+
declare const typography: {
|
|
36
|
+
readonly display: "\"Jost\", \"Avenir Next\", sans-serif";
|
|
37
|
+
readonly utility: "\"Archivo\", \"Helvetica Neue\", sans-serif";
|
|
38
|
+
readonly mono: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace";
|
|
39
|
+
readonly size: {
|
|
40
|
+
readonly xs: "0.6875rem";
|
|
41
|
+
readonly sm: "0.75rem";
|
|
42
|
+
readonly base: "0.875rem";
|
|
43
|
+
readonly md: "1rem";
|
|
44
|
+
readonly lg: "1.25rem";
|
|
45
|
+
readonly xl: "1.75rem";
|
|
46
|
+
readonly display: "2.5rem";
|
|
47
|
+
};
|
|
48
|
+
readonly tracking: {
|
|
49
|
+
readonly utility: "0.1em";
|
|
50
|
+
readonly wide: "0.13em";
|
|
51
|
+
};
|
|
52
|
+
readonly lineHeight: {
|
|
53
|
+
readonly tight: "1.15";
|
|
54
|
+
readonly normal: "1.45";
|
|
55
|
+
readonly relaxed: "1.65";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
declare const spacing: {
|
|
59
|
+
readonly 0: "0";
|
|
60
|
+
readonly 1: "0.25rem";
|
|
61
|
+
readonly 2: "0.5rem";
|
|
62
|
+
readonly 3: "0.75rem";
|
|
63
|
+
readonly 4: "1rem";
|
|
64
|
+
readonly 5: "1.25rem";
|
|
65
|
+
readonly 6: "1.5rem";
|
|
66
|
+
readonly 8: "2rem";
|
|
67
|
+
readonly 10: "2.5rem";
|
|
68
|
+
readonly 12: "3rem";
|
|
69
|
+
readonly 16: "4rem";
|
|
70
|
+
};
|
|
71
|
+
declare const sizing: {
|
|
72
|
+
readonly controlSm: "2rem";
|
|
73
|
+
readonly control: "2.375rem";
|
|
74
|
+
readonly controlLg: "2.75rem";
|
|
75
|
+
readonly topbar: "3.875rem";
|
|
76
|
+
readonly contextbar: "2.5625rem";
|
|
77
|
+
readonly sidebar: "17rem";
|
|
78
|
+
readonly inspector: "18rem";
|
|
79
|
+
readonly content: "75rem";
|
|
80
|
+
};
|
|
81
|
+
declare const borders: {
|
|
82
|
+
readonly width: "1px";
|
|
83
|
+
readonly color: "#c8c1b1";
|
|
84
|
+
readonly radius: "0px";
|
|
85
|
+
};
|
|
86
|
+
declare const shadows: {
|
|
87
|
+
readonly popover: "0 12px 30px color-mix(in srgb, var(--loidolt-shadow-color) 18%, transparent)";
|
|
88
|
+
readonly modal: "0 24px 60px color-mix(in srgb, var(--loidolt-shadow-color) 24%, transparent)";
|
|
89
|
+
readonly artwork: "0 18px 23px color-mix(in srgb, var(--loidolt-shadow-color) 14%, transparent)";
|
|
90
|
+
};
|
|
91
|
+
declare const motion: {
|
|
92
|
+
readonly fast: "100ms";
|
|
93
|
+
readonly normal: "150ms";
|
|
94
|
+
readonly slow: "220ms";
|
|
95
|
+
readonly easing: "cubic-bezier(0.2, 0, 0, 1)";
|
|
96
|
+
};
|
|
97
|
+
declare const zIndex: {
|
|
98
|
+
readonly base: "0";
|
|
99
|
+
readonly raised: "10";
|
|
100
|
+
readonly sticky: "40";
|
|
101
|
+
readonly overlay: "60";
|
|
102
|
+
readonly dialog: "61";
|
|
103
|
+
readonly menu: "70";
|
|
104
|
+
readonly toast: "80";
|
|
105
|
+
readonly tooltip: "90";
|
|
106
|
+
readonly skipLink: "1000";
|
|
107
|
+
};
|
|
108
|
+
/** Breakpoints are not custom properties (`@media` cannot read `var()`), but stay tokenized here. */
|
|
109
|
+
declare const breakpoints: {
|
|
110
|
+
readonly compact: "760px";
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* The role layer. Every value links to a primitive, so overriding a primitive propagates and
|
|
114
|
+
* overriding a role restyles every component that plays it.
|
|
115
|
+
*/
|
|
116
|
+
declare const semanticDefs: {
|
|
117
|
+
readonly background: TokenRef;
|
|
118
|
+
readonly surface: TokenRef;
|
|
119
|
+
readonly surfaceAlt: TokenRef;
|
|
120
|
+
readonly surfaceSunken: TokenRef;
|
|
121
|
+
readonly surfaceInverse: TokenRef;
|
|
122
|
+
readonly surfaceInput: TokenRef;
|
|
123
|
+
readonly text: TokenRef;
|
|
124
|
+
readonly textMuted: TokenRef;
|
|
125
|
+
readonly textInverse: TokenRef;
|
|
126
|
+
readonly textAccent: TokenRef;
|
|
127
|
+
readonly border: TokenRef;
|
|
128
|
+
readonly borderSoft: TokenRef;
|
|
129
|
+
readonly borderStrong: TokenRef;
|
|
130
|
+
/** Boundary of an input, select, textarea or switch — held to 3:1 against its surface. */
|
|
131
|
+
readonly borderControl: TokenRef;
|
|
132
|
+
readonly accent: TokenRef;
|
|
133
|
+
readonly accentHover: TokenRef;
|
|
134
|
+
readonly onAccent: TokenRef;
|
|
135
|
+
readonly danger: TokenRef;
|
|
136
|
+
readonly onDanger: TokenRef;
|
|
137
|
+
readonly textDanger: TokenRef;
|
|
138
|
+
readonly success: TokenRef;
|
|
139
|
+
readonly onSuccess: TokenRef;
|
|
140
|
+
readonly textSuccess: TokenRef;
|
|
141
|
+
readonly warning: TokenRef;
|
|
142
|
+
readonly onWarning: TokenRef;
|
|
143
|
+
readonly textWarning: TokenRef;
|
|
144
|
+
readonly info: TokenRef;
|
|
145
|
+
readonly onInfo: TokenRef;
|
|
146
|
+
readonly textInfo: TokenRef;
|
|
147
|
+
readonly focusRing: TokenRef;
|
|
148
|
+
readonly shadowColor: TokenRef;
|
|
149
|
+
readonly scrim: "color-mix(in srgb, var(--loidolt-shadow-color) 72%, transparent)";
|
|
150
|
+
};
|
|
151
|
+
/** Every custom property the package emits, in declaration order. */
|
|
152
|
+
declare function flattenTokens(): Array<[string, string | TokenRef]>;
|
|
153
|
+
/** Serializes the token set to CSS. The build writes this to `dist/tokens.css`. */
|
|
154
|
+
declare function generateCss(): string;
|
|
155
|
+
/** Semantic roles with their refs resolved to concrete values, for TS/JS consumers. */
|
|
156
|
+
declare const semantic: { readonly [K in keyof typeof semanticDefs]: string; };
|
|
157
|
+
/**
|
|
158
|
+
* Reference dark theme. Only the semantic tier is redefined — the primitives stay put — which
|
|
159
|
+
* is the same move a consumer makes for their own theme. Values are literal rather than linked
|
|
160
|
+
* because a dark surface set is not a re-mapping of the light palette.
|
|
161
|
+
*
|
|
162
|
+
* Every text pair here is asserted at WCAG AA in the token test suite, including the `on-*`
|
|
163
|
+
* inks: lightened status colours need *dark* ink, and pairing them with white is the single
|
|
164
|
+
* easiest mistake to make when hand-rolling a dark theme.
|
|
165
|
+
*/
|
|
166
|
+
declare const darkSemantic: {
|
|
167
|
+
readonly background: "#161814";
|
|
168
|
+
readonly surface: "#1e211c";
|
|
169
|
+
readonly surfaceAlt: "#24271f";
|
|
170
|
+
readonly surfaceSunken: "#101210";
|
|
171
|
+
readonly surfaceInverse: "#ebe7dc";
|
|
172
|
+
readonly surfaceInput: "#24271f";
|
|
173
|
+
readonly text: "#ebe7dc";
|
|
174
|
+
readonly textMuted: "#a8a394";
|
|
175
|
+
readonly textInverse: "#161814";
|
|
176
|
+
readonly textAccent: "#f0895c";
|
|
177
|
+
readonly border: "#3a3d34";
|
|
178
|
+
readonly borderSoft: "#2b2e26";
|
|
179
|
+
readonly borderStrong: "#6a6e5f";
|
|
180
|
+
readonly borderControl: "#787c6b";
|
|
181
|
+
readonly accent: "#e0672f";
|
|
182
|
+
readonly accentHover: "#f0895c";
|
|
183
|
+
readonly onAccent: "#161814";
|
|
184
|
+
readonly danger: "#d75f55";
|
|
185
|
+
readonly onDanger: "#161814";
|
|
186
|
+
readonly textDanger: "#e88b81";
|
|
187
|
+
readonly success: "#7fa074";
|
|
188
|
+
readonly onSuccess: "#161814";
|
|
189
|
+
readonly textSuccess: "#93b287";
|
|
190
|
+
readonly warning: "#cc9a4e";
|
|
191
|
+
readonly onWarning: "#161814";
|
|
192
|
+
readonly textWarning: "#d9ab63";
|
|
193
|
+
readonly info: "#6ea5bd";
|
|
194
|
+
readonly onInfo: "#161814";
|
|
195
|
+
readonly textInfo: "#85b6ca";
|
|
196
|
+
readonly focusRing: "#f0895c";
|
|
197
|
+
readonly shadowColor: "#000000";
|
|
198
|
+
readonly scrim: "color-mix(in srgb, var(--loidolt-shadow-color) 78%, transparent)";
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Dark theme CSS. `scope` picks how it activates:
|
|
202
|
+
* - `attribute` (default): `[data-theme='dark']` only — the app drives it.
|
|
203
|
+
* - `auto`: the same block, plus a `prefers-color-scheme` rule that an explicit
|
|
204
|
+
* `data-theme="light"` can still override.
|
|
205
|
+
*/
|
|
206
|
+
declare function generateDarkCss(scope?: 'attribute' | 'auto'): string;
|
|
207
|
+
declare const tokens: {
|
|
208
|
+
readonly colors: {
|
|
209
|
+
readonly paper: "#ebe7dc";
|
|
210
|
+
readonly panel: "#f5f2e9";
|
|
211
|
+
readonly panelAlt: "#efebe1";
|
|
212
|
+
readonly canvas: "#d8d3c7";
|
|
213
|
+
readonly canvasLine: "#c9c3b6";
|
|
214
|
+
readonly deep: "#20231d";
|
|
215
|
+
readonly muted: "#5f5b50";
|
|
216
|
+
readonly line: "#c8c1b1";
|
|
217
|
+
readonly lineSoft: "#ddd7c9";
|
|
218
|
+
readonly lineStrong: "#847d6a";
|
|
219
|
+
readonly white: "#ffffff";
|
|
220
|
+
readonly orange: "#c65224";
|
|
221
|
+
readonly orangeDark: "#a9441d";
|
|
222
|
+
readonly error: "#9b2822";
|
|
223
|
+
readonly success: "#3f5139";
|
|
224
|
+
readonly warning: "#7c4d17";
|
|
225
|
+
readonly info: "#265162";
|
|
226
|
+
};
|
|
227
|
+
readonly typography: {
|
|
228
|
+
readonly display: "\"Jost\", \"Avenir Next\", sans-serif";
|
|
229
|
+
readonly utility: "\"Archivo\", \"Helvetica Neue\", sans-serif";
|
|
230
|
+
readonly mono: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace";
|
|
231
|
+
readonly size: {
|
|
232
|
+
readonly xs: "0.6875rem";
|
|
233
|
+
readonly sm: "0.75rem";
|
|
234
|
+
readonly base: "0.875rem";
|
|
235
|
+
readonly md: "1rem";
|
|
236
|
+
readonly lg: "1.25rem";
|
|
237
|
+
readonly xl: "1.75rem";
|
|
238
|
+
readonly display: "2.5rem";
|
|
239
|
+
};
|
|
240
|
+
readonly tracking: {
|
|
241
|
+
readonly utility: "0.1em";
|
|
242
|
+
readonly wide: "0.13em";
|
|
243
|
+
};
|
|
244
|
+
readonly lineHeight: {
|
|
245
|
+
readonly tight: "1.15";
|
|
246
|
+
readonly normal: "1.45";
|
|
247
|
+
readonly relaxed: "1.65";
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
readonly spacing: {
|
|
251
|
+
readonly 0: "0";
|
|
252
|
+
readonly 1: "0.25rem";
|
|
253
|
+
readonly 2: "0.5rem";
|
|
254
|
+
readonly 3: "0.75rem";
|
|
255
|
+
readonly 4: "1rem";
|
|
256
|
+
readonly 5: "1.25rem";
|
|
257
|
+
readonly 6: "1.5rem";
|
|
258
|
+
readonly 8: "2rem";
|
|
259
|
+
readonly 10: "2.5rem";
|
|
260
|
+
readonly 12: "3rem";
|
|
261
|
+
readonly 16: "4rem";
|
|
262
|
+
};
|
|
263
|
+
readonly sizing: {
|
|
264
|
+
readonly controlSm: "2rem";
|
|
265
|
+
readonly control: "2.375rem";
|
|
266
|
+
readonly controlLg: "2.75rem";
|
|
267
|
+
readonly topbar: "3.875rem";
|
|
268
|
+
readonly contextbar: "2.5625rem";
|
|
269
|
+
readonly sidebar: "17rem";
|
|
270
|
+
readonly inspector: "18rem";
|
|
271
|
+
readonly content: "75rem";
|
|
272
|
+
};
|
|
273
|
+
readonly borders: {
|
|
274
|
+
readonly width: "1px";
|
|
275
|
+
readonly color: "#c8c1b1";
|
|
276
|
+
readonly radius: "0px";
|
|
277
|
+
};
|
|
278
|
+
readonly shadows: {
|
|
279
|
+
readonly popover: "0 12px 30px color-mix(in srgb, var(--loidolt-shadow-color) 18%, transparent)";
|
|
280
|
+
readonly modal: "0 24px 60px color-mix(in srgb, var(--loidolt-shadow-color) 24%, transparent)";
|
|
281
|
+
readonly artwork: "0 18px 23px color-mix(in srgb, var(--loidolt-shadow-color) 14%, transparent)";
|
|
282
|
+
};
|
|
283
|
+
readonly motion: {
|
|
284
|
+
readonly fast: "100ms";
|
|
285
|
+
readonly normal: "150ms";
|
|
286
|
+
readonly slow: "220ms";
|
|
287
|
+
readonly easing: "cubic-bezier(0.2, 0, 0, 1)";
|
|
288
|
+
};
|
|
289
|
+
readonly zIndex: {
|
|
290
|
+
readonly base: "0";
|
|
291
|
+
readonly raised: "10";
|
|
292
|
+
readonly sticky: "40";
|
|
293
|
+
readonly overlay: "60";
|
|
294
|
+
readonly dialog: "61";
|
|
295
|
+
readonly menu: "70";
|
|
296
|
+
readonly toast: "80";
|
|
297
|
+
readonly tooltip: "90";
|
|
298
|
+
readonly skipLink: "1000";
|
|
299
|
+
};
|
|
300
|
+
readonly breakpoints: {
|
|
301
|
+
readonly compact: "760px";
|
|
302
|
+
};
|
|
303
|
+
readonly semantic: {
|
|
304
|
+
readonly background: string;
|
|
305
|
+
readonly surface: string;
|
|
306
|
+
readonly surfaceAlt: string;
|
|
307
|
+
readonly surfaceSunken: string;
|
|
308
|
+
readonly surfaceInverse: string;
|
|
309
|
+
readonly surfaceInput: string;
|
|
310
|
+
readonly text: string;
|
|
311
|
+
readonly textMuted: string;
|
|
312
|
+
readonly textInverse: string;
|
|
313
|
+
readonly textAccent: string;
|
|
314
|
+
readonly border: string;
|
|
315
|
+
readonly borderSoft: string;
|
|
316
|
+
readonly borderStrong: string;
|
|
317
|
+
readonly borderControl: string;
|
|
318
|
+
readonly accent: string;
|
|
319
|
+
readonly accentHover: string;
|
|
320
|
+
readonly onAccent: string;
|
|
321
|
+
readonly danger: string;
|
|
322
|
+
readonly onDanger: string;
|
|
323
|
+
readonly textDanger: string;
|
|
324
|
+
readonly success: string;
|
|
325
|
+
readonly onSuccess: string;
|
|
326
|
+
readonly textSuccess: string;
|
|
327
|
+
readonly warning: string;
|
|
328
|
+
readonly onWarning: string;
|
|
329
|
+
readonly textWarning: string;
|
|
330
|
+
readonly info: string;
|
|
331
|
+
readonly onInfo: string;
|
|
332
|
+
readonly textInfo: string;
|
|
333
|
+
readonly focusRing: string;
|
|
334
|
+
readonly shadowColor: string;
|
|
335
|
+
readonly scrim: string;
|
|
336
|
+
};
|
|
337
|
+
readonly darkSemantic: {
|
|
338
|
+
readonly background: "#161814";
|
|
339
|
+
readonly surface: "#1e211c";
|
|
340
|
+
readonly surfaceAlt: "#24271f";
|
|
341
|
+
readonly surfaceSunken: "#101210";
|
|
342
|
+
readonly surfaceInverse: "#ebe7dc";
|
|
343
|
+
readonly surfaceInput: "#24271f";
|
|
344
|
+
readonly text: "#ebe7dc";
|
|
345
|
+
readonly textMuted: "#a8a394";
|
|
346
|
+
readonly textInverse: "#161814";
|
|
347
|
+
readonly textAccent: "#f0895c";
|
|
348
|
+
readonly border: "#3a3d34";
|
|
349
|
+
readonly borderSoft: "#2b2e26";
|
|
350
|
+
readonly borderStrong: "#6a6e5f";
|
|
351
|
+
readonly borderControl: "#787c6b";
|
|
352
|
+
readonly accent: "#e0672f";
|
|
353
|
+
readonly accentHover: "#f0895c";
|
|
354
|
+
readonly onAccent: "#161814";
|
|
355
|
+
readonly danger: "#d75f55";
|
|
356
|
+
readonly onDanger: "#161814";
|
|
357
|
+
readonly textDanger: "#e88b81";
|
|
358
|
+
readonly success: "#7fa074";
|
|
359
|
+
readonly onSuccess: "#161814";
|
|
360
|
+
readonly textSuccess: "#93b287";
|
|
361
|
+
readonly warning: "#cc9a4e";
|
|
362
|
+
readonly onWarning: "#161814";
|
|
363
|
+
readonly textWarning: "#d9ab63";
|
|
364
|
+
readonly info: "#6ea5bd";
|
|
365
|
+
readonly onInfo: "#161814";
|
|
366
|
+
readonly textInfo: "#85b6ca";
|
|
367
|
+
readonly focusRing: "#f0895c";
|
|
368
|
+
readonly shadowColor: "#000000";
|
|
369
|
+
readonly scrim: "color-mix(in srgb, var(--loidolt-shadow-color) 78%, transparent)";
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
type ThemeTokens = typeof tokens;
|
|
373
|
+
|
|
374
|
+
export { type ThemeTokens, type TokenRef, borders, breakpoints, colors, cssVarName, darkSemantic, tokens as default, flattenTokens, generateCss, generateDarkCss, motion, semantic, shadows, sizing, spacing, tokens, typography, zIndex };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
var ref = (name) => ({ $ref: `--loidolt-${name}` });
|
|
3
|
+
var isRef = (value) => typeof value === "object" && value !== null && "$ref" in value;
|
|
4
|
+
var kebab = (value) => value.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
5
|
+
var cssVarName = (path) => `--loidolt-${kebab(path.join("-"))}`;
|
|
6
|
+
var colors = {
|
|
7
|
+
paper: "#ebe7dc",
|
|
8
|
+
panel: "#f5f2e9",
|
|
9
|
+
panelAlt: "#efebe1",
|
|
10
|
+
canvas: "#d8d3c7",
|
|
11
|
+
canvasLine: "#c9c3b6",
|
|
12
|
+
deep: "#20231d",
|
|
13
|
+
muted: "#5f5b50",
|
|
14
|
+
line: "#c8c1b1",
|
|
15
|
+
lineSoft: "#ddd7c9",
|
|
16
|
+
// Darker rule reserved for form-control boundaries, which must clear WCAG 1.4.11 (3:1)
|
|
17
|
+
// because the border is the only thing identifying the control.
|
|
18
|
+
lineStrong: "#847d6a",
|
|
19
|
+
white: "#ffffff",
|
|
20
|
+
orange: "#c65224",
|
|
21
|
+
orangeDark: "#a9441d",
|
|
22
|
+
error: "#9b2822",
|
|
23
|
+
success: "#3f5139",
|
|
24
|
+
warning: "#7c4d17",
|
|
25
|
+
info: "#265162"
|
|
26
|
+
};
|
|
27
|
+
var typography = {
|
|
28
|
+
display: '"Jost", "Avenir Next", sans-serif',
|
|
29
|
+
utility: '"Archivo", "Helvetica Neue", sans-serif',
|
|
30
|
+
mono: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
|
|
31
|
+
size: {
|
|
32
|
+
xs: "0.6875rem",
|
|
33
|
+
sm: "0.75rem",
|
|
34
|
+
base: "0.875rem",
|
|
35
|
+
md: "1rem",
|
|
36
|
+
lg: "1.25rem",
|
|
37
|
+
xl: "1.75rem",
|
|
38
|
+
display: "2.5rem"
|
|
39
|
+
},
|
|
40
|
+
tracking: { utility: "0.1em", wide: "0.13em" },
|
|
41
|
+
lineHeight: { tight: "1.15", normal: "1.45", relaxed: "1.65" }
|
|
42
|
+
};
|
|
43
|
+
var spacing = {
|
|
44
|
+
0: "0",
|
|
45
|
+
1: "0.25rem",
|
|
46
|
+
2: "0.5rem",
|
|
47
|
+
3: "0.75rem",
|
|
48
|
+
4: "1rem",
|
|
49
|
+
5: "1.25rem",
|
|
50
|
+
6: "1.5rem",
|
|
51
|
+
8: "2rem",
|
|
52
|
+
10: "2.5rem",
|
|
53
|
+
12: "3rem",
|
|
54
|
+
16: "4rem"
|
|
55
|
+
};
|
|
56
|
+
var sizing = {
|
|
57
|
+
controlSm: "2rem",
|
|
58
|
+
control: "2.375rem",
|
|
59
|
+
controlLg: "2.75rem",
|
|
60
|
+
topbar: "3.875rem",
|
|
61
|
+
contextbar: "2.5625rem",
|
|
62
|
+
sidebar: "17rem",
|
|
63
|
+
inspector: "18rem",
|
|
64
|
+
content: "75rem"
|
|
65
|
+
};
|
|
66
|
+
var borders = { width: "1px", color: colors.line, radius: "0px" };
|
|
67
|
+
var shadows = {
|
|
68
|
+
popover: "0 12px 30px color-mix(in srgb, var(--loidolt-shadow-color) 18%, transparent)",
|
|
69
|
+
modal: "0 24px 60px color-mix(in srgb, var(--loidolt-shadow-color) 24%, transparent)",
|
|
70
|
+
artwork: "0 18px 23px color-mix(in srgb, var(--loidolt-shadow-color) 14%, transparent)"
|
|
71
|
+
};
|
|
72
|
+
var motion = {
|
|
73
|
+
fast: "100ms",
|
|
74
|
+
normal: "150ms",
|
|
75
|
+
slow: "220ms",
|
|
76
|
+
easing: "cubic-bezier(0.2, 0, 0, 1)"
|
|
77
|
+
};
|
|
78
|
+
var zIndex = {
|
|
79
|
+
base: "0",
|
|
80
|
+
raised: "10",
|
|
81
|
+
sticky: "40",
|
|
82
|
+
overlay: "60",
|
|
83
|
+
dialog: "61",
|
|
84
|
+
menu: "70",
|
|
85
|
+
toast: "80",
|
|
86
|
+
tooltip: "90",
|
|
87
|
+
skipLink: "1000"
|
|
88
|
+
};
|
|
89
|
+
var breakpoints = { compact: "760px" };
|
|
90
|
+
var semanticDefs = {
|
|
91
|
+
background: ref("color-paper"),
|
|
92
|
+
surface: ref("color-panel"),
|
|
93
|
+
surfaceAlt: ref("color-panel-alt"),
|
|
94
|
+
surfaceSunken: ref("color-canvas"),
|
|
95
|
+
surfaceInverse: ref("color-deep"),
|
|
96
|
+
surfaceInput: ref("color-white"),
|
|
97
|
+
text: ref("color-deep"),
|
|
98
|
+
textMuted: ref("color-muted"),
|
|
99
|
+
textInverse: ref("color-panel"),
|
|
100
|
+
textAccent: ref("color-orange-dark"),
|
|
101
|
+
border: ref("color-line"),
|
|
102
|
+
borderSoft: ref("color-line-soft"),
|
|
103
|
+
borderStrong: ref("color-deep"),
|
|
104
|
+
/** Boundary of an input, select, textarea or switch — held to 3:1 against its surface. */
|
|
105
|
+
borderControl: ref("color-line-strong"),
|
|
106
|
+
accent: ref("color-orange"),
|
|
107
|
+
accentHover: ref("color-orange-dark"),
|
|
108
|
+
onAccent: ref("color-white"),
|
|
109
|
+
/*
|
|
110
|
+
* Status roles come in pairs. `danger`/`onDanger` are a *fill* and the ink that sits on it;
|
|
111
|
+
* `textDanger` is the same status used as text directly on a surface. They cannot be one
|
|
112
|
+
* value: a fill tuned for white ink is too light to read as text, and vice versa.
|
|
113
|
+
*/
|
|
114
|
+
danger: ref("color-error"),
|
|
115
|
+
onDanger: ref("color-white"),
|
|
116
|
+
textDanger: ref("color-error"),
|
|
117
|
+
success: ref("color-success"),
|
|
118
|
+
onSuccess: ref("color-white"),
|
|
119
|
+
textSuccess: ref("color-success"),
|
|
120
|
+
warning: ref("color-warning"),
|
|
121
|
+
onWarning: ref("color-white"),
|
|
122
|
+
textWarning: ref("color-warning"),
|
|
123
|
+
info: ref("color-info"),
|
|
124
|
+
onInfo: ref("color-white"),
|
|
125
|
+
textInfo: ref("color-info"),
|
|
126
|
+
focusRing: ref("color-orange"),
|
|
127
|
+
shadowColor: ref("color-deep"),
|
|
128
|
+
scrim: "color-mix(in srgb, var(--loidolt-shadow-color) 72%, transparent)"
|
|
129
|
+
};
|
|
130
|
+
var PRIMITIVE_GROUPS = [
|
|
131
|
+
["color", colors],
|
|
132
|
+
["font", typography],
|
|
133
|
+
["space", spacing],
|
|
134
|
+
["size", sizing],
|
|
135
|
+
["border", { width: borders.width, color: ref("color-line"), radius: borders.radius }],
|
|
136
|
+
["shadow", shadows],
|
|
137
|
+
["motion", motion],
|
|
138
|
+
["z", zIndex]
|
|
139
|
+
];
|
|
140
|
+
var flattenInto = (prefix, tree, out) => {
|
|
141
|
+
for (const [key, value] of Object.entries(tree)) {
|
|
142
|
+
if (typeof value === "string" || isRef(value)) out.push([cssVarName([...prefix, key]), value]);
|
|
143
|
+
else flattenInto([...prefix, key], value, out);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
function flattenTokens() {
|
|
147
|
+
const out = [];
|
|
148
|
+
for (const [prefix, tree] of PRIMITIVE_GROUPS) flattenInto([prefix], tree, out);
|
|
149
|
+
for (const [name, value] of Object.entries(semanticDefs)) out.push([cssVarName([name]), value]);
|
|
150
|
+
return out;
|
|
151
|
+
}
|
|
152
|
+
function generateCss() {
|
|
153
|
+
const declarations = flattenTokens().map(
|
|
154
|
+
([name, value]) => ` ${name}: ${isRef(value) ? `var(${value.$ref})` : value};`
|
|
155
|
+
);
|
|
156
|
+
return [
|
|
157
|
+
"/* Generated from src/index.ts. Do not edit directly. */",
|
|
158
|
+
":root {",
|
|
159
|
+
...declarations,
|
|
160
|
+
"}",
|
|
161
|
+
""
|
|
162
|
+
].join("\n");
|
|
163
|
+
}
|
|
164
|
+
var resolved = new Map(
|
|
165
|
+
flattenTokens().filter((entry) => typeof entry[1] === "string")
|
|
166
|
+
);
|
|
167
|
+
var semantic = Object.fromEntries(
|
|
168
|
+
Object.entries(semanticDefs).map(([name, value]) => [
|
|
169
|
+
name,
|
|
170
|
+
isRef(value) ? resolved.get(value.$ref) ?? "" : value
|
|
171
|
+
])
|
|
172
|
+
);
|
|
173
|
+
var darkSemantic = {
|
|
174
|
+
background: "#161814",
|
|
175
|
+
surface: "#1e211c",
|
|
176
|
+
surfaceAlt: "#24271f",
|
|
177
|
+
surfaceSunken: "#101210",
|
|
178
|
+
surfaceInverse: "#ebe7dc",
|
|
179
|
+
surfaceInput: "#24271f",
|
|
180
|
+
text: "#ebe7dc",
|
|
181
|
+
textMuted: "#a8a394",
|
|
182
|
+
textInverse: "#161814",
|
|
183
|
+
textAccent: "#f0895c",
|
|
184
|
+
border: "#3a3d34",
|
|
185
|
+
borderSoft: "#2b2e26",
|
|
186
|
+
borderStrong: "#6a6e5f",
|
|
187
|
+
borderControl: "#787c6b",
|
|
188
|
+
accent: "#e0672f",
|
|
189
|
+
accentHover: "#f0895c",
|
|
190
|
+
onAccent: "#161814",
|
|
191
|
+
danger: "#d75f55",
|
|
192
|
+
onDanger: "#161814",
|
|
193
|
+
textDanger: "#e88b81",
|
|
194
|
+
success: "#7fa074",
|
|
195
|
+
onSuccess: "#161814",
|
|
196
|
+
textSuccess: "#93b287",
|
|
197
|
+
warning: "#cc9a4e",
|
|
198
|
+
onWarning: "#161814",
|
|
199
|
+
textWarning: "#d9ab63",
|
|
200
|
+
info: "#6ea5bd",
|
|
201
|
+
onInfo: "#161814",
|
|
202
|
+
textInfo: "#85b6ca",
|
|
203
|
+
focusRing: "#f0895c",
|
|
204
|
+
shadowColor: "#000000",
|
|
205
|
+
scrim: "color-mix(in srgb, var(--loidolt-shadow-color) 78%, transparent)"
|
|
206
|
+
};
|
|
207
|
+
var darkDeclarations = () => Object.entries(darkSemantic).map(([name, value]) => ` ${cssVarName([name])}: ${value};`);
|
|
208
|
+
function generateDarkCss(scope = "attribute") {
|
|
209
|
+
const body = [" color-scheme: dark;", ...darkDeclarations()];
|
|
210
|
+
const lines = [
|
|
211
|
+
"/* Generated from src/index.ts. Do not edit directly. */",
|
|
212
|
+
"[data-theme='dark'] {",
|
|
213
|
+
...body,
|
|
214
|
+
"}"
|
|
215
|
+
];
|
|
216
|
+
if (scope === "auto") {
|
|
217
|
+
lines.push(
|
|
218
|
+
"",
|
|
219
|
+
"@media (prefers-color-scheme: dark) {",
|
|
220
|
+
" :root:not([data-theme='light']) {",
|
|
221
|
+
...body.map((line) => ` ${line}`),
|
|
222
|
+
" }",
|
|
223
|
+
"}"
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
return `${lines.join("\n")}
|
|
227
|
+
`;
|
|
228
|
+
}
|
|
229
|
+
var tokens = {
|
|
230
|
+
colors,
|
|
231
|
+
typography,
|
|
232
|
+
spacing,
|
|
233
|
+
sizing,
|
|
234
|
+
borders,
|
|
235
|
+
shadows,
|
|
236
|
+
motion,
|
|
237
|
+
zIndex,
|
|
238
|
+
breakpoints,
|
|
239
|
+
semantic,
|
|
240
|
+
darkSemantic
|
|
241
|
+
};
|
|
242
|
+
var index_default = tokens;
|
|
243
|
+
export {
|
|
244
|
+
borders,
|
|
245
|
+
breakpoints,
|
|
246
|
+
colors,
|
|
247
|
+
cssVarName,
|
|
248
|
+
darkSemantic,
|
|
249
|
+
index_default as default,
|
|
250
|
+
flattenTokens,
|
|
251
|
+
generateCss,
|
|
252
|
+
generateDarkCss,
|
|
253
|
+
motion,
|
|
254
|
+
semantic,
|
|
255
|
+
shadows,
|
|
256
|
+
sizing,
|
|
257
|
+
spacing,
|
|
258
|
+
tokens,
|
|
259
|
+
typography,
|
|
260
|
+
zIndex
|
|
261
|
+
};
|
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* Generated from src/index.ts. Do not edit directly. */
|
|
2
|
+
:root {
|
|
3
|
+
--loidolt-color-paper: #ebe7dc;
|
|
4
|
+
--loidolt-color-panel: #f5f2e9;
|
|
5
|
+
--loidolt-color-panel-alt: #efebe1;
|
|
6
|
+
--loidolt-color-canvas: #d8d3c7;
|
|
7
|
+
--loidolt-color-canvas-line: #c9c3b6;
|
|
8
|
+
--loidolt-color-deep: #20231d;
|
|
9
|
+
--loidolt-color-muted: #5f5b50;
|
|
10
|
+
--loidolt-color-line: #c8c1b1;
|
|
11
|
+
--loidolt-color-line-soft: #ddd7c9;
|
|
12
|
+
--loidolt-color-line-strong: #847d6a;
|
|
13
|
+
--loidolt-color-white: #ffffff;
|
|
14
|
+
--loidolt-color-orange: #c65224;
|
|
15
|
+
--loidolt-color-orange-dark: #a9441d;
|
|
16
|
+
--loidolt-color-error: #9b2822;
|
|
17
|
+
--loidolt-color-success: #3f5139;
|
|
18
|
+
--loidolt-color-warning: #7c4d17;
|
|
19
|
+
--loidolt-color-info: #265162;
|
|
20
|
+
--loidolt-font-display: "Jost", "Avenir Next", sans-serif;
|
|
21
|
+
--loidolt-font-utility: "Archivo", "Helvetica Neue", sans-serif;
|
|
22
|
+
--loidolt-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
23
|
+
--loidolt-font-size-xs: 0.6875rem;
|
|
24
|
+
--loidolt-font-size-sm: 0.75rem;
|
|
25
|
+
--loidolt-font-size-base: 0.875rem;
|
|
26
|
+
--loidolt-font-size-md: 1rem;
|
|
27
|
+
--loidolt-font-size-lg: 1.25rem;
|
|
28
|
+
--loidolt-font-size-xl: 1.75rem;
|
|
29
|
+
--loidolt-font-size-display: 2.5rem;
|
|
30
|
+
--loidolt-font-tracking-utility: 0.1em;
|
|
31
|
+
--loidolt-font-tracking-wide: 0.13em;
|
|
32
|
+
--loidolt-font-line-height-tight: 1.15;
|
|
33
|
+
--loidolt-font-line-height-normal: 1.45;
|
|
34
|
+
--loidolt-font-line-height-relaxed: 1.65;
|
|
35
|
+
--loidolt-space-0: 0;
|
|
36
|
+
--loidolt-space-1: 0.25rem;
|
|
37
|
+
--loidolt-space-2: 0.5rem;
|
|
38
|
+
--loidolt-space-3: 0.75rem;
|
|
39
|
+
--loidolt-space-4: 1rem;
|
|
40
|
+
--loidolt-space-5: 1.25rem;
|
|
41
|
+
--loidolt-space-6: 1.5rem;
|
|
42
|
+
--loidolt-space-8: 2rem;
|
|
43
|
+
--loidolt-space-10: 2.5rem;
|
|
44
|
+
--loidolt-space-12: 3rem;
|
|
45
|
+
--loidolt-space-16: 4rem;
|
|
46
|
+
--loidolt-size-control-sm: 2rem;
|
|
47
|
+
--loidolt-size-control: 2.375rem;
|
|
48
|
+
--loidolt-size-control-lg: 2.75rem;
|
|
49
|
+
--loidolt-size-topbar: 3.875rem;
|
|
50
|
+
--loidolt-size-contextbar: 2.5625rem;
|
|
51
|
+
--loidolt-size-sidebar: 17rem;
|
|
52
|
+
--loidolt-size-inspector: 18rem;
|
|
53
|
+
--loidolt-size-content: 75rem;
|
|
54
|
+
--loidolt-border-width: 1px;
|
|
55
|
+
--loidolt-border-color: var(--loidolt-color-line);
|
|
56
|
+
--loidolt-border-radius: 0px;
|
|
57
|
+
--loidolt-shadow-popover: 0 12px 30px color-mix(in srgb, var(--loidolt-shadow-color) 18%, transparent);
|
|
58
|
+
--loidolt-shadow-modal: 0 24px 60px color-mix(in srgb, var(--loidolt-shadow-color) 24%, transparent);
|
|
59
|
+
--loidolt-shadow-artwork: 0 18px 23px color-mix(in srgb, var(--loidolt-shadow-color) 14%, transparent);
|
|
60
|
+
--loidolt-motion-fast: 100ms;
|
|
61
|
+
--loidolt-motion-normal: 150ms;
|
|
62
|
+
--loidolt-motion-slow: 220ms;
|
|
63
|
+
--loidolt-motion-easing: cubic-bezier(0.2, 0, 0, 1);
|
|
64
|
+
--loidolt-z-base: 0;
|
|
65
|
+
--loidolt-z-raised: 10;
|
|
66
|
+
--loidolt-z-sticky: 40;
|
|
67
|
+
--loidolt-z-overlay: 60;
|
|
68
|
+
--loidolt-z-dialog: 61;
|
|
69
|
+
--loidolt-z-menu: 70;
|
|
70
|
+
--loidolt-z-toast: 80;
|
|
71
|
+
--loidolt-z-tooltip: 90;
|
|
72
|
+
--loidolt-z-skip-link: 1000;
|
|
73
|
+
--loidolt-background: var(--loidolt-color-paper);
|
|
74
|
+
--loidolt-surface: var(--loidolt-color-panel);
|
|
75
|
+
--loidolt-surface-alt: var(--loidolt-color-panel-alt);
|
|
76
|
+
--loidolt-surface-sunken: var(--loidolt-color-canvas);
|
|
77
|
+
--loidolt-surface-inverse: var(--loidolt-color-deep);
|
|
78
|
+
--loidolt-surface-input: var(--loidolt-color-white);
|
|
79
|
+
--loidolt-text: var(--loidolt-color-deep);
|
|
80
|
+
--loidolt-text-muted: var(--loidolt-color-muted);
|
|
81
|
+
--loidolt-text-inverse: var(--loidolt-color-panel);
|
|
82
|
+
--loidolt-text-accent: var(--loidolt-color-orange-dark);
|
|
83
|
+
--loidolt-border: var(--loidolt-color-line);
|
|
84
|
+
--loidolt-border-soft: var(--loidolt-color-line-soft);
|
|
85
|
+
--loidolt-border-strong: var(--loidolt-color-deep);
|
|
86
|
+
--loidolt-border-control: var(--loidolt-color-line-strong);
|
|
87
|
+
--loidolt-accent: var(--loidolt-color-orange);
|
|
88
|
+
--loidolt-accent-hover: var(--loidolt-color-orange-dark);
|
|
89
|
+
--loidolt-on-accent: var(--loidolt-color-white);
|
|
90
|
+
--loidolt-danger: var(--loidolt-color-error);
|
|
91
|
+
--loidolt-on-danger: var(--loidolt-color-white);
|
|
92
|
+
--loidolt-text-danger: var(--loidolt-color-error);
|
|
93
|
+
--loidolt-success: var(--loidolt-color-success);
|
|
94
|
+
--loidolt-on-success: var(--loidolt-color-white);
|
|
95
|
+
--loidolt-text-success: var(--loidolt-color-success);
|
|
96
|
+
--loidolt-warning: var(--loidolt-color-warning);
|
|
97
|
+
--loidolt-on-warning: var(--loidolt-color-white);
|
|
98
|
+
--loidolt-text-warning: var(--loidolt-color-warning);
|
|
99
|
+
--loidolt-info: var(--loidolt-color-info);
|
|
100
|
+
--loidolt-on-info: var(--loidolt-color-white);
|
|
101
|
+
--loidolt-text-info: var(--loidolt-color-info);
|
|
102
|
+
--loidolt-focus-ring: var(--loidolt-color-orange);
|
|
103
|
+
--loidolt-shadow-color: var(--loidolt-color-deep);
|
|
104
|
+
--loidolt-scrim: color-mix(in srgb, var(--loidolt-shadow-color) 72%, transparent);
|
|
105
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@loidolt/theme-tokens",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Typed design tokens for Loidolt applications",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./css": "./dist/tokens.css",
|
|
16
|
+
"./css/dark": "./dist/dark.css",
|
|
17
|
+
"./css/dark-auto": "./dist/dark-auto.css",
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"sideEffects": [
|
|
24
|
+
"**/*.css"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=22"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsup src/index.ts --format esm --dts --clean && node scripts/generate-css.mjs",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"test": "vitest run",
|
|
33
|
+
"clean": "rimraf dist"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public",
|
|
37
|
+
"provenance": true
|
|
38
|
+
},
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/loidolt/loidolt-theme.git",
|
|
42
|
+
"directory": "packages/tokens"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/node": "^24.3.0",
|
|
46
|
+
"tsup": "^8.5.0",
|
|
47
|
+
"typescript": "^6.0.3",
|
|
48
|
+
"rimraf": "^6.0.1",
|
|
49
|
+
"vitest": "^4.0.0"
|
|
50
|
+
}
|
|
51
|
+
}
|