skcr-design-tokens 2.2.0 → 3.0.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 +34 -0
- package/components.css +97 -61
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,6 +62,40 @@ 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 3.0.0
|
|
66
|
+
|
|
67
|
+
**Breaking: the badges follow the Badge of the Figma library** (« Skillcorner webapp - Library »,
|
|
68
|
+
node 620:965). Every badge changes look, and the palette classes are removed.
|
|
69
|
+
|
|
70
|
+
- **20 px high, no border** but on outline. Up to 2.2.0 `.badge` carried a transparent border, so
|
|
71
|
+
every borderless badge stood 22 px high where the design draws 20. **`.badge-lg`** gives the
|
|
72
|
+
32 px badge (`px-3 py-1.5`, 14/20).
|
|
73
|
+
- **Eleven variants under the Figma's names**, each light (`badge-<variant>`) and strong
|
|
74
|
+
(`badge-strong-<variant>`): `primary`, `secondary` (`.badge` alone is secondary light), `outline`,
|
|
75
|
+
`info`, `warning`, `destructive`, and the data colours `chart-1`, `chart-3`, `chart-4`,
|
|
76
|
+
`chart-5`, `chart-6` for a category rather than a status (there is no chart-2 in the Figma).
|
|
77
|
+
- **Removed, with their replacement** — a search and replace in the templates:
|
|
78
|
+
|
|
79
|
+
| Removed | Use |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| `badge-success` (2.2.0) | `badge-primary` |
|
|
82
|
+
| `badge-white` | `badge-outline` |
|
|
83
|
+
| `badge-green` | `badge-chart-1` |
|
|
84
|
+
| `badge-yellow` | `badge-chart-3` |
|
|
85
|
+
| `badge-orange` | `badge-chart-4` |
|
|
86
|
+
| `badge-destructive` as a red category | `badge-chart-5` (keep `badge-destructive`, now the design's, for an error status) |
|
|
87
|
+
| `badge-blue` | `badge-info` |
|
|
88
|
+
| `badge-purple` | `badge-chart-1` (the designer's mapping) |
|
|
89
|
+
| `badge-pink` | `badge-chart-3` (the designer's mapping) |
|
|
90
|
+
| `badge-cyan` | `badge-chart-6` (the designer's mapping) |
|
|
91
|
+
| `badge-strong-yellow` / `-orange` / `-red` | `badge-strong-chart-3` / `-chart-4` / `-chart-5` |
|
|
92
|
+
| `badge-strong-slate` | `badge-strong-secondary` |
|
|
93
|
+
|
|
94
|
+
- **Kept names, new look**: `badge-primary` (was a primary-100 pill with a primary-300 edge, now the
|
|
95
|
+
design's green status pill), `badge-info`, `badge-destructive` (now red text on red-100).
|
|
96
|
+
- A removed class emits nothing, silently: the badge falls back to the neutral one. Search the
|
|
97
|
+
templates — `[class.badge-…]` bindings and class maps in TypeScript included.
|
|
98
|
+
|
|
65
99
|
## Upgrading to 2.2.0
|
|
66
100
|
|
|
67
101
|
Two classes added, nothing changes for existing screens: **`.badge-success`** and
|
package/components.css
CHANGED
|
@@ -15,13 +15,9 @@
|
|
|
15
15
|
their own tokens rather than an opacity, because in dark the primary
|
|
16
16
|
background is LIGHT: its hover has to lighten, where in light it darkens.
|
|
17
17
|
|
|
18
|
-
The `.badge` family
|
|
19
|
-
|
|
20
|
-
|
|
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.
|
|
18
|
+
The `.badge` family follows the Badge of the Figma library since 3.0.0 — see
|
|
19
|
+
its block below: status pairs and data colours, which keep one value in both
|
|
20
|
+
themes, so a badge reads the same on a dark interface.
|
|
25
21
|
|
|
26
22
|
`.badge` takes gaffer's variant, the only one actually in use — 38 usages. The
|
|
27
23
|
discarded variant carried `dark:` classes which would not have responded to
|
|
@@ -94,8 +90,20 @@
|
|
|
94
90
|
}
|
|
95
91
|
}
|
|
96
92
|
|
|
93
|
+
/* 3.0.0: the Badge of the Figma library (« Skillcorner webapp - Library », node 620:965), read
|
|
94
|
+
variant by variant on 2026-10-06. Two sizes, two styles, eleven variants, under the Figma's
|
|
95
|
+
own names:
|
|
96
|
+
- default 20 px (`px-2 py-0.5`, 12/16), `.badge-lg` 32 px (`px-3 py-1.5`, 14/20, `gap-1`);
|
|
97
|
+
- `.badge-<variant>` is the light style, `.badge-strong-<variant>` the strong one; `.badge`
|
|
98
|
+
alone is secondary light, the neutral badge;
|
|
99
|
+
- NO border but on outline. Up to 2.2.0 every badge carried a transparent one, so the
|
|
100
|
+
borderless badges stood 22 px high where the design draws 20, and the palette variants
|
|
101
|
+
(`-green`, `-purple`… on a -100 ground with a -300 edge) were gaffer's former local style,
|
|
102
|
+
absent from the design. They are gone; the README maps each one to its replacement.
|
|
103
|
+
The hover state of the Figma (80 % opacity) belongs to a clickable badge: none exists, so
|
|
104
|
+
none is emitted. */
|
|
97
105
|
.badge {
|
|
98
|
-
@apply inline-flex items-center justify-center gap-0.5 rounded-lg
|
|
106
|
+
@apply inline-flex items-center justify-center gap-0.5 rounded-lg bg-neutral-foreground px-2 py-0.5 text-xs leading-4 font-medium text-neutral;
|
|
99
107
|
|
|
100
108
|
/* The badge does NOT follow the theme: its colors are the same in both. What it
|
|
101
109
|
contains has to keep the badge's text color. Without this rule, the reset of an
|
|
@@ -108,39 +116,24 @@
|
|
|
108
116
|
color: inherit;
|
|
109
117
|
}
|
|
110
118
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
&:is(
|
|
114
|
-
.badge-white,
|
|
115
|
-
.badge-primary,
|
|
116
|
-
.badge-green,
|
|
117
|
-
.badge-yellow,
|
|
118
|
-
.badge-orange,
|
|
119
|
-
.badge-destructive,
|
|
120
|
-
.badge-blue,
|
|
121
|
-
.badge-purple,
|
|
122
|
-
.badge-pink,
|
|
123
|
-
.badge-cyan,
|
|
124
|
-
.badge-strong-yellow,
|
|
125
|
-
.badge-strong-orange,
|
|
126
|
-
.badge-strong-red
|
|
127
|
-
) {
|
|
128
|
-
@apply text-slate-950;
|
|
119
|
+
&.badge-lg {
|
|
120
|
+
@apply gap-1 px-3 py-1.5 text-sm leading-5;
|
|
129
121
|
}
|
|
130
122
|
|
|
131
|
-
/*
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
123
|
+
/* Outline: the only bordered badge. Its 1 px edge is taken out of the vertical padding, so
|
|
124
|
+
it stays 20 px (32 px large) like the others — the Figma draws the stroke inside. It sits
|
|
125
|
+
on the theme's surfaces, unlike the others: a control ground with the foreground text. */
|
|
126
|
+
&.badge-outline {
|
|
127
|
+
@apply border border-border-color bg-control text-foreground py-px;
|
|
136
128
|
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
&.badge-lg {
|
|
130
|
+
@apply py-[5px];
|
|
131
|
+
}
|
|
139
132
|
}
|
|
140
133
|
|
|
141
|
-
/*
|
|
142
|
-
|
|
143
|
-
&.badge-
|
|
134
|
+
/* Light: the status pair, its pale ground with the status colour as text. The pairs keep
|
|
135
|
+
their light values in dark (tokens 2.0.0), so the badge reads the same in both themes. */
|
|
136
|
+
&.badge-primary {
|
|
144
137
|
@apply bg-success-foreground text-success;
|
|
145
138
|
}
|
|
146
139
|
|
|
@@ -148,53 +141,96 @@
|
|
|
148
141
|
@apply bg-info-foreground text-info;
|
|
149
142
|
}
|
|
150
143
|
|
|
151
|
-
&.badge-
|
|
152
|
-
@apply
|
|
144
|
+
&.badge-warning {
|
|
145
|
+
@apply bg-warning-foreground text-warning;
|
|
153
146
|
}
|
|
154
147
|
|
|
155
|
-
&.badge-
|
|
156
|
-
@apply
|
|
148
|
+
&.badge-destructive {
|
|
149
|
+
@apply bg-destructive-foreground text-destructive;
|
|
157
150
|
}
|
|
158
151
|
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
/* Strong: the same pairs inverted. Primary takes the primary surface and its foreground,
|
|
153
|
+
which both move in dark (green-400 under slate-950 text), so it stays readable there. */
|
|
154
|
+
&.badge-strong-primary {
|
|
155
|
+
@apply bg-primary text-primary-foreground;
|
|
161
156
|
}
|
|
162
157
|
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
/* The Figma binds strong secondary to slate-800 under slate-200, through variables that turn
|
|
159
|
+
dark in the dark theme (`track` would vanish on its own ground). Written as palette
|
|
160
|
+
values, like every badge, it keeps one look in both. */
|
|
161
|
+
&.badge-strong-secondary {
|
|
162
|
+
@apply bg-slate-800 text-slate-200;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&.badge-strong-info {
|
|
166
|
+
@apply bg-info text-info-foreground;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&.badge-strong-warning {
|
|
170
|
+
@apply bg-warning text-warning-foreground;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&.badge-strong-destructive {
|
|
174
|
+
@apply bg-destructive text-destructive-foreground;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* Chart: the data colours, for a category rather than a status — a hue that tells one
|
|
178
|
+
value from another. Light on the `-foreground` shade, strong on the `-accent` one, both
|
|
179
|
+
under `data-foreground`, the text the percentile surfaces already use. No chart-2: the
|
|
180
|
+
Figma has none. */
|
|
181
|
+
&:is(
|
|
182
|
+
.badge-chart-1,
|
|
183
|
+
.badge-chart-3,
|
|
184
|
+
.badge-chart-4,
|
|
185
|
+
.badge-chart-5,
|
|
186
|
+
.badge-chart-6,
|
|
187
|
+
.badge-strong-chart-1,
|
|
188
|
+
.badge-strong-chart-3,
|
|
189
|
+
.badge-strong-chart-4,
|
|
190
|
+
.badge-strong-chart-5,
|
|
191
|
+
.badge-strong-chart-6
|
|
192
|
+
) {
|
|
193
|
+
@apply text-data-foreground;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&.badge-chart-1 {
|
|
197
|
+
@apply bg-chart-1-foreground;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&.badge-chart-3 {
|
|
201
|
+
@apply bg-chart-3-foreground;
|
|
165
202
|
}
|
|
166
203
|
|
|
167
|
-
&.badge-
|
|
168
|
-
@apply
|
|
204
|
+
&.badge-chart-4 {
|
|
205
|
+
@apply bg-chart-4-foreground;
|
|
169
206
|
}
|
|
170
207
|
|
|
171
|
-
&.badge-
|
|
172
|
-
@apply
|
|
208
|
+
&.badge-chart-5 {
|
|
209
|
+
@apply bg-chart-5-foreground;
|
|
173
210
|
}
|
|
174
211
|
|
|
175
|
-
&.badge-
|
|
176
|
-
@apply
|
|
212
|
+
&.badge-chart-6 {
|
|
213
|
+
@apply bg-chart-6-foreground;
|
|
177
214
|
}
|
|
178
215
|
|
|
179
|
-
&.badge-
|
|
180
|
-
@apply
|
|
216
|
+
&.badge-strong-chart-1 {
|
|
217
|
+
@apply bg-chart-1-accent;
|
|
181
218
|
}
|
|
182
219
|
|
|
183
|
-
&.badge-strong-
|
|
184
|
-
@apply bg-
|
|
220
|
+
&.badge-strong-chart-3 {
|
|
221
|
+
@apply bg-chart-3-accent;
|
|
185
222
|
}
|
|
186
223
|
|
|
187
|
-
&.badge-strong-
|
|
188
|
-
@apply bg-
|
|
224
|
+
&.badge-strong-chart-4 {
|
|
225
|
+
@apply bg-chart-4-accent;
|
|
189
226
|
}
|
|
190
227
|
|
|
191
|
-
&.badge-strong-
|
|
192
|
-
@apply bg-
|
|
228
|
+
&.badge-strong-chart-5 {
|
|
229
|
+
@apply bg-chart-5-accent;
|
|
193
230
|
}
|
|
194
231
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
@apply bg-neutral text-neutral-foreground;
|
|
232
|
+
&.badge-strong-chart-6 {
|
|
233
|
+
@apply bg-chart-6-accent;
|
|
198
234
|
}
|
|
199
235
|
}
|
|
200
236
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skcr-design-tokens",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.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": [
|