skcr-design-tokens 2.1.0 → 2.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/README.md +21 -1
- package/components.css +13 -1
- package/display.css +12 -12
- package/package.json +1 -1
- package/tokens.css +18 -17
package/README.md
CHANGED
|
@@ -62,6 +62,26 @@ Angular applications then use `skcr-autechre`'s `ThemeService` for toggling and
|
|
|
62
62
|
cross-tab synchronization. It does not do the initialization: the script above
|
|
63
63
|
has already done it.
|
|
64
64
|
|
|
65
|
+
## Upgrading to 2.2.0
|
|
66
|
+
|
|
67
|
+
Two classes added, nothing changes for existing screens: **`.badge-success`** and
|
|
68
|
+
**`.badge-info`**, the design's count badges (« Filters 2 », « Columns 7 », the selected metrics of
|
|
69
|
+
a group). A status pair — `success-foreground` / `success`, `info-foreground` / `info` — so the
|
|
70
|
+
same light pill in both themes, its text in the status colour. They replace the pills the
|
|
71
|
+
applications wrote by hand (`px-2 py-0.5 rounded-lg bg-success-foreground text-success`).
|
|
72
|
+
|
|
73
|
+
## Upgrading to 2.1.1
|
|
74
|
+
|
|
75
|
+
One rendering change, aligned on the design's screens: `.btn` takes `shadow-xs` instead of
|
|
76
|
+
`shadow-sm`. The comments of `field`, `control`, `track`, `elevated` and `scrim` follow
|
|
77
|
+
`skcr-autechre` 5.3.3, which stops using `field` and `elevated`: fields, wells and the active tab
|
|
78
|
+
move to `card`, the switch thumb to `control`.
|
|
79
|
+
|
|
80
|
+
`display.css` follows the same screens: `.input` on `card` (disabled on `background`); `.switch`
|
|
81
|
+
rail on `border-color`, thumb on `control` in both states; `.segmented` and `.chip` on `control`,
|
|
82
|
+
like the design's toggles; `.modal-backdrop` at 15 % with a blur, `.modal-panel` on `popover` with
|
|
83
|
+
`shadow-lg`.
|
|
84
|
+
|
|
65
85
|
## Upgrading to 2.1.0
|
|
66
86
|
|
|
67
87
|
The two neutral badges follow the design's "secondary" badge (2026-10-01). No class is added or
|
|
@@ -140,7 +160,7 @@ Three categories do not move up here, deliberately:
|
|
|
140
160
|
A distinction to know before writing a class, because ignoring it produces a
|
|
141
161
|
defect that is invisible in the light theme.
|
|
142
162
|
|
|
143
|
-
A **zone** token describes a surface: `card`, `popover`, `muted`, `track`, `field` (the well of a control), `control` (
|
|
163
|
+
A **zone** token describes a surface: `card`, `popover`, `muted`, `track`, `field` (the former well of a control, unused by the library since 5.3.3), `control` (raised one notch above the card in dark: tables, the switch thumb, toggles — fields, wells and buttons stay on `card`). A
|
|
144
164
|
**state** token describes what happens to a surface when you interact with it:
|
|
145
165
|
`hover` for hovering, `primary-subtle` for selection, `disabled`.
|
|
146
166
|
|
package/components.css
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.btn {
|
|
52
|
-
@apply rounded-md leading-5 shadow-
|
|
52
|
+
@apply rounded-md leading-5 shadow-xs items-center flex gap-1 justify-center py-2 px-3 max-w-sm text-body-small outline-1 -outline-offset-1 outline-border-color focus:outline-2 focus:-outline-offset-2 font-medium relative overflow-hidden z-0 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50;
|
|
53
53
|
|
|
54
54
|
&.btn-large {
|
|
55
55
|
@apply px-4 py-2.5;
|
|
@@ -79,6 +79,8 @@
|
|
|
79
79
|
@apply bg-primary text-primary-foreground hover:bg-primary-hover focus:outline-primary;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
/* `card`, like the outline buttons of the design's screens (slate-900 in dark): the button
|
|
83
|
+
sits at the level of its card and stands out by its border. */
|
|
82
84
|
&.btn-neutral {
|
|
83
85
|
@apply bg-card hover:bg-hover;
|
|
84
86
|
}
|
|
@@ -136,6 +138,16 @@
|
|
|
136
138
|
@apply border-primary-300 bg-primary-100;
|
|
137
139
|
}
|
|
138
140
|
|
|
141
|
+
/* 2.2.0: the design's count badges (Filters, Columns, the metric groups) — a status pair, so
|
|
142
|
+
the same light pill in both themes, its text in the status colour rather than slate-950. */
|
|
143
|
+
&.badge-success {
|
|
144
|
+
@apply bg-success-foreground text-success;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&.badge-info {
|
|
148
|
+
@apply bg-info-foreground text-info;
|
|
149
|
+
}
|
|
150
|
+
|
|
139
151
|
&.badge-green {
|
|
140
152
|
@apply border-green-300 bg-green-100;
|
|
141
153
|
}
|
package/display.css
CHANGED
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
/* The chip FILTERS (round, clickable, active state); the core `.badge`
|
|
289
289
|
QUALIFIES (status, non-interactive). Two objects, two classes. */
|
|
290
290
|
.chip {
|
|
291
|
-
@apply inline-flex items-center gap-1.5 rounded-full border border-border-color bg-
|
|
291
|
+
@apply inline-flex items-center gap-1.5 rounded-full border border-border-color bg-control px-2.5 py-0.5 text-caption font-medium text-foreground cursor-pointer hover:bg-hover;
|
|
292
292
|
|
|
293
293
|
&.active {
|
|
294
294
|
@apply bg-primary-subtle text-primary-subtle-foreground border-transparent;
|
|
@@ -314,20 +314,20 @@
|
|
|
314
314
|
@apply block text-caption text-muted-foreground mt-1;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
/* Vanilla input field
|
|
318
|
-
Angular projects prefer `skcr-input`. */
|
|
317
|
+
/* Vanilla input field: `card` like `skcr-input` since 5.3.3, border `input`, disabled on
|
|
318
|
+
`background`. Angular projects prefer `skcr-input`. */
|
|
319
319
|
.input {
|
|
320
|
-
@apply block w-full rounded-md border border-input bg-
|
|
320
|
+
@apply block w-full rounded-md border border-input bg-card text-foreground px-3 py-2 text-body-small placeholder:text-muted-foreground focus:outline-2 focus:-outline-offset-1 focus:outline-primary disabled:bg-background disabled:cursor-not-allowed;
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
.input-sm {
|
|
324
324
|
@apply px-2 py-1 text-caption;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
/* Switch with a hidden checkbox: the state is `:checked
|
|
328
|
-
`
|
|
327
|
+
/* Switch with a hidden checkbox: the state is `:checked`. Rail `border-color` when off, thumb
|
|
328
|
+
`control` in both states — the values of the design and of `skcr-checkbox`. */
|
|
329
329
|
.switch {
|
|
330
|
-
@apply relative inline-flex w-10 h-[22px] rounded-full bg-
|
|
330
|
+
@apply relative inline-flex w-10 h-[22px] rounded-full bg-border-color border border-border-color cursor-pointer align-middle;
|
|
331
331
|
|
|
332
332
|
& input {
|
|
333
333
|
@apply absolute inset-0 opacity-0 m-0 cursor-pointer;
|
|
@@ -343,11 +343,11 @@
|
|
|
343
343
|
}
|
|
344
344
|
|
|
345
345
|
.switch-thumb {
|
|
346
|
-
@apply absolute top-0.5 left-0.5 size-4 rounded-full bg-
|
|
346
|
+
@apply absolute top-0.5 left-0.5 size-4 rounded-full bg-control shadow transition-transform motion-reduce:transition-none;
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
.switch input:checked ~ .switch-thumb {
|
|
350
|
-
@apply translate-x-[18px]
|
|
350
|
+
@apply translate-x-[18px];
|
|
351
351
|
}
|
|
352
352
|
|
|
353
353
|
/* Compact exclusive choice. The application puts `.active` or
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
@apply inline-flex rounded-md border border-border-color overflow-hidden text-caption;
|
|
357
357
|
|
|
358
358
|
& > * {
|
|
359
|
-
@apply px-3 py-1.5 bg-
|
|
359
|
+
@apply px-3 py-1.5 bg-control text-muted-foreground border-l border-border-color first:border-l-0 cursor-pointer hover:bg-hover hover:text-foreground;
|
|
360
360
|
}
|
|
361
361
|
|
|
362
362
|
& > .active,
|
|
@@ -516,11 +516,11 @@
|
|
|
516
516
|
themes. Opening and closing stay with the JS — or with the native
|
|
517
517
|
`<dialog>`, which nothing stops you from dressing with these classes. */
|
|
518
518
|
.modal-backdrop {
|
|
519
|
-
@apply fixed inset-0 z-50 flex items-center justify-center bg-scrim/
|
|
519
|
+
@apply fixed inset-0 z-50 flex items-center justify-center bg-scrim/15 backdrop-blur-xs p-4;
|
|
520
520
|
}
|
|
521
521
|
|
|
522
522
|
.modal-panel {
|
|
523
|
-
@apply flex flex-col w-full max-w-lg max-h-[90vh] rounded-lg border border-border-color bg-
|
|
523
|
+
@apply flex flex-col w-full max-w-lg max-h-[90vh] rounded-lg border border-border-color bg-popover text-popover-foreground shadow-lg;
|
|
524
524
|
}
|
|
525
525
|
|
|
526
526
|
.modal-header {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skcr-design-tokens",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Design system SkillCorner : tokens de couleur, utilitaires typographiques et classes de composants. CSS pur, sans dépendance.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"sideEffects": [
|
package/tokens.css
CHANGED
|
@@ -81,25 +81,25 @@
|
|
|
81
81
|
/* Background of a disabled control. Distinct from `muted`, which is a zone
|
|
82
82
|
background: the two values are close in light but diverge in dark. */
|
|
83
83
|
--color-disabled: theme(colors.slate.50);
|
|
84
|
-
/* Well of a control
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
/* Well of a control. No longer used by the library since 5.3.3: the radio, the checkbox and the
|
|
85
|
+
fields moved to `card`, the value of the design's screens (slate-900 in dark, where `field`
|
|
86
|
+
painted them near black). Kept for the applications that write it. */
|
|
87
87
|
--color-field: theme(colors.white);
|
|
88
|
-
/* Surface
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
/* Surface raised one notch above the card in dark (slate-800 on slate-900): tables (header,
|
|
89
|
+
rows, fixed columns), the switch thumb, `display.css`'s `.chip` and `.segmented`. White like
|
|
90
|
+
the card in light. Fields, wells, the active tab and `.btn-neutral` are NOT on it: on the
|
|
91
|
+
design's screens they keep the card value and stand out by their border — a field on a card
|
|
92
|
+
has the card's background (1.00) and only its `input` edge (1.72 against it in dark); in a
|
|
93
|
+
modal (`popover`, slate-800) it reads as a darker well (1.22), edge included. */
|
|
93
94
|
--color-control: theme(colors.white);
|
|
94
|
-
/* Track background: tab container, unselected tab
|
|
95
|
-
|
|
95
|
+
/* Track background: tab container, unselected tab. One notch stronger than `muted`, which
|
|
96
|
+
is a zone background. The rail of an unchecked switch takes `border-color`, as in the
|
|
97
|
+
design. Known shortfall in dark: the active tab (`card`, slate-900) reads at 1.22 against it,
|
|
98
|
+
the value of the design's screens; its label and a `shadow-xs` carry the rest. */
|
|
96
99
|
--color-track: theme(colors.slate.200);
|
|
97
|
-
/*
|
|
98
|
-
thumb
|
|
99
|
-
|
|
100
|
-
background of a field. In light it is white, like the page background; in dark it
|
|
101
|
-
is darker than its track (slate-950 on slate-800), the value of the design: the active
|
|
102
|
-
segment reads as pressed in rather than raised. Known shortfall: 1.38 against the track. */
|
|
100
|
+
/* No longer used by the library's components since 5.3.3: the active tab moved to `card`, the
|
|
101
|
+
switch thumb to `control`, the checked radio to a primary dot. The design keeps the token
|
|
102
|
+
(text on primary); it stays for the applications that write it. */
|
|
103
103
|
--color-elevated: theme(colors.white);
|
|
104
104
|
/* A STATE surface, not a zone one: the hover, and the option highlighted from the
|
|
105
105
|
keyboard. It has its own token because its direction flips with the theme —
|
|
@@ -108,7 +108,8 @@
|
|
|
108
108
|
`hover:bg-muted` was strictly invisible there. */
|
|
109
109
|
--color-hover: theme(colors.slate.100);
|
|
110
110
|
/* Modal scrim. The only token that does not invert: slate-500 in both themes, applied at
|
|
111
|
-
|
|
111
|
+
15 % opacity and blurred by `skcr-dialog` — the weight of the design's screens (a 15 %
|
|
112
|
+
veil), where 75 % darkened the page far more. */
|
|
112
113
|
--color-scrim: theme(colors.slate.500);
|
|
113
114
|
|
|
114
115
|
/* Status colors */
|