skcr-design-tokens 2.0.0 → 2.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/README.md +35 -10
- package/components.css +38 -12
- package/package.json +1 -1
- package/tokens.css +3 -0
package/README.md
CHANGED
|
@@ -62,6 +62,29 @@ 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.1.0
|
|
66
|
+
|
|
67
|
+
The two neutral badges follow the design's "secondary" badge (2026-10-01). No class is added or
|
|
68
|
+
removed; two of them look different.
|
|
69
|
+
|
|
70
|
+
- **`.badge`** (no color class, the design's "secondary / light"): background
|
|
71
|
+
`neutral-foreground` (slate-100, as before), text `neutral` (slate-700 instead of slate-950).
|
|
72
|
+
- **`.badge-strong-slate`** (the design's "secondary / strong") inverts: background `neutral`
|
|
73
|
+
(slate-700 instead of slate-200), text `neutral-foreground` (slate-100). Check the screens that
|
|
74
|
+
use it: a light pill becomes a dark one.
|
|
75
|
+
- The colored variants (`badge-white`, `badge-green`, `badge-strong-red`…) keep their slate-950
|
|
76
|
+
text.
|
|
77
|
+
|
|
78
|
+
`neutral` and `neutral-foreground` keep the same value in both themes, so these badges still do
|
|
79
|
+
not invert in dark. What a badge contains now inherits the badge's text color instead of being
|
|
80
|
+
forced to slate-950: a class put on the child still wins.
|
|
81
|
+
|
|
82
|
+
## Upgrading to 2.0.1
|
|
83
|
+
|
|
84
|
+
Nothing to do. `--color-destructive-hover` gets its dark value, red-400: left on the light
|
|
85
|
+
red-800, the hover of `.btn-danger` darkened a red-500 button instead of lightening it, as every
|
|
86
|
+
other action color does in dark.
|
|
87
|
+
|
|
65
88
|
## Upgrading to 2.0.0
|
|
66
89
|
|
|
67
90
|
The dark theme is recalibrated on the design (2026-09), and a few light values move with it. No
|
|
@@ -72,7 +95,7 @@ class disappears; what changes is how screens look, hence the major.
|
|
|
72
95
|
name for name, the page would have turned white.
|
|
73
96
|
|
|
74
97
|
- **Light:** `muted-foreground` back to slate-500 (4.35 on `muted` and `background`, under AA —
|
|
75
|
-
kept by design decision), `chart-6` from gray to slate. Everything else is unchanged.
|
|
98
|
+
kept by design decision), `chart-6`, `chart-6-accent` and `chart-6-foreground` from gray to slate. Everything else is unchanged.
|
|
76
99
|
- **Dark:** `muted` zones sink to the page value (slate-950); `control` sits one notch above the
|
|
77
100
|
card (slate-800); `muted-foreground`, `subtitle` and `border-color` lighten; `disabled` becomes
|
|
78
101
|
gray-900; `elevated` goes below its track (slate-950); the scrim is slate-500 in both themes;
|
|
@@ -80,21 +103,21 @@ name for name, the page would have turned white.
|
|
|
80
103
|
- **The percentile surfaces no longer invert.** `--color-chart-*-foreground` stay light in dark.
|
|
81
104
|
Text the theme colours (`foreground`, `muted-foreground`…) becomes light on light on them: move
|
|
82
105
|
that text to the new tokens **before** taking 2.0.0.
|
|
83
|
-
- **New tokens:** `--color-
|
|
84
|
-
`--color-data-foreground
|
|
85
|
-
|
|
106
|
+
- **New tokens:** `--color-data-foreground`, `--color-data-primary-foreground`,
|
|
107
|
+
`--color-data-muted-foreground` — text set directly on a data color, same value in both themes.
|
|
108
|
+
(`--color-control` exists since 1.6.0; 2.0.0 only gives it its own dark value.)
|
|
86
109
|
- **Known contrast shortfalls** are kept by design decision and stated next to each token in
|
|
87
110
|
`tokens.css` (statuses as text on dark surfaces, `neutral`, `destructive-foreground`, the
|
|
88
111
|
`data-*` on some chart colors, `input` and `elevated` as boundaries).
|
|
89
112
|
|
|
90
|
-
`skcr-autechre`
|
|
113
|
+
`skcr-autechre` accepts `^1.6.0 || ^2.0.0` since 5.2.0: an application can take the library first and
|
|
91
114
|
move to 2.0.0 once its text on data colors is migrated.
|
|
92
115
|
|
|
93
116
|
## Contents
|
|
94
117
|
|
|
95
118
|
| Entry | Contents |
|
|
96
119
|
| --- | --- |
|
|
97
|
-
| `tokens.css` | `@theme` block: primary,
|
|
120
|
+
| `tokens.css` | `@theme` block: primary, surface and state roles, status, tooltip and dataviz (`chart-*`, `data-*`) colors, and font families; plus the `:root[data-theme='dark']` overrides |
|
|
98
121
|
| `utilities.css` | `text-body-*`, `text-caption`, `info-caption`, `title-one` to `title-five` |
|
|
99
122
|
| `components.css` | `.btn` family, `.badge` family, `.link`, `.step-number`, hover tooltip, scrollbar utilities, Angular Material date-picker fix |
|
|
100
123
|
| `display.css` | **Opt-in.** Presentation classes. No platform application imports it. |
|
|
@@ -128,15 +151,17 @@ and **lightens** on a dark one. A zone has an absolute value. The real case:
|
|
|
128
151
|
`muted` was exactly equal to `popover` in dark, and every `hover:bg-muted` on a
|
|
129
152
|
menu was strictly invisible — a contrast ratio of 1.00.
|
|
130
153
|
|
|
131
|
-
The three states
|
|
154
|
+
The three states, measured on a popover:
|
|
132
155
|
|
|
133
156
|
| On a popover | rest | `hover` | `primary-subtle` |
|
|
134
157
|
| --- | --- | --- | --- |
|
|
135
|
-
| light | 1.00 | 1.10 | 1.
|
|
158
|
+
| light | 1.00 | 1.10 | 1.04 |
|
|
136
159
|
| dark | 1.00 | 1.41 | 2.05 |
|
|
137
160
|
|
|
138
|
-
|
|
139
|
-
|
|
161
|
+
In dark, selection is more pronounced than hover. In light it is told apart by its
|
|
162
|
+
hue (green against grey), not by its weight — see the `primary-subtle` comment in
|
|
163
|
+
`tokens.css`. If you add a state, measure it against the surface that carries it,
|
|
164
|
+
not in the absolute.
|
|
140
165
|
|
|
141
166
|
## Extension rules
|
|
142
167
|
|
package/components.css
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
The `.badge` family, on the other hand, keeps its raw hues, and that is
|
|
19
19
|
deliberate: `badge-purple` is purple by definition, not by role. Its pills are
|
|
20
20
|
light backgrounds with dark text, which stays readable on a dark interface.
|
|
21
|
+
The two neutral badges are the exception since 2.1.0: the default `.badge`
|
|
22
|
+
(the design's "secondary / light") and `.badge-strong-slate` ("secondary /
|
|
23
|
+
strong") are written in `neutral` / `neutral-foreground`, two roles that keep
|
|
24
|
+
the same value in both themes.
|
|
21
25
|
|
|
22
26
|
`.badge` takes gaffer's variant, the only one actually in use — 38 usages. The
|
|
23
27
|
discarded variant carried `dark:` classes which would not have responded to
|
|
@@ -89,15 +93,36 @@
|
|
|
89
93
|
}
|
|
90
94
|
|
|
91
95
|
.badge {
|
|
92
|
-
@apply inline-flex items-center justify-center gap-0.5 rounded-lg border border-transparent bg-
|
|
93
|
-
|
|
94
|
-
/* The badge does NOT follow the theme: its
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
@apply inline-flex items-center justify-center gap-0.5 rounded-lg border border-transparent bg-neutral-foreground px-2 py-0.5 text-xs leading-4 font-medium text-neutral;
|
|
97
|
+
|
|
98
|
+
/* The badge does NOT follow the theme: its colors are the same in both. What it
|
|
99
|
+
contains has to keep the badge's text color. Without this rule, the reset of an
|
|
100
|
+
application that colors h1-h6, p or span takes over again inside the badge and
|
|
101
|
+
repaints the text light there — so light on light, measured at 1.04 on gaffer's
|
|
102
|
+
environment label. `inherit` rather than a color: each variant sets the badge's
|
|
103
|
+
own text once, the content follows. `:where()` keeps the specificity of the
|
|
104
|
+
descendant part at zero: a class put on the child always wins. */
|
|
100
105
|
& :where(*) {
|
|
106
|
+
color: inherit;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* The colored variants keep their slate-950 text: only the two neutral badges
|
|
110
|
+
moved to `neutral` in 2.1.0. */
|
|
111
|
+
&:is(
|
|
112
|
+
.badge-white,
|
|
113
|
+
.badge-primary,
|
|
114
|
+
.badge-green,
|
|
115
|
+
.badge-yellow,
|
|
116
|
+
.badge-orange,
|
|
117
|
+
.badge-destructive,
|
|
118
|
+
.badge-blue,
|
|
119
|
+
.badge-purple,
|
|
120
|
+
.badge-pink,
|
|
121
|
+
.badge-cyan,
|
|
122
|
+
.badge-strong-yellow,
|
|
123
|
+
.badge-strong-orange,
|
|
124
|
+
.badge-strong-red
|
|
125
|
+
) {
|
|
101
126
|
@apply text-slate-950;
|
|
102
127
|
}
|
|
103
128
|
|
|
@@ -155,8 +180,9 @@
|
|
|
155
180
|
@apply bg-red-300;
|
|
156
181
|
}
|
|
157
182
|
|
|
183
|
+
/* The design's "secondary / strong": the default badge inverted. */
|
|
158
184
|
&.badge-strong-slate {
|
|
159
|
-
@apply bg-
|
|
185
|
+
@apply bg-neutral text-neutral-foreground;
|
|
160
186
|
}
|
|
161
187
|
}
|
|
162
188
|
|
|
@@ -243,9 +269,9 @@
|
|
|
243
269
|
arbitration.
|
|
244
270
|
|
|
245
271
|
Inert for an application that displays no Material component: neither orion
|
|
246
|
-
nor gaffer imports Material directly. gaffer, on the other hand,
|
|
247
|
-
`skcr-datetime-picker` without this recipe — so that picker
|
|
248
|
-
|
|
272
|
+
nor gaffer imports Material directly. gaffer, on the other hand, displayed a
|
|
273
|
+
`skcr-datetime-picker` without this recipe — so that picker rendered blue
|
|
274
|
+
until this redirection shipped in the package.
|
|
249
275
|
--------------------------------------------------------------------------- */
|
|
250
276
|
:root {
|
|
251
277
|
--mat-sys-primary: var(--color-primary);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skcr-design-tokens",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.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
|
@@ -227,6 +227,9 @@
|
|
|
227
227
|
text-warning 2.80, text-success 2.96, text-neutral 1.41, text-destructive 3.84; and
|
|
228
228
|
destructive-foreground on destructive 3.12. */
|
|
229
229
|
--color-destructive: #ef4444; /* red-500 */
|
|
230
|
+
/* Its hover lightens, as every action color's does in dark. Left on the light value
|
|
231
|
+
(red-800), it darkened the red-500 button instead. destructive-foreground on it: 2.26. */
|
|
232
|
+
--color-destructive-hover: #f87171; /* red-400 */
|
|
230
233
|
|
|
231
234
|
/* The tooltip inverts: dark on light, it would no longer stand out from an
|
|
232
235
|
already dark interface. */
|