@akcelik/strct 0.7.1 → 0.8.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/fesm2022/akcelik-strct.mjs +77 -34
- package/fesm2022/akcelik-strct.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/_base.scss +8 -0
- package/styles/_tokens.scss +45 -23
- package/types/akcelik-strct.d.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akcelik/strct",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "UIStruct — a standalone Angular component library with a tokenised, multi-palette theme system, built for datacenter / infrastructure management UIs.",
|
|
5
5
|
"author": "Serkan Akcelik <serkan.akcelik@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
package/styles/_base.scss
CHANGED
|
@@ -62,6 +62,14 @@ kbd,
|
|
|
62
62
|
outline-offset: 2px;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
// Stronger, fully-opaque focus ring when the OS asks for more contrast.
|
|
66
|
+
@media (prefers-contrast: more) {
|
|
67
|
+
:focus-visible {
|
|
68
|
+
outline: 3px solid var(--acc);
|
|
69
|
+
outline-offset: 2px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
65
73
|
@media (prefers-reduced-motion: reduce) {
|
|
66
74
|
*,
|
|
67
75
|
*::before,
|
package/styles/_tokens.scss
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
--b3: rgba(255, 255, 255, 0.14);
|
|
29
29
|
--t1: rgba(255, 255, 255, 0.9);
|
|
30
30
|
--t2: rgba(255, 255, 255, 0.52);
|
|
31
|
-
--t3: rgba(255, 255, 255, 0.
|
|
31
|
+
--t3: rgba(255, 255, 255, 0.47);
|
|
32
32
|
--t4: rgba(255, 255, 255, 0.15);
|
|
33
33
|
--inv: #0e1015;
|
|
34
34
|
--acc: #7b9ec8;
|
|
@@ -61,20 +61,20 @@
|
|
|
61
61
|
--shadow-rest: var(--sh);
|
|
62
62
|
--shadow-elevated: var(--shh);
|
|
63
63
|
--shadow-floating: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--b2);
|
|
64
|
-
--text-xs:
|
|
64
|
+
--text-xs: 12px;
|
|
65
65
|
--text-sm: 12px;
|
|
66
66
|
--text-md: 13px;
|
|
67
67
|
--text-lg: 14px;
|
|
68
68
|
--text-xl: 16px;
|
|
69
69
|
--leading-tight: 1.2;
|
|
70
|
-
--leading-normal: 1.
|
|
70
|
+
--leading-normal: 1.5;
|
|
71
71
|
--leading-loose: 1.6;
|
|
72
72
|
--disabled-opacity: 0.5;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
[data-palette='arctic'][data-theme='light'] {
|
|
76
76
|
--bg-0: #f3f4f6;
|
|
77
|
-
--bg-1: #
|
|
77
|
+
--bg-1: #fbfcfd;
|
|
78
78
|
--bg-2: #f8f9fb;
|
|
79
79
|
--bg-3: #eef0f3;
|
|
80
80
|
--bg-h: #f0f1f4;
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
--b3: rgba(0, 0, 0, 0.15);
|
|
85
85
|
--t1: rgba(0, 0, 0, 0.9);
|
|
86
86
|
--t2: rgba(0, 0, 0, 0.62);
|
|
87
|
-
--t3: rgba(0, 0, 0, 0.
|
|
87
|
+
--t3: rgba(0, 0, 0, 0.55);
|
|
88
88
|
--t4: rgba(0, 0, 0, 0.14);
|
|
89
89
|
--inv: #ffffff;
|
|
90
90
|
--acc: #5a7ea3;
|
|
@@ -117,13 +117,13 @@
|
|
|
117
117
|
--shadow-rest: var(--sh);
|
|
118
118
|
--shadow-elevated: var(--shh);
|
|
119
119
|
--shadow-floating: 0 8px 30px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--b2);
|
|
120
|
-
--text-xs:
|
|
120
|
+
--text-xs: 12px;
|
|
121
121
|
--text-sm: 12px;
|
|
122
122
|
--text-md: 13px;
|
|
123
123
|
--text-lg: 14px;
|
|
124
124
|
--text-xl: 16px;
|
|
125
125
|
--leading-tight: 1.2;
|
|
126
|
-
--leading-normal: 1.
|
|
126
|
+
--leading-normal: 1.5;
|
|
127
127
|
--leading-loose: 1.6;
|
|
128
128
|
--disabled-opacity: 0.5;
|
|
129
129
|
}
|
|
@@ -139,8 +139,8 @@
|
|
|
139
139
|
--b2: rgba(255, 235, 210, 0.09);
|
|
140
140
|
--b3: rgba(255, 235, 210, 0.14);
|
|
141
141
|
--t1: rgba(255, 240, 220, 0.88);
|
|
142
|
-
--t2: rgba(255, 235, 210, 0.
|
|
143
|
-
--t3: rgba(255, 230, 200, 0.
|
|
142
|
+
--t2: rgba(255, 235, 210, 0.59);
|
|
143
|
+
--t3: rgba(255, 230, 200, 0.51);
|
|
144
144
|
--t4: rgba(255, 225, 195, 0.14);
|
|
145
145
|
--inv: #12100d;
|
|
146
146
|
--acc: #c49a6c;
|
|
@@ -173,13 +173,13 @@
|
|
|
173
173
|
--shadow-rest: var(--sh);
|
|
174
174
|
--shadow-elevated: var(--shh);
|
|
175
175
|
--shadow-floating: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--b2);
|
|
176
|
-
--text-xs:
|
|
176
|
+
--text-xs: 12px;
|
|
177
177
|
--text-sm: 12px;
|
|
178
178
|
--text-md: 13px;
|
|
179
179
|
--text-lg: 14px;
|
|
180
180
|
--text-xl: 16px;
|
|
181
181
|
--leading-tight: 1.2;
|
|
182
|
-
--leading-normal: 1.
|
|
182
|
+
--leading-normal: 1.5;
|
|
183
183
|
--leading-loose: 1.6;
|
|
184
184
|
--disabled-opacity: 0.5;
|
|
185
185
|
}
|
|
@@ -195,8 +195,8 @@
|
|
|
195
195
|
--b2: rgba(80, 50, 20, 0.1);
|
|
196
196
|
--b3: rgba(80, 50, 20, 0.16);
|
|
197
197
|
--t1: rgba(50, 35, 20, 0.9);
|
|
198
|
-
--t2: rgba(60, 40, 20, 0.
|
|
199
|
-
--t3: rgba(70, 50, 30, 0.
|
|
198
|
+
--t2: rgba(60, 40, 20, 0.74);
|
|
199
|
+
--t3: rgba(70, 50, 30, 0.7);
|
|
200
200
|
--t4: rgba(80, 55, 30, 0.14);
|
|
201
201
|
--inv: #fdfcfa;
|
|
202
202
|
--acc: #96724e;
|
|
@@ -229,13 +229,13 @@
|
|
|
229
229
|
--shadow-rest: var(--sh);
|
|
230
230
|
--shadow-elevated: var(--shh);
|
|
231
231
|
--shadow-floating: 0 8px 30px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--b2);
|
|
232
|
-
--text-xs:
|
|
232
|
+
--text-xs: 12px;
|
|
233
233
|
--text-sm: 12px;
|
|
234
234
|
--text-md: 13px;
|
|
235
235
|
--text-lg: 14px;
|
|
236
236
|
--text-xl: 16px;
|
|
237
237
|
--leading-tight: 1.2;
|
|
238
|
-
--leading-normal: 1.
|
|
238
|
+
--leading-normal: 1.5;
|
|
239
239
|
--leading-loose: 1.6;
|
|
240
240
|
--disabled-opacity: 0.5;
|
|
241
241
|
}
|
|
@@ -251,8 +251,8 @@
|
|
|
251
251
|
--b2: rgba(210, 240, 225, 0.09);
|
|
252
252
|
--b3: rgba(210, 240, 225, 0.14);
|
|
253
253
|
--t1: rgba(220, 242, 230, 0.88);
|
|
254
|
-
--t2: rgba(210, 235, 220, 0.
|
|
255
|
-
--t3: rgba(200, 228, 215, 0.
|
|
254
|
+
--t2: rgba(210, 235, 220, 0.62);
|
|
255
|
+
--t3: rgba(200, 228, 215, 0.54);
|
|
256
256
|
--t4: rgba(195, 222, 210, 0.14);
|
|
257
257
|
--inv: #0d1210;
|
|
258
258
|
--acc: #7aab90;
|
|
@@ -285,13 +285,13 @@
|
|
|
285
285
|
--shadow-rest: var(--sh);
|
|
286
286
|
--shadow-elevated: var(--shh);
|
|
287
287
|
--shadow-floating: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--b2);
|
|
288
|
-
--text-xs:
|
|
288
|
+
--text-xs: 12px;
|
|
289
289
|
--text-sm: 12px;
|
|
290
290
|
--text-md: 13px;
|
|
291
291
|
--text-lg: 14px;
|
|
292
292
|
--text-xl: 16px;
|
|
293
293
|
--leading-tight: 1.2;
|
|
294
|
-
--leading-normal: 1.
|
|
294
|
+
--leading-normal: 1.5;
|
|
295
295
|
--leading-loose: 1.6;
|
|
296
296
|
--disabled-opacity: 0.5;
|
|
297
297
|
}
|
|
@@ -307,8 +307,8 @@
|
|
|
307
307
|
--b2: rgba(20, 60, 40, 0.1);
|
|
308
308
|
--b3: rgba(20, 60, 40, 0.16);
|
|
309
309
|
--t1: rgba(18, 45, 30, 0.9);
|
|
310
|
-
--t2: rgba(25, 55, 38, 0.
|
|
311
|
-
--t3: rgba(30, 60, 42, 0.
|
|
310
|
+
--t2: rgba(25, 55, 38, 0.76);
|
|
311
|
+
--t3: rgba(30, 60, 42, 0.7);
|
|
312
312
|
--t4: rgba(35, 65, 45, 0.14);
|
|
313
313
|
--inv: #fafcfb;
|
|
314
314
|
--acc: #4e8a68;
|
|
@@ -341,13 +341,35 @@
|
|
|
341
341
|
--shadow-rest: var(--sh);
|
|
342
342
|
--shadow-elevated: var(--shh);
|
|
343
343
|
--shadow-floating: 0 8px 30px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--b2);
|
|
344
|
-
--text-xs:
|
|
344
|
+
--text-xs: 12px;
|
|
345
345
|
--text-sm: 12px;
|
|
346
346
|
--text-md: 13px;
|
|
347
347
|
--text-lg: 14px;
|
|
348
348
|
--text-xl: 16px;
|
|
349
349
|
--leading-tight: 1.2;
|
|
350
|
-
--leading-normal: 1.
|
|
350
|
+
--leading-normal: 1.5;
|
|
351
351
|
--leading-loose: 1.6;
|
|
352
352
|
--disabled-opacity: 0.5;
|
|
353
353
|
}
|
|
354
|
+
|
|
355
|
+
// Honour the OS "increase contrast" preference (low-vision users / bright ambient
|
|
356
|
+
// light): strengthen borders and lift secondary/tertiary text toward primary.
|
|
357
|
+
// Only active when the OS asks, so the default look is untouched. Scoped by
|
|
358
|
+
// [data-palette][data-theme] (equal specificity to the scheme blocks, later in
|
|
359
|
+
// source) so it wins the cascade for every palette.
|
|
360
|
+
@media (prefers-contrast: more) {
|
|
361
|
+
[data-palette][data-theme='dark'] {
|
|
362
|
+
--b1: rgba(255, 255, 255, 0.14);
|
|
363
|
+
--b2: rgba(255, 255, 255, 0.24);
|
|
364
|
+
--b3: rgba(255, 255, 255, 0.36);
|
|
365
|
+
--t2: rgba(255, 255, 255, 0.78);
|
|
366
|
+
--t3: rgba(255, 255, 255, 0.62);
|
|
367
|
+
}
|
|
368
|
+
[data-palette][data-theme='light'] {
|
|
369
|
+
--b1: rgba(0, 0, 0, 0.18);
|
|
370
|
+
--b2: rgba(0, 0, 0, 0.3);
|
|
371
|
+
--b3: rgba(0, 0, 0, 0.42);
|
|
372
|
+
--t2: rgba(0, 0, 0, 0.82);
|
|
373
|
+
--t3: rgba(0, 0, 0, 0.7);
|
|
374
|
+
}
|
|
375
|
+
}
|
package/types/akcelik-strct.d.ts
CHANGED
|
@@ -34,6 +34,12 @@ declare class StrctThemeService {
|
|
|
34
34
|
constructor();
|
|
35
35
|
setPalette(palette: StrctPalette): void;
|
|
36
36
|
setMode(mode: StrctMode): void;
|
|
37
|
+
private applyPalette;
|
|
38
|
+
private applyMode;
|
|
39
|
+
/** The OS-level light/dark preference, or null when matchMedia is unavailable. */
|
|
40
|
+
private systemMode;
|
|
41
|
+
/** Track OS theme changes until the user makes an explicit choice. */
|
|
42
|
+
private watchSystemMode;
|
|
37
43
|
toggleMode(): void;
|
|
38
44
|
private read;
|
|
39
45
|
private write;
|