@interstellarforge/matter-css 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Interstellarforge
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 @@
1
+ export declare const themeInitScript: string;
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export const themeInitScript = "(function(){try{var e=document.documentElement,s=localStorage;['theme','color-mode','density'].forEach(function(k){var v=s.getItem('matter-'+k);if(v)e.setAttribute('data-'+k,v)})}catch(_){}})();";
@@ -0,0 +1,861 @@
1
+ /* Generated by @interstellarforge/matter-tokens. Do not edit. */
2
+ @layer matter.reset, matter.tokens, matter.base, matter.components;
3
+ @layer matter.tokens {
4
+ :root {
5
+ --m-duration-base: 0.15s;
6
+ --m-duration-fast: 0.12s;
7
+ --m-duration-slow: 0.22s;
8
+ --m-ease: cubic-bezier(0.2, 0.7, 0.25, 1);
9
+ --m-font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
10
+ --m-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
11
+ --m-fs-2xl: 28px;
12
+ --m-fs-base: 15px;
13
+ --m-fs-lg: 17px;
14
+ --m-fs-md: 14px;
15
+ --m-fs-sm: 12px;
16
+ --m-fs-xl: 22px;
17
+ --m-fs-xs: 11px;
18
+ --m-fw-bold: 700;
19
+ --m-fw-medium: 500;
20
+ --m-fw-regular: 400;
21
+ --m-fw-semibold: 600;
22
+ --m-lh-normal: 1.45;
23
+ --m-lh-relaxed: 1.6;
24
+ --m-lh-tight: 1.2;
25
+ --m-radius-lg: 16px;
26
+ --m-radius-md: 12px;
27
+ --m-radius-pill: 9999px;
28
+ --m-radius-sm: 8px;
29
+ --m-radius-xl: 22px;
30
+ --m-radius-xs: 5px;
31
+ --m-space-0: 0px;
32
+ --m-space-1: 4px;
33
+ --m-space-10: 40px;
34
+ --m-space-12: 48px;
35
+ --m-space-2: 8px;
36
+ --m-space-3: 12px;
37
+ --m-space-4: 16px;
38
+ --m-space-5: 20px;
39
+ --m-space-6: 24px;
40
+ --m-space-8: 32px;
41
+ }
42
+ :root,
43
+ [data-density="comfortable"] {
44
+ --m-control-fs: 14px;
45
+ --m-control-gap: 12px;
46
+ --m-control-h: 36px;
47
+ --m-control-pad-x: 14px;
48
+ --m-row-h: 48px;
49
+ }
50
+ [data-density="compact"] {
51
+ --m-control-fs: 12px;
52
+ --m-control-gap: 8px;
53
+ --m-control-h: 28px;
54
+ --m-control-pad-x: 10px;
55
+ --m-row-h: 36px;
56
+ }
57
+ [data-density="touch"] {
58
+ --m-control-fs: 17px;
59
+ --m-control-gap: 16px;
60
+ --m-control-h: 48px;
61
+ --m-control-pad-x: 20px;
62
+ --m-row-h: 64px;
63
+ }
64
+ :root[data-theme="deep-space"],
65
+ :root:not([data-theme]) {
66
+ color-scheme: light;
67
+ --m-control-radius: 8px;
68
+ --m-accent: #165dba;
69
+ --m-accent-hover: #0e4e9e;
70
+ --m-accent-on: #ffffff;
71
+ --m-accent-soft: #e1edff;
72
+ --m-accent-soft-on: #164c9c;
73
+ --m-bg: #f3f6fb;
74
+ --m-border: #cdd9e8;
75
+ --m-border-strong: #98acc4;
76
+ --m-danger: #b22342;
77
+ --m-danger-soft: #fce8ed;
78
+ --m-focus: #165dba;
79
+ --m-focus-halo: #ffffff;
80
+ --m-info: #155bad;
81
+ --m-info-soft: #e2efff;
82
+ --m-overlay: rgba(7, 16, 32, 0.54);
83
+ --m-placeholder: #62758f;
84
+ --m-primary: #165dba;
85
+ --m-primary-hover: #0e4e9e;
86
+ --m-primary-on: #ffffff;
87
+ --m-shadow-lg: 0px 24px 64px 0px rgb(3.53% 9.41% 20% / 0.18);
88
+ --m-shadow-md: 0px 8px 28px 0px rgb(5.49% 14.51% 29.41% / 0.1);
89
+ --m-shadow-sm: 0px 1px 3px 0px rgb(4.31% 12.94% 25.1% / 0.07);
90
+ --m-sidebar: #ffffff;
91
+ --m-success: #086f50;
92
+ --m-success-soft: #ddf6eb;
93
+ --m-surface: #ffffff;
94
+ --m-surface-disabled: #ebeff6;
95
+ --m-surface-hover: #e3edf9;
96
+ --m-surface-raised: #ffffff;
97
+ --m-surface-soft: #eaf1fa;
98
+ --m-text: #11243e;
99
+ --m-text-muted: #435b78;
100
+ --m-text-subtle: #536b87;
101
+ --m-warning: #865200;
102
+ --m-warning-soft: #fff0d6;
103
+ }
104
+ @media (prefers-color-scheme: dark) {
105
+ :root[data-theme="deep-space"]:not([data-color-mode="light"]),
106
+ :root:not([data-theme]):not([data-color-mode="light"]) {
107
+ color-scheme: dark;
108
+ --m-accent: #5aa9ff;
109
+ --m-accent-hover: #82bbff;
110
+ --m-accent-on: #04152b;
111
+ --m-accent-soft: #12335c;
112
+ --m-accent-soft-on: #cfe4ff;
113
+ --m-bg: #060e1d;
114
+ --m-border: #2a4662;
115
+ --m-border-strong: #4c6a8b;
116
+ --m-danger: #ff8da0;
117
+ --m-danger-soft: #4a1d2c;
118
+ --m-focus: #8fc4ff;
119
+ --m-focus-halo: #060e1d;
120
+ --m-info: #8fc4ff;
121
+ --m-info-soft: #12335c;
122
+ --m-overlay: rgba(0, 5, 13, 0.72);
123
+ --m-placeholder: #9fb3ca;
124
+ --m-primary: #1b6fd9;
125
+ --m-primary-hover: #2a82f0;
126
+ --m-primary-on: #ffffff;
127
+ --m-shadow-lg: 0px 24px 66px 0px rgb(0% 0% 0% / 0.55);
128
+ --m-shadow-md: 0px 12px 32px 0px rgb(0% 0% 0% / 0.32);
129
+ --m-shadow-sm: 0px 1px 2px 0px rgb(0% 0% 0% / 0.3);
130
+ --m-sidebar: #071322;
131
+ --m-success: #3fe0b0;
132
+ --m-success-soft: #0f3a35;
133
+ --m-surface: #0d1c30;
134
+ --m-surface-disabled: #14233a;
135
+ --m-surface-hover: #17304d;
136
+ --m-surface-raised: #13263d;
137
+ --m-surface-soft: #112238;
138
+ --m-text: #f4f7fc;
139
+ --m-text-muted: #b7c7d9;
140
+ --m-text-subtle: #9fb3ca;
141
+ --m-warning: #ffa24d;
142
+ --m-warning-soft: #3a2812;
143
+ }
144
+ }
145
+ :root[data-theme="deep-space"][data-color-mode="light"],
146
+ :root:not([data-theme])[data-color-mode="light"] {
147
+ color-scheme: light;
148
+ --m-accent: #165dba;
149
+ --m-accent-hover: #0e4e9e;
150
+ --m-accent-on: #ffffff;
151
+ --m-accent-soft: #e1edff;
152
+ --m-accent-soft-on: #164c9c;
153
+ --m-bg: #f3f6fb;
154
+ --m-border: #cdd9e8;
155
+ --m-border-strong: #98acc4;
156
+ --m-danger: #b22342;
157
+ --m-danger-soft: #fce8ed;
158
+ --m-focus: #165dba;
159
+ --m-focus-halo: #ffffff;
160
+ --m-info: #155bad;
161
+ --m-info-soft: #e2efff;
162
+ --m-overlay: rgba(7, 16, 32, 0.54);
163
+ --m-placeholder: #62758f;
164
+ --m-primary: #165dba;
165
+ --m-primary-hover: #0e4e9e;
166
+ --m-primary-on: #ffffff;
167
+ --m-shadow-lg: 0px 24px 64px 0px rgb(3.53% 9.41% 20% / 0.18);
168
+ --m-shadow-md: 0px 8px 28px 0px rgb(5.49% 14.51% 29.41% / 0.1);
169
+ --m-shadow-sm: 0px 1px 3px 0px rgb(4.31% 12.94% 25.1% / 0.07);
170
+ --m-sidebar: #ffffff;
171
+ --m-success: #086f50;
172
+ --m-success-soft: #ddf6eb;
173
+ --m-surface: #ffffff;
174
+ --m-surface-disabled: #ebeff6;
175
+ --m-surface-hover: #e3edf9;
176
+ --m-surface-raised: #ffffff;
177
+ --m-surface-soft: #eaf1fa;
178
+ --m-text: #11243e;
179
+ --m-text-muted: #435b78;
180
+ --m-text-subtle: #536b87;
181
+ --m-warning: #865200;
182
+ --m-warning-soft: #fff0d6;
183
+ }
184
+ :root[data-theme="deep-space"][data-color-mode="dark"],
185
+ :root:not([data-theme])[data-color-mode="dark"] {
186
+ color-scheme: dark;
187
+ --m-accent: #5aa9ff;
188
+ --m-accent-hover: #82bbff;
189
+ --m-accent-on: #04152b;
190
+ --m-accent-soft: #12335c;
191
+ --m-accent-soft-on: #cfe4ff;
192
+ --m-bg: #060e1d;
193
+ --m-border: #2a4662;
194
+ --m-border-strong: #4c6a8b;
195
+ --m-danger: #ff8da0;
196
+ --m-danger-soft: #4a1d2c;
197
+ --m-focus: #8fc4ff;
198
+ --m-focus-halo: #060e1d;
199
+ --m-info: #8fc4ff;
200
+ --m-info-soft: #12335c;
201
+ --m-overlay: rgba(0, 5, 13, 0.72);
202
+ --m-placeholder: #9fb3ca;
203
+ --m-primary: #1b6fd9;
204
+ --m-primary-hover: #2a82f0;
205
+ --m-primary-on: #ffffff;
206
+ --m-shadow-lg: 0px 24px 66px 0px rgb(0% 0% 0% / 0.55);
207
+ --m-shadow-md: 0px 12px 32px 0px rgb(0% 0% 0% / 0.32);
208
+ --m-shadow-sm: 0px 1px 2px 0px rgb(0% 0% 0% / 0.3);
209
+ --m-sidebar: #071322;
210
+ --m-success: #3fe0b0;
211
+ --m-success-soft: #0f3a35;
212
+ --m-surface: #0d1c30;
213
+ --m-surface-disabled: #14233a;
214
+ --m-surface-hover: #17304d;
215
+ --m-surface-raised: #13263d;
216
+ --m-surface-soft: #112238;
217
+ --m-text: #f4f7fc;
218
+ --m-text-muted: #b7c7d9;
219
+ --m-text-subtle: #9fb3ca;
220
+ --m-warning: #ffa24d;
221
+ --m-warning-soft: #3a2812;
222
+ }
223
+ :root[data-theme="professional"] {
224
+ color-scheme: light;
225
+ --m-control-radius: 12px;
226
+ --m-accent: #165dba;
227
+ --m-accent-hover: #0e4e9e;
228
+ --m-accent-on: #ffffff;
229
+ --m-accent-soft: #e1edff;
230
+ --m-accent-soft-on: #164c9c;
231
+ --m-bg: #f3f6fb;
232
+ --m-border: #cdd9e8;
233
+ --m-border-strong: #98acc4;
234
+ --m-danger: #b22342;
235
+ --m-danger-soft: #fce8ed;
236
+ --m-focus: #165dba;
237
+ --m-focus-halo: #ffffff;
238
+ --m-info: #155bad;
239
+ --m-info-soft: #e2efff;
240
+ --m-overlay: rgba(7, 16, 32, 0.54);
241
+ --m-placeholder: #62758f;
242
+ --m-primary: #165dba;
243
+ --m-primary-hover: #0e4e9e;
244
+ --m-primary-on: #ffffff;
245
+ --m-shadow-lg: 0px 24px 64px 0px rgb(3.53% 9.41% 20% / 0.18);
246
+ --m-shadow-md: 0px 8px 28px 0px rgb(5.49% 14.51% 29.41% / 0.1);
247
+ --m-shadow-sm: 0px 1px 3px 0px rgb(4.31% 12.94% 25.1% / 0.07);
248
+ --m-sidebar: #ffffff;
249
+ --m-success: #086f50;
250
+ --m-success-soft: #ddf6eb;
251
+ --m-surface: #ffffff;
252
+ --m-surface-disabled: #ebeff6;
253
+ --m-surface-hover: #e3edf9;
254
+ --m-surface-raised: #ffffff;
255
+ --m-surface-soft: #eaf1fa;
256
+ --m-text: #11243e;
257
+ --m-text-muted: #435b78;
258
+ --m-text-subtle: #536b87;
259
+ --m-warning: #865200;
260
+ --m-warning-soft: #fff0d6;
261
+ }
262
+ @media (prefers-color-scheme: dark) {
263
+ :root[data-theme="professional"]:not([data-color-mode="light"]) {
264
+ color-scheme: dark;
265
+ --m-accent: #5aa9ff;
266
+ --m-accent-hover: #82bbff;
267
+ --m-accent-on: #04152b;
268
+ --m-accent-soft: #12335c;
269
+ --m-accent-soft-on: #cfe4ff;
270
+ --m-bg: #060e1d;
271
+ --m-border: #2a4662;
272
+ --m-border-strong: #4c6a8b;
273
+ --m-danger: #ff8da0;
274
+ --m-danger-soft: #4a1d2c;
275
+ --m-focus: #8fc4ff;
276
+ --m-focus-halo: #060e1d;
277
+ --m-info: #8fc4ff;
278
+ --m-info-soft: #12335c;
279
+ --m-overlay: rgba(0, 5, 13, 0.72);
280
+ --m-placeholder: #9fb3ca;
281
+ --m-primary: #1b6fd9;
282
+ --m-primary-hover: #2a82f0;
283
+ --m-primary-on: #ffffff;
284
+ --m-shadow-lg: 0px 24px 66px 0px rgb(0% 0% 0% / 0.55);
285
+ --m-shadow-md: 0px 12px 32px 0px rgb(0% 0% 0% / 0.32);
286
+ --m-shadow-sm: 0px 1px 2px 0px rgb(0% 0% 0% / 0.3);
287
+ --m-sidebar: #071322;
288
+ --m-success: #3fe0b0;
289
+ --m-success-soft: #0f3a35;
290
+ --m-surface: #0d1c30;
291
+ --m-surface-disabled: #14233a;
292
+ --m-surface-hover: #17304d;
293
+ --m-surface-raised: #13263d;
294
+ --m-surface-soft: #112238;
295
+ --m-text: #f4f7fc;
296
+ --m-text-muted: #b7c7d9;
297
+ --m-text-subtle: #9fb3ca;
298
+ --m-warning: #ffa24d;
299
+ --m-warning-soft: #3a2812;
300
+ }
301
+ }
302
+ :root[data-theme="professional"][data-color-mode="light"] {
303
+ color-scheme: light;
304
+ --m-accent: #165dba;
305
+ --m-accent-hover: #0e4e9e;
306
+ --m-accent-on: #ffffff;
307
+ --m-accent-soft: #e1edff;
308
+ --m-accent-soft-on: #164c9c;
309
+ --m-bg: #f3f6fb;
310
+ --m-border: #cdd9e8;
311
+ --m-border-strong: #98acc4;
312
+ --m-danger: #b22342;
313
+ --m-danger-soft: #fce8ed;
314
+ --m-focus: #165dba;
315
+ --m-focus-halo: #ffffff;
316
+ --m-info: #155bad;
317
+ --m-info-soft: #e2efff;
318
+ --m-overlay: rgba(7, 16, 32, 0.54);
319
+ --m-placeholder: #62758f;
320
+ --m-primary: #165dba;
321
+ --m-primary-hover: #0e4e9e;
322
+ --m-primary-on: #ffffff;
323
+ --m-shadow-lg: 0px 24px 64px 0px rgb(3.53% 9.41% 20% / 0.18);
324
+ --m-shadow-md: 0px 8px 28px 0px rgb(5.49% 14.51% 29.41% / 0.1);
325
+ --m-shadow-sm: 0px 1px 3px 0px rgb(4.31% 12.94% 25.1% / 0.07);
326
+ --m-sidebar: #ffffff;
327
+ --m-success: #086f50;
328
+ --m-success-soft: #ddf6eb;
329
+ --m-surface: #ffffff;
330
+ --m-surface-disabled: #ebeff6;
331
+ --m-surface-hover: #e3edf9;
332
+ --m-surface-raised: #ffffff;
333
+ --m-surface-soft: #eaf1fa;
334
+ --m-text: #11243e;
335
+ --m-text-muted: #435b78;
336
+ --m-text-subtle: #536b87;
337
+ --m-warning: #865200;
338
+ --m-warning-soft: #fff0d6;
339
+ }
340
+ :root[data-theme="professional"][data-color-mode="dark"] {
341
+ color-scheme: dark;
342
+ --m-accent: #5aa9ff;
343
+ --m-accent-hover: #82bbff;
344
+ --m-accent-on: #04152b;
345
+ --m-accent-soft: #12335c;
346
+ --m-accent-soft-on: #cfe4ff;
347
+ --m-bg: #060e1d;
348
+ --m-border: #2a4662;
349
+ --m-border-strong: #4c6a8b;
350
+ --m-danger: #ff8da0;
351
+ --m-danger-soft: #4a1d2c;
352
+ --m-focus: #8fc4ff;
353
+ --m-focus-halo: #060e1d;
354
+ --m-info: #8fc4ff;
355
+ --m-info-soft: #12335c;
356
+ --m-overlay: rgba(0, 5, 13, 0.72);
357
+ --m-placeholder: #9fb3ca;
358
+ --m-primary: #1b6fd9;
359
+ --m-primary-hover: #2a82f0;
360
+ --m-primary-on: #ffffff;
361
+ --m-shadow-lg: 0px 24px 66px 0px rgb(0% 0% 0% / 0.55);
362
+ --m-shadow-md: 0px 12px 32px 0px rgb(0% 0% 0% / 0.32);
363
+ --m-shadow-sm: 0px 1px 2px 0px rgb(0% 0% 0% / 0.3);
364
+ --m-sidebar: #071322;
365
+ --m-success: #3fe0b0;
366
+ --m-success-soft: #0f3a35;
367
+ --m-surface: #0d1c30;
368
+ --m-surface-disabled: #14233a;
369
+ --m-surface-hover: #17304d;
370
+ --m-surface-raised: #13263d;
371
+ --m-surface-soft: #112238;
372
+ --m-text: #f4f7fc;
373
+ --m-text-muted: #b7c7d9;
374
+ --m-text-subtle: #9fb3ca;
375
+ --m-warning: #ffa24d;
376
+ --m-warning-soft: #3a2812;
377
+ }
378
+ }
379
+ @layer matter.components {
380
+ .m-button,
381
+ .m-input {
382
+ box-sizing: border-box;
383
+ min-height: var(--m-control-h);
384
+ border-radius: var(--m-control-radius);
385
+ font: inherit;
386
+ font-size: var(--m-control-fs);
387
+ }
388
+
389
+ /* Button */
390
+ .m-button {
391
+ display: inline-flex;
392
+ align-items: center;
393
+ justify-content: center;
394
+ gap: var(--m-control-gap);
395
+ padding: 0 var(--m-control-pad-x);
396
+ border: 1px solid var(--m-border-strong);
397
+ background: var(--m-surface-raised);
398
+ color: var(--m-text);
399
+ font-weight: var(--m-fw-semibold);
400
+ cursor: pointer;
401
+ transition:
402
+ background var(--m-duration-fast) var(--m-ease),
403
+ border-color var(--m-duration-fast) var(--m-ease);
404
+ }
405
+ .m-button:hover {
406
+ background: var(--m-surface-hover);
407
+ }
408
+ .m-button[data-variant="primary"] {
409
+ background: var(--m-primary);
410
+ border-color: transparent;
411
+ color: var(--m-primary-on);
412
+ }
413
+ .m-button[data-variant="primary"]:hover {
414
+ background: var(--m-primary-hover);
415
+ }
416
+ .m-button[data-variant="ghost"] {
417
+ background: transparent;
418
+ border-color: transparent;
419
+ color: var(--m-accent);
420
+ }
421
+ .m-button[data-variant="ghost"]:hover {
422
+ background: var(--m-accent-soft);
423
+ }
424
+ .m-button[data-variant="danger"] {
425
+ background: transparent;
426
+ border-color: var(--m-danger);
427
+ color: var(--m-danger);
428
+ }
429
+ .m-button[data-variant="danger"]:hover {
430
+ background: var(--m-danger-soft);
431
+ }
432
+ .m-button[data-size="sm"] {
433
+ min-height: calc(var(--m-control-h) - 8px);
434
+ }
435
+ .m-button[data-size="lg"] {
436
+ min-height: calc(var(--m-control-h) + 8px);
437
+ }
438
+ .m-button[data-icon-only] {
439
+ padding: 0;
440
+ min-width: var(--m-control-h);
441
+ }
442
+ .m-button:disabled,
443
+ .m-button[aria-disabled="true"] {
444
+ background: var(--m-surface-disabled);
445
+ border-color: var(--m-border);
446
+ color: var(--m-text-subtle);
447
+ cursor: not-allowed;
448
+ }
449
+ .m-button[aria-busy="true"] {
450
+ cursor: progress;
451
+ }
452
+
453
+ /* Input, Textarea, Select */
454
+ .m-input {
455
+ width: 100%;
456
+ padding: 0 var(--m-control-pad-x);
457
+ border: 1px solid var(--m-border-strong);
458
+ background: var(--m-surface);
459
+ color: var(--m-text);
460
+ }
461
+ .m-input::placeholder {
462
+ color: var(--m-placeholder);
463
+ }
464
+ .m-input:disabled {
465
+ background: var(--m-surface-disabled);
466
+ color: var(--m-text-subtle);
467
+ cursor: not-allowed;
468
+ }
469
+ .m-input[aria-invalid="true"] {
470
+ border-color: var(--m-danger);
471
+ }
472
+ .m-textarea {
473
+ min-height: calc(var(--m-control-h) * 2.5);
474
+ padding-block: var(--m-space-2);
475
+ resize: vertical;
476
+ }
477
+
478
+ /* Checkbox */
479
+ .m-checkbox {
480
+ display: inline-flex;
481
+ align-items: center;
482
+ gap: var(--m-control-gap);
483
+ min-height: var(--m-control-h);
484
+ font-size: var(--m-control-fs);
485
+ color: var(--m-text);
486
+ }
487
+ .m-checkbox input {
488
+ inline-size: 1.15em;
489
+ block-size: 1.15em;
490
+ margin: 0;
491
+ accent-color: var(--m-accent);
492
+ }
493
+
494
+ /* Switch */
495
+ .m-switch {
496
+ position: relative;
497
+ flex: none;
498
+ inline-size: 2.75rem;
499
+ block-size: 1.5rem;
500
+ padding: 0;
501
+ border: 1px solid var(--m-border-strong);
502
+ border-radius: var(--m-radius-pill);
503
+ background: var(--m-surface-soft);
504
+ cursor: pointer;
505
+ transition: background var(--m-duration-fast) var(--m-ease);
506
+ }
507
+ .m-switch::after {
508
+ content: "";
509
+ position: absolute;
510
+ inset-block-start: 50%;
511
+ inset-inline-start: 3px;
512
+ inline-size: 1.05rem;
513
+ block-size: 1.05rem;
514
+ border-radius: 50%;
515
+ background: var(--m-text-muted);
516
+ transform: translateY(-50%);
517
+ transition: transform var(--m-duration-fast) var(--m-ease);
518
+ }
519
+ .m-switch[aria-checked="true"] {
520
+ background: var(--m-accent);
521
+ border-color: transparent;
522
+ }
523
+ .m-switch[aria-checked="true"]::after {
524
+ background: var(--m-accent-on);
525
+ transform: translate(1.25rem, -50%);
526
+ }
527
+ .m-switch:disabled {
528
+ background: var(--m-surface-disabled);
529
+ cursor: not-allowed;
530
+ }
531
+
532
+ /* Badge */
533
+ .m-badge {
534
+ display: inline-flex;
535
+ align-items: center;
536
+ padding: 0 var(--m-space-2);
537
+ min-height: 1.5em;
538
+ border-radius: var(--m-radius-pill);
539
+ background: var(--m-surface-soft);
540
+ color: var(--m-text-muted);
541
+ font-size: var(--m-fs-sm);
542
+ font-weight: var(--m-fw-semibold);
543
+ }
544
+ .m-badge[data-tone="accent"] {
545
+ background: var(--m-accent-soft);
546
+ color: var(--m-accent-soft-on);
547
+ }
548
+ .m-badge[data-tone="info"] {
549
+ background: var(--m-info-soft);
550
+ color: var(--m-info);
551
+ }
552
+ .m-badge[data-tone="success"] {
553
+ background: var(--m-success-soft);
554
+ color: var(--m-success);
555
+ }
556
+ .m-badge[data-tone="warning"] {
557
+ background: var(--m-warning-soft);
558
+ color: var(--m-warning);
559
+ }
560
+ .m-badge[data-tone="danger"] {
561
+ background: var(--m-danger-soft);
562
+ color: var(--m-danger);
563
+ }
564
+
565
+ /* Input with leading icon */
566
+ .m-input-icon {
567
+ position: relative;
568
+ display: block;
569
+ color: var(--m-text-subtle);
570
+ }
571
+ .m-input-icon > .m-icon {
572
+ position: absolute;
573
+ inset-block: 0;
574
+ inset-inline-start: var(--m-control-pad-x);
575
+ margin-block: auto;
576
+ pointer-events: none;
577
+ }
578
+ .m-input-icon > .m-input {
579
+ padding-inline-start: calc(
580
+ var(--m-control-pad-x) + 18px + var(--m-space-2)
581
+ );
582
+ }
583
+
584
+ /* Avatar */
585
+ .m-avatar {
586
+ --m-avatar-size: 2rem;
587
+ display: inline-flex;
588
+ flex: none;
589
+ align-items: center;
590
+ justify-content: center;
591
+ box-sizing: border-box;
592
+ inline-size: var(--m-avatar-size);
593
+ block-size: var(--m-avatar-size);
594
+ overflow: hidden;
595
+ border-radius: var(--m-radius-pill);
596
+ background: var(--m-accent-soft);
597
+ color: var(--m-accent-soft-on);
598
+ font-size: calc(var(--m-avatar-size) * 0.4);
599
+ font-weight: var(--m-fw-semibold);
600
+ text-transform: uppercase;
601
+ }
602
+ .m-avatar[data-size="sm"] {
603
+ --m-avatar-size: 1.5rem;
604
+ }
605
+ .m-avatar[data-size="lg"] {
606
+ --m-avatar-size: 3rem;
607
+ }
608
+ .m-avatar > img {
609
+ inline-size: 100%;
610
+ block-size: 100%;
611
+ object-fit: cover;
612
+ }
613
+
614
+ /* Banner */
615
+ .m-banner {
616
+ display: grid;
617
+ gap: var(--m-space-1);
618
+ padding: var(--m-space-3) var(--m-space-4);
619
+ border: 1px solid var(--m-border);
620
+ border-inline-start-width: 4px;
621
+ border-radius: var(--m-control-radius);
622
+ background: var(--m-surface-soft);
623
+ color: var(--m-text);
624
+ }
625
+ .m-banner__title {
626
+ font-weight: var(--m-fw-semibold);
627
+ }
628
+ .m-banner[data-tone="info"] {
629
+ border-color: var(--m-info);
630
+ background: var(--m-info-soft);
631
+ }
632
+ .m-banner[data-tone="success"] {
633
+ border-color: var(--m-success);
634
+ background: var(--m-success-soft);
635
+ }
636
+ .m-banner[data-tone="warning"] {
637
+ border-color: var(--m-warning);
638
+ background: var(--m-warning-soft);
639
+ }
640
+ .m-banner[data-tone="danger"] {
641
+ border-color: var(--m-danger);
642
+ background: var(--m-danger-soft);
643
+ }
644
+
645
+ /* Progress */
646
+ .m-progress {
647
+ inline-size: 100%;
648
+ block-size: 0.5rem;
649
+ overflow: hidden;
650
+ border-radius: var(--m-radius-pill);
651
+ background: var(--m-surface-soft);
652
+ }
653
+ .m-progress__bar {
654
+ block-size: 100%;
655
+ inline-size: var(--m-progress, 40%);
656
+ border-radius: inherit;
657
+ background: var(--m-accent);
658
+ transition: inline-size var(--m-duration-fast) var(--m-ease);
659
+ }
660
+ .m-progress:not([aria-valuenow]) .m-progress__bar {
661
+ animation: m-progress-indeterminate 1.4s var(--m-ease) infinite;
662
+ }
663
+ @keyframes m-progress-indeterminate {
664
+ from {
665
+ transform: translateX(-100%);
666
+ }
667
+ to {
668
+ transform: translateX(250%);
669
+ }
670
+ }
671
+
672
+ /* Empty state */
673
+ .m-empty {
674
+ display: grid;
675
+ justify-items: center;
676
+ gap: var(--m-space-2);
677
+ padding: var(--m-space-6);
678
+ text-align: center;
679
+ color: var(--m-text-muted);
680
+ }
681
+ .m-empty__title {
682
+ color: var(--m-text);
683
+ font-weight: var(--m-fw-semibold);
684
+ }
685
+
686
+ /* Card */
687
+ .m-card {
688
+ box-sizing: border-box;
689
+ border: 1px solid var(--m-border);
690
+ border-radius: calc(var(--m-control-radius) + 4px);
691
+ background: var(--m-surface);
692
+ color: var(--m-text);
693
+ box-shadow: var(--m-shadow-sm);
694
+ }
695
+ .m-card[data-padded] {
696
+ padding: var(--m-space-4);
697
+ }
698
+
699
+ /* Tabs */
700
+ .m-tablist {
701
+ display: flex;
702
+ gap: var(--m-space-1);
703
+ border-bottom: 1px solid var(--m-border);
704
+ }
705
+ .m-tab {
706
+ min-height: var(--m-control-h);
707
+ padding: 0 var(--m-control-pad-x);
708
+ border: 0;
709
+ border-bottom: 2px solid transparent;
710
+ background: transparent;
711
+ color: var(--m-text-muted);
712
+ font: inherit;
713
+ font-size: var(--m-control-fs);
714
+ cursor: pointer;
715
+ }
716
+ .m-tab[aria-selected="true"] {
717
+ border-bottom-color: var(--m-accent);
718
+ color: var(--m-text);
719
+ font-weight: var(--m-fw-semibold);
720
+ }
721
+ .m-tab:disabled {
722
+ color: var(--m-text-subtle);
723
+ cursor: not-allowed;
724
+ }
725
+ .m-tabpanel {
726
+ padding-block: var(--m-space-4);
727
+ }
728
+
729
+ /* Dialog */
730
+ .m-dialog {
731
+ max-inline-size: min(32rem, calc(100vw - 2rem));
732
+ padding: 0;
733
+ border: 1px solid var(--m-border);
734
+ border-radius: var(--m-radius-lg);
735
+ background: var(--m-surface-raised);
736
+ color: var(--m-text);
737
+ box-shadow: var(--m-shadow-lg);
738
+ }
739
+ .m-dialog::backdrop {
740
+ background: var(--m-overlay);
741
+ }
742
+ .m-dialog__header {
743
+ display: flex;
744
+ align-items: center;
745
+ justify-content: space-between;
746
+ gap: var(--m-space-4);
747
+ padding: var(--m-space-4) var(--m-space-5);
748
+ border-bottom: 1px solid var(--m-border);
749
+ }
750
+ .m-dialog__title {
751
+ margin: 0;
752
+ font-size: var(--m-fs-lg);
753
+ }
754
+ .m-dialog__body {
755
+ padding: var(--m-space-5);
756
+ }
757
+ .m-dialog__footer {
758
+ display: flex;
759
+ justify-content: flex-end;
760
+ gap: var(--m-space-2);
761
+ padding: var(--m-space-4) var(--m-space-5);
762
+ border-top: 1px solid var(--m-border);
763
+ }
764
+
765
+ /* Tooltip */
766
+ .m-tooltip-wrap {
767
+ position: relative;
768
+ display: inline-flex;
769
+ }
770
+ .m-tooltip {
771
+ position: absolute;
772
+ inset-block-end: calc(100% + 6px);
773
+ inset-inline-start: 50%;
774
+ z-index: 10;
775
+ padding: var(--m-space-1) var(--m-space-2);
776
+ border-radius: var(--m-radius-sm);
777
+ background: var(--m-text);
778
+ color: var(--m-bg);
779
+ font-size: var(--m-fs-sm);
780
+ white-space: nowrap;
781
+ transform: translateX(-50%);
782
+ }
783
+ .m-tooltip[hidden] {
784
+ display: none;
785
+ }
786
+
787
+ /* Menu */
788
+ .m-menu-wrap {
789
+ position: relative;
790
+ display: inline-flex;
791
+ }
792
+ .m-menu {
793
+ position: absolute;
794
+ inset-block-start: calc(100% + 4px);
795
+ inset-inline-start: 0;
796
+ z-index: 10;
797
+ display: flex;
798
+ flex-direction: column;
799
+ min-inline-size: 10rem;
800
+ padding: var(--m-space-1);
801
+ border: 1px solid var(--m-border);
802
+ border-radius: var(--m-control-radius);
803
+ background: var(--m-surface-raised);
804
+ box-shadow: var(--m-shadow-md);
805
+ }
806
+ .m-menu[hidden] {
807
+ display: none;
808
+ }
809
+ .m-menu__item {
810
+ min-height: var(--m-control-h);
811
+ padding: 0 var(--m-control-pad-x);
812
+ border: 0;
813
+ border-radius: var(--m-radius-xs);
814
+ background: transparent;
815
+ color: var(--m-text);
816
+ font: inherit;
817
+ font-size: var(--m-control-fs);
818
+ text-align: start;
819
+ cursor: pointer;
820
+ }
821
+ .m-menu__item:hover,
822
+ .m-menu__item:focus-visible {
823
+ background: var(--m-surface-hover);
824
+ }
825
+ .m-menu__item:disabled {
826
+ color: var(--m-text-subtle);
827
+ cursor: not-allowed;
828
+ }
829
+
830
+ /* Icon */
831
+ .m-icon {
832
+ display: block;
833
+ flex: none;
834
+ }
835
+
836
+ /* Shared focus ring */
837
+ :is(
838
+ .m-button,
839
+ .m-input,
840
+ .m-checkbox input,
841
+ .m-switch,
842
+ .m-tab,
843
+ .m-menu__item,
844
+ .m-dialog
845
+ ):focus-visible {
846
+ outline: 2px solid var(--m-focus);
847
+ outline-offset: 2px;
848
+ }
849
+
850
+ @media (prefers-reduced-motion: reduce) {
851
+ .m-progress__bar {
852
+ transition: none;
853
+ animation: none !important;
854
+ }
855
+ .m-button,
856
+ .m-switch,
857
+ .m-switch::after {
858
+ transition: none;
859
+ }
860
+ }
861
+ }
@@ -0,0 +1 @@
1
+ (function(){try{var e=document.documentElement,s=localStorage;['theme','color-mode','density'].forEach(function(k){var v=s.getItem('matter-'+k);if(v)e.setAttribute('data-'+k,v)})}catch(_){}})();
package/package.json CHANGED
@@ -1,6 +1,38 @@
1
1
  {
2
2
  "name": "@interstellarforge/matter-css",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "license": "MIT",
5
+ "description": "Matter CSS distribution: token stylesheet and the no-flash theme init script. Framework-agnostic.",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/interstellarforge/matter.git",
9
+ "directory": "packages/css"
10
+ },
11
+ "type": "module",
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ },
20
+ "./matter.css": "./dist/matter.css",
21
+ "./theme-init.js": "./dist/theme-init.js"
22
+ },
23
+ "publishConfig": {
24
+ "registry": "https://registry.npmjs.org/",
25
+ "access": "public",
26
+ "provenance": true
27
+ },
28
+ "dependencies": {
29
+ "@interstellarforge/matter-tokens": "0.1.0"
30
+ },
31
+ "devDependencies": {
32
+ "vitest": "4.1.6"
33
+ },
34
+ "scripts": {
35
+ "build": "node src/build.ts",
36
+ "test": "vitest run"
37
+ }
6
38
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.