@phcdevworks/spectre-tokens 4.9.0 → 4.11.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 +53 -18
- package/dist/index.cjs +1248 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +491 -3
- package/dist/index.d.cts +1243 -9
- package/dist/index.d.ts +1243 -9
- package/dist/index.js +1248 -5
- package/dist/index.js.map +1 -1
- package/dist/tokens.dtcg.json +4411 -1119
- package/package.json +13 -12
- package/tokens/components.json +1249 -100
- package/tokens/modes.json +2975 -695
- package/tokens/typography.json +51 -0
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ contracts for specific frameworks and runtimes.
|
|
|
17
17
|
| Project team | `project-design` |
|
|
18
18
|
| Repository role | Spectre L1 design-token contract |
|
|
19
19
|
| Package/artifact | `@phcdevworks/spectre-tokens` |
|
|
20
|
-
| Current version/status | 4.
|
|
20
|
+
| Current version/status | 4.11.0 |
|
|
21
21
|
|
|
22
22
|
## Standard Workflow
|
|
23
23
|
|
|
@@ -30,18 +30,20 @@ contracts for specific frameworks and runtimes.
|
|
|
30
30
|
|
|
31
31
|
## Documentation Map
|
|
32
32
|
|
|
33
|
-
| Guide
|
|
34
|
-
|
|
|
35
|
-
| Agent rules
|
|
36
|
-
| Claude Code
|
|
37
|
-
| Codex
|
|
38
|
-
| Copilot
|
|
39
|
-
| Jules
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
33
|
+
| Guide | Path |
|
|
34
|
+
| ----------------- | -------------------------------------------- |
|
|
35
|
+
| Agent rules | [AGENTS.md](AGENTS.md) |
|
|
36
|
+
| Claude Code | [CLAUDE.md](CLAUDE.md) |
|
|
37
|
+
| Codex | [CODEX.md](CODEX.md) |
|
|
38
|
+
| Copilot | [COPILOT.md](COPILOT.md) |
|
|
39
|
+
| Jules | [JULES.md](JULES.md) |
|
|
40
|
+
| Grok | [GROK.md](GROK.md) |
|
|
41
|
+
| Roadmap | [ROADMAP.md](ROADMAP.md) |
|
|
42
|
+
| Todo | [TODO.md](TODO.md) |
|
|
43
|
+
| Token reference | [TOKEN_REFERENCE.md](TOKEN_REFERENCE.md) |
|
|
44
|
+
| Downstream parity | [DOWNSTREAM_PARITY.md](DOWNSTREAM_PARITY.md) |
|
|
45
|
+
| Changelog | [CHANGELOG.md](CHANGELOG.md) |
|
|
46
|
+
| Security | [SECURITY.md](SECURITY.md) |
|
|
45
47
|
|
|
46
48
|
[](https://www.npmjs.com/package/@phcdevworks/spectre-tokens)
|
|
47
49
|
[](https://github.com/phcdevworks/spectre-tokens/actions/workflows/ci.yml)
|
|
@@ -164,7 +166,7 @@ mode-aware styling.
|
|
|
164
166
|
| ----------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
165
167
|
| `surface` | Background roles: page, card, input, overlay, subtle, hero (gradient, hero sections only), hover, selected, active, divider |
|
|
166
168
|
| `text` | Foreground roles: default, muted, subtle, meta, on-surface, on-page |
|
|
167
|
-
| `component` | Role-specific tokens for
|
|
169
|
+
| `component` | Role-specific tokens for navigation, overlays, feedback, data display, loading, forms, cards, badges, and content patterns |
|
|
168
170
|
| `buttons` | Button state tokens: default, hover, active, disabled, CTA |
|
|
169
171
|
| `forms` | Form state tokens: default, focused, error, disabled |
|
|
170
172
|
| `link` | Inline link color roles: default, hover, active, visited |
|
|
@@ -262,17 +264,40 @@ body {
|
|
|
262
264
|
font-weight: var(--sp-body-weight);
|
|
263
265
|
letter-spacing: var(--sp-body-letter-spacing);
|
|
264
266
|
}
|
|
267
|
+
|
|
268
|
+
.hero-title {
|
|
269
|
+
font-size: var(--sp-display-1-size);
|
|
270
|
+
line-height: var(--sp-display-1-line-height);
|
|
271
|
+
font-weight: var(--sp-display-1-weight);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.intro {
|
|
275
|
+
font-size: var(--sp-lead-size);
|
|
276
|
+
line-height: var(--sp-lead-line-height);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
input {
|
|
280
|
+
background: var(--sp-form-default-bg);
|
|
281
|
+
color: var(--sp-form-default-text);
|
|
282
|
+
}
|
|
265
283
|
```
|
|
266
284
|
|
|
267
285
|
The CSS entry point is intended for consumers that want the token contract as
|
|
268
286
|
variables rather than reading values in JavaScript.
|
|
269
287
|
|
|
270
|
-
`typography.heading.{h1..h6}
|
|
271
|
-
each a complete
|
|
288
|
+
`typography.heading.{h1..h6}`, `typography.body`, `typography.display.{1..6}`,
|
|
289
|
+
and `typography.lead` are semantic role tokens — each a complete
|
|
272
290
|
`{ fontFamily, fontSize, lineHeight, fontWeight, letterSpacing }` object
|
|
273
291
|
referencing `typography.scale.*` and `typography.families.*` — so downstream
|
|
274
|
-
consumers get a
|
|
275
|
-
`typography.scale` step per heading level.
|
|
292
|
+
consumers get a text-role contract instead of hand-picking a raw
|
|
293
|
+
`typography.scale` step per heading level. Each role emits
|
|
294
|
+
`--sp-<role>-{family,size,line-height,weight,letter-spacing}` (for example
|
|
295
|
+
`--sp-heading-h1-size`, `--sp-display-1-size`, `--sp-lead-size`).
|
|
296
|
+
|
|
297
|
+
`--sp-form-default-{bg,text,placeholder}` are redeclared in the
|
|
298
|
+
`[data-spectre-theme="dark"]` block from `modes.dark.forms.default.*`, so they
|
|
299
|
+
follow the active mode. Other `forms.*` variables, including
|
|
300
|
+
`--sp-form-default-border`, are declared once in `:root`.
|
|
276
301
|
|
|
277
302
|
### Token model
|
|
278
303
|
|
|
@@ -310,6 +335,12 @@ internal generation details and are not part of the public package contract.
|
|
|
310
335
|
See [TOKEN_REFERENCE.md](TOKEN_REFERENCE.md) for the exhaustive, generated list
|
|
311
336
|
of every token path, resolved value, and usage note.
|
|
312
337
|
|
|
338
|
+
Downstream packages building recipes on the CSS output should use
|
|
339
|
+
[DOWNSTREAM_PARITY.md](DOWNSTREAM_PARITY.md), which groups every published
|
|
340
|
+
`--sp-*` variable into the family a recipe or stylesheet consumes. Run
|
|
341
|
+
`npm run audit:parity` (optionally `-- <sibling-repo>`) for a checklist of the
|
|
342
|
+
families a checked-out downstream repo has not consumed yet.
|
|
343
|
+
|
|
313
344
|
The `layout` namespace includes section, stack, and container spacing tokens,
|
|
314
345
|
plus fixed layout width tokens for common consumer shells:
|
|
315
346
|
`layout.container.maxWidth`, `layout.container.maxWidthProse`,
|
|
@@ -343,8 +374,12 @@ import tokens from '@phcdevworks/spectre-tokens'
|
|
|
343
374
|
|
|
344
375
|
const darkPage = tokens.modes.dark.surface.page
|
|
345
376
|
const darkText = tokens.modes.dark.text.onPage.default
|
|
377
|
+
const darkInputBg = tokens.modes.dark.forms.default.bg
|
|
346
378
|
```
|
|
347
379
|
|
|
380
|
+
Top-level `forms.default.{bg,text,placeholder}` hold the default (light)
|
|
381
|
+
values; read `modes.dark.forms.default.*` for their dark equivalents.
|
|
382
|
+
|
|
348
383
|
Guidance:
|
|
349
384
|
|
|
350
385
|
- Prefer semantic tokens for theme-aware UI.
|