@marianmeres/design-tokens 1.9.0 → 1.10.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/AGENTS.md +2 -1
- package/API.md +5 -1
- package/README.md +9 -1
- package/dist/css/red-sky-slate.css +2 -2
- package/dist/themes/red-sky-slate.js +2 -2
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -102,10 +102,11 @@ Entry points:
|
|
|
102
102
|
2. Token naming: `--{prefix}color-{key}`, `--{prefix}color-{key}-hover`, etc.
|
|
103
103
|
3. Prefix is auto-normalized — `"my"` and `"my-"` both produce `--my-color-*`. Empty string produces unprefixed.
|
|
104
104
|
4. Hover/active auto-derived via `color-mix(in oklab, ...)` with a per-bucket strategy: **intent** colors (saturated brand) mix toward `black` / `white` 10%/20% (mode-aware); **role** colors (paired + single) mix toward `var(--{prefix}color-foreground)` 10%/20% for a softer, theme-tinted shift. `oklab` (rectangular) is used rather than `oklch` (polar) because polar hue interpolation collapses to a powerless hue on low-chroma colors mixed toward black/white, painting as a red/mauve shift on near-neutral themes. Disable with `deriveStates: false`.
|
|
105
|
-
5. Surface-intent tokens derived via `color-mix(in srgb, ...)` from intent + background. Foreground contrast defaults to 50% — tune via `surfaceForegroundContrast`.
|
|
105
|
+
5. Surface-intent tokens derived via `color-mix(in srgb, ...)` from intent + background. Foreground contrast defaults to 50% — tune via `surfaceForegroundContrast`. Note `surface-{intent}-border` mixes the intent color 30% **toward `background`** — it is the *outer* edge of an intent-tinted surface seen against the page, **not** an inner divider drawn on top of a surface.
|
|
106
106
|
6. Theme files use `export default` with `ThemeSchema` type annotation. All bundled themes include an optional `surface-1` paired role (extra elevation).
|
|
107
107
|
7. Formatting: tabs, 90-char line width, 4-space indent width (`deno fmt`)
|
|
108
108
|
8. MCP handlers must return `Promise<string>` — framework contract from `jsr:@marianmeres/mcp-server/types`.
|
|
109
|
+
9. **Layering semantics for dividers/hairlines**: `border` is calibrated against the **page background / muted** layer (≈ background + one step) and is hand-authored per theme — it may deliberately equal a `surface` step (e.g. dark themes where `border` == `surface` == the same neutral), so it is **not** a safe divider drawn *on top of* a `surface`. For an on-surface hairline/divider use `surface-1` (one curated step from `surface` in both modes). There is intentionally no dedicated `surface-border` token — `surface-1` covers the case, and the name would collide with the outer-edge meaning of `surface-{intent}-border` (see #5).
|
|
109
110
|
|
|
110
111
|
## Adding a New Theme
|
|
111
112
|
|
package/API.md
CHANGED
|
@@ -333,7 +333,7 @@ Required paired role keys.
|
|
|
333
333
|
type RolePairedOptionalKey = "surface-1";
|
|
334
334
|
```
|
|
335
335
|
|
|
336
|
-
Optional paired role keys. Conventional but not required — all bundled themes define `surface-1` as an additional elevation layer. Additional arbitrary string keys are also allowed.
|
|
336
|
+
Optional paired role keys. Conventional but not required — all bundled themes define `surface-1` as an additional elevation layer. It also serves as the correct **hairline/divider color for content drawn _on_ a `surface`**: it sits one curated step from `surface` in both light and dark, so it always contrasts — unlike `border`, which is calibrated against the page background and can equal a surface step in dark mode. Additional arbitrary string keys are also allowed.
|
|
337
337
|
|
|
338
338
|
---
|
|
339
339
|
|
|
@@ -343,6 +343,10 @@ Optional paired role keys. Conventional but not required — all bundled themes
|
|
|
343
343
|
type RoleSingleKey = "foreground" | "border" | "input" | "ring";
|
|
344
344
|
```
|
|
345
345
|
|
|
346
|
+
Required single-value role keys.
|
|
347
|
+
|
|
348
|
+
> **`border` is calibrated against the page background / muted layer** (≈ background + one step) and is hand-tuned per theme. It may deliberately coincide with a `surface` step — in several dark themes `border` and `surface` are the same neutral — so it is **not** a reliable divider when drawn _on top of_ a `surface`. Use `border` to outline a card _against_ the page; use [`surface-1`](#rolepairedoptionalkey) for a hairline/divider _on_ a surface. (Note: `surface-{intent}-border` is a separate generated token — the _outer_ edge of an intent-tinted surface seen against the background, not an on-surface divider.)
|
|
349
|
+
|
|
346
350
|
---
|
|
347
351
|
|
|
348
352
|
### `WithRequired` / `WithOptional` / `WithKnown`
|
package/README.md
CHANGED
|
@@ -37,11 +37,19 @@ const theme: ThemeSchema = {
|
|
|
37
37
|
background: { DEFAULT: "#ffffff", foreground: "#171717" },
|
|
38
38
|
muted: { DEFAULT: "#f5f5f5", foreground: "#737373" },
|
|
39
39
|
surface: { DEFAULT: "#e5e5e5", foreground: "#171717" },
|
|
40
|
-
// Optional extra elevation (all bundled themes include it)
|
|
40
|
+
// Optional extra elevation (all bundled themes include it).
|
|
41
|
+
// Also the correct hairline/divider color for content drawn
|
|
42
|
+
// *on* a surface — it sits one step from `surface` in both
|
|
43
|
+
// light and dark, so it always contrasts (unlike `border`).
|
|
41
44
|
"surface-1": { DEFAULT: "#d4d4d4", foreground: "#171717" },
|
|
42
45
|
},
|
|
43
46
|
single: {
|
|
44
47
|
foreground: "#171717",
|
|
48
|
+
// Hairline calibrated against the page background / muted
|
|
49
|
+
// layer. It may deliberately coincide with a `surface` step
|
|
50
|
+
// (in several dark themes `border` == `surface`), so use it to
|
|
51
|
+
// outline a card *against* the page — not as a divider drawn
|
|
52
|
+
// *on* a surface. Use `surface-1` for on-surface dividers.
|
|
45
53
|
border: { DEFAULT: "#d4d4d4" },
|
|
46
54
|
input: { DEFAULT: "#ffffff" },
|
|
47
55
|
ring: "color-mix(in srgb, #2563eb 25%, transparent)",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
--stuic-color-primary-foreground-hover: #ffffff;
|
|
8
8
|
--stuic-color-primary-foreground-active: #ffffff;
|
|
9
9
|
|
|
10
|
-
--stuic-color-accent: #
|
|
10
|
+
--stuic-color-accent: #0ea5e9;
|
|
11
11
|
--stuic-color-accent-hover: color-mix(in oklab, var(--stuic-color-accent), black 10%);
|
|
12
12
|
--stuic-color-accent-active: color-mix(in oklab, var(--stuic-color-accent), black 20%);
|
|
13
13
|
--stuic-color-accent-foreground: #ffffff;
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
--stuic-color-primary-foreground-hover: #ffffff;
|
|
104
104
|
--stuic-color-primary-foreground-active: #ffffff;
|
|
105
105
|
|
|
106
|
-
--stuic-color-accent: #
|
|
106
|
+
--stuic-color-accent: #0284c7;
|
|
107
107
|
--stuic-color-accent-hover: color-mix(in oklab, var(--stuic-color-accent), white 10%);
|
|
108
108
|
--stuic-color-accent-active: color-mix(in oklab, var(--stuic-color-accent), white 20%);
|
|
109
109
|
--stuic-color-accent-foreground: #ffffff;
|
|
@@ -7,7 +7,7 @@ const light = {
|
|
|
7
7
|
foreground: colors.white,
|
|
8
8
|
},
|
|
9
9
|
accent: {
|
|
10
|
-
DEFAULT: colors.sky[
|
|
10
|
+
DEFAULT: colors.sky[500],
|
|
11
11
|
foreground: colors.white,
|
|
12
12
|
},
|
|
13
13
|
destructive: {
|
|
@@ -64,7 +64,7 @@ const dark = {
|
|
|
64
64
|
foreground: colors.white,
|
|
65
65
|
},
|
|
66
66
|
accent: {
|
|
67
|
-
DEFAULT: colors.sky[
|
|
67
|
+
DEFAULT: colors.sky[600],
|
|
68
68
|
foreground: colors.white,
|
|
69
69
|
},
|
|
70
70
|
destructive: {
|