Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

Adopt reviewed Stone palette (#7669)

rubyycheunge5c5a8738b38
diff --git a/.changeset/stone-reviewed-palette.md b/.changeset/stone-reviewed-palette.md
new file mode 100644
index 0000000000..4f4be1514f
--- /dev/null
+++ b/.changeset/stone-reviewed-palette.md
@@ -0,0 +1,8 @@
+---
+'@astryxdesign/theme-stone': patch
+'@astryxdesign/cli': patch
+---
+
+[feat] Replace Stone's internal shared-ramp mapping with reviewed light and dark ramps while preserving the public numbered palette lookups and `hue`/`chroma` metadata. The light canvas moves from `#F3F3F5` to `#F0F0F7`, the dark popover from `#25252A` to `#302F36`, and Green, Yellow, Teal, and Cyan use re-seeded midtones (including Green `#667D65` to `#528B49`). Seven families' light stop-90 surfaces, syntax colors, and input status rims shift; the mapped success and warning rims use `#609757` and `#A08C36`, and syntax attribute uses `#736419`, keeping the required contrast floors. Existing apps can keep the former appearance by extending `stoneTheme` and overriding the affected color, syntax, shadow, and component tokens with their previous values. The CLI template ships the same reproducible request, receipt, and runtime-sized references.
+
+@rubyycheung
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/stone-palette/page.tsx b/apps/sandbox/src/app/(fullscreen)/pages/stone-palette/page.tsx
index fcca5df8a2..4df6ee5609 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/stone-palette/page.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/stone-palette/page.tsx
@@ -4,30 +4,79 @@
import {VStack} from '@astryxdesign/core/Layout';
import {stoneTheme} from '@astryxdesign/theme-stone/built';
-// `stonePalettes` is only exported from the source entry, not /built.
-import {stonePalettes} from '@astryxdesign/theme-stone';
+import {palette as stoneModePalettes} from '../../../../../../../packages/themes/stone/src/stonePalettes.generated';
import {ThemePalettePreview} from '@/components/ThemePalettePreview';
import type {TonalColor} from '@/components/ThemePalettePreview';
const MONTSERRAT =
'"Montserrat", "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif';
-// Pass the canonical hand-tuned `stonePalettes` ramps to the audit
-// drawer so its snap-to-ramp detector matches against the actual
-// stone palette values. Without this, tokens whose values come from
-// the canonical ramp show up as "off-ramp" against the pure HCT
-// generator's slightly different ramp.
+// Pass Stone's explicit light and dark ramps so the preview and audit drawer
+// use the reviewed mode-aware values instead of the legacy shared-ramp alias.
const TONAL_COLORS: TonalColor[] = [
- {name: 'Stone Neutral', sourceHex: '#e2e2e2', tones: stonePalettes.neutral},
- {name: 'Blue', sourceHex: '#d7e4f5', tones: stonePalettes.blue},
- {name: 'Cyan', sourceHex: '#cce8e5', tones: stonePalettes.cyan},
- {name: 'Green', sourceHex: '#d0e9ce', semantic: 'Success', tones: stonePalettes.green},
- {name: 'Teal', sourceHex: '#d4e7dc', tones: stonePalettes.teal},
- {name: 'Yellow', sourceHex: '#f4e1b7', semantic: 'Warning', tones: stonePalettes.yellow},
- {name: 'Orange', sourceHex: '#ffdcbb', tones: stonePalettes.orange},
- {name: 'Red', sourceHex: '#f9dcd7', semantic: 'Error', tones: stonePalettes.red},
- {name: 'Pink', sourceHex: '#f0dde8', tones: stonePalettes.pink},
- {name: 'Purple', sourceHex: '#e8dff3', tones: stonePalettes.purple},
+ {
+ name: 'Stone Neutral',
+ sourceHex: '#e2e2e2',
+ tones: stoneModePalettes.neutral.light,
+ dark: {tones: stoneModePalettes.neutral.dark},
+ },
+ {
+ name: 'Blue',
+ sourceHex: '#d7e4f5',
+ tones: stoneModePalettes.blue.light,
+ dark: {tones: stoneModePalettes.blue.dark},
+ },
+ {
+ name: 'Cyan',
+ sourceHex: '#cce8e5',
+ tones: stoneModePalettes.cyan.light,
+ dark: {tones: stoneModePalettes.cyan.dark},
+ },
+ {
+ name: 'Green',
+ sourceHex: '#d0e9ce',
+ semantic: 'Success',
+ tones: stoneModePalettes.green.light,
+ dark: {tones: stoneModePalettes.green.dark},
+ },
+ {
+ name: 'Teal',
+ sourceHex: '#d4e7dc',
+ tones: stoneModePalettes.teal.light,
+ dark: {tones: stoneModePalettes.teal.dark},
+ },
+ {
+ name: 'Yellow',
+ sourceHex: '#f4e1b7',
+ semantic: 'Warning',
+ tones: stoneModePalettes.yellow.light,
+ dark: {tones: stoneModePalettes.yellow.dark},
+ },
+ {
+ name: 'Orange',
+ sourceHex: '#ffdcbb',
+ tones: stoneModePalettes.orange.light,
+ dark: {tones: stoneModePalettes.orange.dark},
+ },
+ {
+ name: 'Red',
+ sourceHex: '#f9dcd7',
+ semantic: 'Error',
+ tones: stoneModePalettes.red.light,
+ dark: {tones: stoneModePalettes.red.dark},
+ },
+ {
+ name: 'Pink',
+ sourceHex: '#f0dde8',
+ tones: stoneModePalettes.pink.light,
+ dark: {tones: stoneModePalettes.pink.dark},
+ },
+ {
+ name: 'Purple',
+ sourceHex: '#e8dff3',
+ tones: stoneModePalettes.purple.light,
+ dark: {tones: stoneModePalettes.purple.dark},
+ },
];
const CORE = [
diff --git a/apps/sandbox/src/app/(sandbox)/pages/palette-generator/themeCorpus.ts b/apps/sandbox/src/app/(sandbox)/pages/palette-generator/themeCorpus.ts
index d3a0d40429..e65bab785e 100644
--- a/apps/sandbox/src/app/(sandbox)/pages/palette-generator/themeCorpus.ts
+++ b/apps/sandbox/src/app/(sandbox)/pages/palette-generator/themeCorpus.ts
@@ -2,7 +2,7 @@
import {butterPalettes} from '@astryxdesign/theme-butter';
import {gothicPalettes} from '@astryxdesign/theme-gothic';
-import {stonePalettes} from '@astryxdesign/theme-stone';
+import {palette as stoneModePalettes} from '../../../../../../../packages/themes/stone/src/stonePalettes.generated';
import {y2kPalettes} from '@astryxdesign/theme-y2k';
import {hexToHct, hctToHex} from '../color-studio/colorUtils';
@@ -152,18 +152,82 @@ const stoneFamilies = [
'neutral',
'Stone Neutral',
'#e2e2e2',
- stonePalettes.neutral,
+ stoneModePalettes.neutral.light,
'neutral',
+ stoneModePalettes.neutral.dark,
+ ),
+ storedFamily(
+ 'blue',
+ 'Blue',
+ '#d7e4f5',
+ stoneModePalettes.blue.light,
+ 'chromatic',
+ stoneModePalettes.blue.dark,
+ ),
+ storedFamily(
+ 'cyan',
+ 'Cyan',
+ '#cce8e5',
+ stoneModePalettes.cyan.light,
+ 'chromatic',
+ stoneModePalettes.cyan.dark,
+ ),
+ storedFamily(
+ 'green',
+ 'Green',
+ '#d0e9ce',
+ stoneModePalettes.green.light,
+ 'chromatic',
+ stoneModePalettes.green.dark,
+ ),
+ storedFamily(
+ 'teal',
+ 'Teal',
+ '#d4e7dc',
+ stoneModePalettes.teal.light,
+ 'chromatic',
+ stoneModePalettes.teal.dark,
+ ),
+ storedFamily(
+ 'yellow',
+ 'Yellow',
+ '#f4e1b7',
+ stoneModePalettes.yellow.light,
+ 'chromatic',
+ stoneModePalettes.yellow.dark,
+ ),
+ storedFamily(
+ 'orange',
+ 'Orange',
+ '#ffdcbb',
+ stoneModePalettes.orange.light,
+ 'chromatic',
+ stoneModePalettes.orange.dark,
+ ),
+ storedFamily(
+ 'red',
+ 'Red',
+ '#f9dcd7',
+ stoneModePalettes.red.light,
+ 'chromatic',
+ stoneModePalettes.red.dark,
+ ),
+ storedFamily(
+ 'pink',
+ 'Pink',
+ '#f0dde8',
+ stoneModePalettes.pink.light,
+ 'chromatic',
+ stoneModePalettes.pink.dark,
+ ),
+ storedFamily(
+ 'purple',
+ 'Purple',
+ '#e8dff3',
+ stoneModePalettes.purple.light,
+ 'chromatic',
+ stoneModePalettes.purple.dark,
),
- storedFamily('blue', 'Blue', '#d7e4f5', stonePalettes.blue),
- storedFamily('cyan', 'Cyan', '#cce8e5', stonePalettes.cyan),
- storedFamily('green', 'Green', '#d0e9ce', stonePalettes.green),
- storedFamily('teal', 'Teal', '#d4e7dc', stonePalettes.teal),
- storedFamily('yellow', 'Yellow', '#f4e1b7', stonePalettes.yellow),
- storedFamily('orange', 'Orange', '#ffdcbb', stonePalettes.orange),
- storedFamily('red', 'Red', '#f9dcd7', stonePalettes.red),
- storedFamily('pink', 'Pink', '#f0dde8', stonePalettes.pink),
- storedFamily('purple', 'Purple', '#e8dff3', stonePalettes.purple),
];
const gothicFamilies = [
diff --git a/apps/sandbox/src/components/ThemePalettePreview.tsx b/apps/sandbox/src/components/ThemePalettePreview.tsx
index b0d69462c4..1aa51616e9 100644
--- a/apps/sandbox/src/components/ThemePalettePreview.tsx
+++ b/apps/sandbox/src/components/ThemePalettePreview.tsx
@@ -271,9 +271,9 @@ export interface TonalColor {
* snap-to-ramp matching so tokens whose values come from the
* canonical ramp don't show up as "off-ramp".
*
- * Numeric keys are interpreted as tone steps; non-numeric keys
- * (e.g. `hue`, `chroma`) are ignored. This permissive shape matches
- * theme palette exports like `stonePalettes.red` (which carry both).
+ * Numeric keys are interpreted as tone steps; non-numeric compatibility
+ * metadata is ignored. Pass a family's explicit `light` and `dark` ramps
+ * when the theme owns separate mode-aware palette values.
*
* Omit for themes that don't carry a custom-tuned ramp — the audit
* + preview both fall back to generating the ramp from `sourceHex`
@@ -755,10 +755,7 @@ function CheckboxRadioSwitchSection() {
isDisabled
/>
</VStack>
- <RadioList
- label="Display mode"
- value="comfortable"
- onChange={() => {}}>
+ <RadioList label="Display mode" value="comfortable" onChange={() => {}}>
<RadioListItem value="compact" label="Compact" />
<RadioListItem value="comfortable" label="Comfortable" />
<RadioListItem value="spacious" label="Spacious" />
@@ -1044,7 +1041,6 @@ function TonalSection({
margin: 0,
marginBottom: 20,
}}>
-
Full HCT tonal ramps: 21 perceptually uniform steps from black (T0) to
white (T100).
{isDark && (
diff --git a/apps/sandbox/src/components/themePreview/colorMath.ts b/apps/sandbox/src/components/themePreview/colorMath.ts
index 6ab81c9913..51ad08fbcd 100644
--- a/apps/sandbox/src/components/themePreview/colorMath.ts
+++ b/apps/sandbox/src/components/themePreview/colorMath.ts
@@ -320,28 +320,13 @@ export interface RampSeed {
sourceHex: string;
/** Optional semantic tag ("Success", "Error", …) — informational only */
semantic?: string;
- /**
- * Optional precomputed canonical ramp — `{0: '#…', 5: '#…', …, 100: '#…'}`.
- *
- * When present, the snap detector uses these exact hex values for
- * matching instead of regenerating the ramp from `sourceHex` via the
- * HCT pipeline. Use this when a theme exports a hand-tuned palette
- * (e.g. stone's `stonePalettes.red`) that drifts from the pure HCT
- * generator's output by more than a couple of \u0394E units — without it,
- * tokens whose values come from the canonical ramp would show up as
- * "off-ramp" against the generator's slightly different ramp.
- *
- * Same per-mode shape: a single map covers BOTH light and dark
- * resolutions. The dark-mode generator's tone-lift / chroma-attenuation
- * transforms aren't applied — the supplied canonical values are
- * treated as authoritative for both modes.
- *
- * Permissive `string | number` keys/values match the shape of theme
- * palette exports like `stonePalettes.red` which carry both numeric
- * tone steps and metadata keys (`hue`, `chroma`); non-numeric keys
- * and non-string values are skipped at lookup time.
- */
+ /** Optional precomputed canonical light-mode ramp. */
tones?: Readonly<Record<string | number, string | number>>;
+ /** Optional dark-mode source and ramp for mode-aware theme palettes. */
+ dark?: {
+ sourceHex?: string;
+ tones?: Readonly<Record<string | number, string | number>>;
+ };
}
export interface SnapMatch {
@@ -373,22 +358,17 @@ export function findClosestRampStep(
const targetLab = hexToLab(targetHex);
let best: SnapMatch | null = null;
for (const seed of seeds) {
- // Canonical ramp wins when supplied — themes with hand-tuned
- // ramps (stone, gothic, y2k, butter) drift from the pure HCT
- // generator by enough to flip on-ramp tokens to "near"/"off" if
- // we ignore the canonical values. See `RampSeed.tones` for
- // context. The canonical map's permissive `string | number` value
- // type means we filter to strings at lookup (the metadata keys
- // `hue` and `chroma` carry numeric values that we ignore here).
+ const canonicalTones = (mode === 'dark' && seed.dark?.tones) || seed.tones;
let lookup: (t: number) => string | undefined;
- if (seed.tones) {
- const map = seed.tones;
+ if (canonicalTones) {
lookup = t => {
- const v = map[t];
- return typeof v === 'string' ? v : undefined;
+ const value = canonicalTones[t];
+ return typeof value === 'string' ? value : undefined;
};
} else {
- const {hue, chroma} = hexToHct(seed.sourceHex);
+ const sourceHex =
+ (mode === 'dark' && seed.dark?.sourceHex) || seed.sourceHex;
+ const {hue, chroma} = hexToHct(sourceHex);
const ramp = tonalPaletteForMode(hue, chroma, mode);
lookup = t => ramp[t];
}
diff --git a/apps/sandbox/src/components/themePreview/modeAwarePalettes.test.ts b/apps/sandbox/src/components/themePreview/modeAwarePalettes.test.ts
new file mode 100644
index 0000000000..f16319f43f
--- /dev/null
+++ b/apps/sandbox/src/components/themePreview/modeAwarePalettes.test.ts
@@ -0,0 +1,31 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+import {describe, expect, it} from 'vitest';
+import {findClosestRampStep} from './colorMath';
+import {resolveOverrideHex} from './themeOverrides';
+
+const modeAwareSeed = {
+ name: 'Mode-aware',
+ sourceHex: '#888888',
+ tones: {50: '#777777'},
+ dark: {
+ sourceHex: '#999999',
+ tones: {50: '#aaaaaa'},
+ },
+} as const;
+
+describe('mode-aware canonical palette ramps', () => {
+ it('matches each mode against its own canonical ramp', () => {
+ expect(
+ findClosestRampStep('#777777', [modeAwareSeed], 'light'),
+ ).toMatchObject({tone: 50, hex: '#777777', verdict: 'exact'});
+ expect(
+ findClosestRampStep('#aaaaaa', [modeAwareSeed], 'dark'),
+ ).toMatchObject({tone: 50, hex: '#aaaaaa', verdict: 'exact'});
+ });
+
+ it('resolves override suggestions from the requested mode', () => {
+ expect(resolveOverrideHex(modeAwareSeed, 50, 'light')).toBe('#777777');
+ expect(resolveOverrideHex(modeAwareSeed, 50, 'dark')).toBe('#aaaaaa');
+ });
+});
diff --git a/apps/sandbox/src/components/themePreview/themeOverrides.ts b/apps/sandbox/src/components/themePreview/themeOverrides.ts
index 15f2a62abf..4d347d42e1 100644
--- a/apps/sandbox/src/components/themePreview/themeOverrides.ts
+++ b/apps/sandbox/src/components/themePreview/themeOverrides.ts
@@ -134,13 +134,15 @@ export function resolveOverrideHex(
tone: ToneStep,
mode: Mode,
): string {
- if (seed.tones) {
- const v = seed.tones[tone];
- if (typeof v === 'string') {
- return v;
+ const canonicalTones = (mode === 'dark' && seed.dark?.tones) || seed.tones;
+ if (canonicalTones) {
+ const value = canonicalTones[tone];
+ if (typeof value === 'string') {
+ return value;
}
}
- const {hue, chroma} = hexToHct(seed.sourceHex);
+ const sourceHex = (mode === 'dark' && seed.dark?.sourceHex) || seed.sourceHex;
+ const {hue, chroma} = hexToHct(sourceHex);
return tonalPaletteForMode(hue, chroma, mode)[tone];
}
@@ -160,7 +162,7 @@ export function buildModeOverride(
return {
kind: 'palette',
rampName: seed.name,
- rampSourceHex: seed.sourceHex,
+ rampSourceHex: (mode === 'dark' && seed.dark?.sourceHex) || seed.sourceHex,
tone,
alpha: clampAlpha(alpha),
hex: composeAlphaHex(baseHex, alpha),
diff --git a/docs/themes/README.md b/docs/themes/README.md
index 853fd17dae..bc00d1f6de 100644
--- a/docs/themes/README.md
+++ b/docs/themes/README.md
@@ -13,7 +13,8 @@ page is guidance and an index, not a canonical record. Start a record from
Current records:
-- [Neutral](../../packages/themes/neutral/neutral.spec.md) — draft
+- [Neutral](../../packages/themes/neutral/neutral.spec.md) — current
+- [Stone](../../packages/themes/stone/stone.spec.md) — current
A theme record sits between system theming architecture and consumer/component
records. It uses one typed `references` list for architecture, design, system,
diff --git a/package.json b/package.json
index 725f45077c..1de61b5eee 100644
--- a/package.json
+++ b/package.json
@@ -9,6 +9,8 @@
"bundle:cli-official-packages": "node scripts/generate-cli-official-packages.mjs",
"generate:neutral-palette-refs": "node scripts/generate-neutral-palette-refs.mjs",
"check:neutral-palette-refs": "node scripts/generate-neutral-palette-refs.mjs --check",
+ "generate:stone-palette-refs": "node scripts/generate-stone-palette-refs.mjs",
+ "check:stone-palette-refs": "node scripts/generate-stone-palette-refs.mjs --check",
"dev": "pnpm -F @astryxdesign/storybook dev",
"test": "vitest run",
"test:watch": "vitest",
@@ -16,7 +18,7 @@
"test:a11y-contract": "playwright test --config playwright.config.ts --project chromium",
"test:docsite-browser": "playwright test --config apps/docsite/playwright.config.ts",
"check:package-boundaries": "node scripts/check-package-boundaries.js",
- "check:repo": "pnpm check:visual-owner && pnpm check:sync && pnpm check:neutral-palette-refs && pnpm check:data-tokens && pnpm check:token-docs && pnpm check:knowledge && pnpm check:package-boundaries && pnpm check:changesets && pnpm check:demo-media && pnpm check:executable-bits && pnpm check:cli-structure && pnpm check:use-client && pnpm check:portable-scripts && pnpm check:i18n-runtime && pnpm check:i18n-catalog && pnpm check:cldr-weekdays && pnpm check:fixtures && pnpm check:setup-contract",
+ "check:repo": "pnpm check:visual-owner && pnpm check:sync && pnpm check:neutral-palette-refs && pnpm check:stone-palette-refs && pnpm check:data-tokens && pnpm check:token-docs && pnpm check:knowledge && pnpm check:package-boundaries && pnpm check:changesets && pnpm check:demo-media && pnpm check:executable-bits && pnpm check:cli-structure && pnpm check:use-client && pnpm check:portable-scripts && pnpm check:i18n-runtime && pnpm check:i18n-catalog && pnpm check:cldr-weekdays && pnpm check:fixtures && pnpm check:setup-contract",
"check:visual-owner": "node scripts/check-visual-workflow-owner.mjs",
"check:fixtures": "node internal/vibe-tests/scripts/fixture-suite.mjs verify",
"generate:cldr-weekdays": "node scripts/generate-cldr-weekdays.mjs",
diff --git a/packages/cli/assets/templates/themes/stone/palette.config.json b/packages/cli/assets/templates/themes/stone/palette.config.json
new file mode 100644
index 0000000000..06c1ba66a1
--- /dev/null
+++ b/packages/cli/assets/templates/themes/stone/palette.config.json
@@ -0,0 +1,262 @@
+{
+ "recipe": "astryx-oklch-v1",
+ "vibrancy": 16,
+ "neutralProfile": "neutral-v1",
+ "modeStrategy": "light-and-dark",
+ "stops": [
+ 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90,
+ 95, 100
+ ],
+ "families": [
+ {
+ "id": "neutral",
+ "name": "Stone Neutral",
+ "seed": "#77777c",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 15,
+ "color": "#25252a",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#77777c",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#e2e2e8",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 15,
+ "color": "#25252a",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#77777c",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#e2e2e8",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "red",
+ "name": "Red",
+ "seed": "#8a716d",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#8a716d",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#8a716d",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "orange",
+ "name": "Orange",
+ "seed": "#8f7154",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#8f7154",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#ffdcbb",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#8f7154",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#ffdcbb",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "yellow",
+ "name": "Yellow",
+ "seed": "#927f25",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#927f25",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#f4e1b7",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#927f25",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#f1e1b9",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "green",
+ "name": "Green",
+ "seed": "#528b49",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#528b49",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 85,
+ "color": "#bfdfbb",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#528b49",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 85,
+ "color": "#c3ddbf",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "teal",
+ "name": "Teal",
+ "seed": "#477b6b",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#588174",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#588174",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "cyan",
+ "name": "Cyan",
+ "seed": "#507b86",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#507b86",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#507b86",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "blue",
+ "name": "Blue",
+ "seed": "#6c7888",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#6c7888",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#6c7888",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "purple",
+ "name": "Purple",
+ "seed": "#7b7486",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#7b7486",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#7b7486",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "pink",
+ "name": "Pink",
+ "seed": "#83727c",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#83727c",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#83727c",
+ "policy": "exact"
+ }
+ ]
+ }
+ ]
+}
diff --git a/packages/cli/assets/templates/themes/stone/stonePaletteRefs.generated.ts b/packages/cli/assets/templates/themes/stone/stonePaletteRefs.generated.ts
new file mode 100644
index 0000000000..6653c73b40
--- /dev/null
+++ b/packages/cli/assets/templates/themes/stone/stonePaletteRefs.generated.ts
@@ -0,0 +1,51 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+// Generated from the committed full palette for the stops used by Stone's
+// theme source. Regenerate with `pnpm generate:stone-palette-refs`.
+// Keep the complete palette available for authoring and audits without
+// making consumers pay for unused palette stops.
+// prettier-ignore
+export const stonePaletteRefs = {
+ green: {
+ light: {30: '#354f31', 55: '#609757', 85: '#bfdfbb', 90: '#d2eccf'},
+ dark: {25: '#2f412c', 35: '#3e5d38', 70: '#90ba8a', 80: '#b3d0af', 90: '#d5e9d2'},
+ },
+ yellow: {
+ light: {30: '#524818', 40: '#736419', 55: '#a08c36', 85: '#e7d3a4', 90: '#f4e1b7'},
+ dark: {25: '#433b1b', 35: '#615620', 70: '#c2af6e', 80: '#d9c794', 90: '#f1e1b9'},
+ },
+ red: {
+ light: {30: '#603c37', 40: '#745752', 60: '#a98984', 85: '#f0cac4', 90: '#fbdad4'},
+ dark: {25: '#50332e', 35: '#684a45', 70: '#c6a29c', 80: '#e0bdb8', 90: '#f7dbd7'},
+ },
+ purple: {
+ light: {30: '#4c405b', 40: '#635a70', 85: '#d9cfea', 90: '#e7def5'},
+ dark: {25: '#3f374c', 35: '#574e64', 70: '#b0a5c0', 90: '#e6def3'},
+ },
+ teal: {
+ light: {30: '#2c4f44', 40: '#40675c', 85: '#c3dbd2', 90: '#d4e8e1'},
+ dark: {25: '#274239', 35: '#3a5b50', 70: '#94b3a9', 90: '#d6e7e1'},
+ },
+ neutral: {
+ light: {0: '#000000', 15: '#25252a', 30: '#46464e', 40: '#5f5f64', 55: '#848489', 85: '#d4d3dd', 90: '#e2e2e8', 95: '#f0f0f7', 100: '#ffffff'},
+ dark: {0: '#000000', 5: '#101018', 10: '#1b1b21', 15: '#25252a', 20: '#302f36', 25: '#3a3a42', 35: '#525159', 40: '#5e5e64', 65: '#9d9ea5', 70: '#ababb3', 90: '#e2e2e8', 95: '#f0f0f9', 100: '#ffffff'},
+ },
+ orange: {
+ dark: {25: '#4e3522', 35: '#684c34', 70: '#c9a382', 90: '#ffdcbb'},
+ light: {30: '#5e3f27', 85: '#f2cdaa', 90: '#ffdcbb'},
+ },
+ blue: {
+ light: {30: '#344861', 40: '#516074', 85: '#c2d6f1', 90: '#d3e4fc'},
+ dark: {25: '#2c3c52', 35: '#445469', 70: '#9aadc7', 90: '#d5e4f8'},
+ },
+ cyan: {
+ light: {30: '#264d57', 85: '#badbe4', 90: '#cbe9f0'},
+ dark: {25: '#234048', 35: '#345761', 90: '#cfe8ee'},
+ },
+ pink: {
+ light: {30: '#5a3c4f', 85: '#e9cadc', 90: '#f5d9ea'},
+ dark: {25: '#4b3242', 35: '#624a59', 90: '#f2dbe8'},
+ },
+} as const;
+
+export default stonePaletteRefs;
diff --git a/packages/cli/assets/templates/themes/stone/stonePalettes.generated.receipt.json b/packages/cli/assets/templates/themes/stone/stonePalettes.generated.receipt.json
new file mode 100644
index 0000000000..f1630c1948
--- /dev/null
+++ b/packages/cli/assets/templates/themes/stone/stonePalettes.generated.receipt.json
@@ -0,0 +1,840 @@
+{
+ "schemaVersion": 1,
+ "recipe": "astryx-oklch-v1",
+ "generatorVersion": "palette-generator-v1",
+ "candidateFormatVersion": "palette-typescript-v1",
+ "candidateSha256": "7f78a3fd8477342eaa6ecffdc5d6d0026804857383933cd882da47858a091a58",
+ "preview": {
+ "version": "palette-preview-v1",
+ "sha256": "e8eebb814aab58152064b6c5fc57c2a147a077378c062d000beb1e659b5901fc"
+ },
+ "request": {
+ "recipe": "astryx-oklch-v1",
+ "vibrancy": 16,
+ "neutralProfile": "neutral-v1",
+ "modeStrategy": "light-and-dark",
+ "stops": [
+ 0,
+ 5,
+ 10,
+ 15,
+ 20,
+ 25,
+ 30,
+ 35,
+ 40,
+ 45,
+ 50,
+ 55,
+ 60,
+ 65,
+ 70,
+ 75,
+ 80,
+ 85,
+ 90,
+ 95,
+ 100
+ ],
+ "families": [
+ {
+ "id": "neutral",
+ "name": "Stone Neutral",
+ "seed": "#77777c",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 15,
+ "color": "#25252a",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#77777c",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#e2e2e8",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 15,
+ "color": "#25252a",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#77777c",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#e2e2e8",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "red",
+ "name": "Red",
+ "seed": "#8a716d",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#8a716d",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#8a716d",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "orange",
+ "name": "Orange",
+ "seed": "#8f7154",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#8f7154",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#ffdcbb",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#8f7154",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#ffdcbb",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "yellow",
+ "name": "Yellow",
+ "seed": "#927f25",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#927f25",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#f4e1b7",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#927f25",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#f1e1b9",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "green",
+ "name": "Green",
+ "seed": "#528b49",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#528b49",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 85,
+ "color": "#bfdfbb",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#528b49",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 85,
+ "color": "#c3ddbf",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "teal",
+ "name": "Teal",
+ "seed": "#477b6b",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#588174",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#588174",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "cyan",
+ "name": "Cyan",
+ "seed": "#507b86",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#507b86",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#507b86",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "blue",
+ "name": "Blue",
+ "seed": "#6c7888",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#6c7888",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#6c7888",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "purple",
+ "name": "Purple",
+ "seed": "#7b7486",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#7b7486",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#7b7486",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "pink",
+ "name": "Pink",
+ "seed": "#83727c",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#83727c",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#83727c",
+ "policy": "exact"
+ }
+ ]
+ }
+ ]
+ },
+ "diagnostics": {
+ "families": {
+ "neutral": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.089366176643976,
+ "maximumAdjacentDeltaE": 17.860647502746772,
+ "maximumHueDrift": 4.1859335840684935,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 15,
+ "color": "#25252a",
+ "policy": "exact",
+ "generatedColor": "#25252a",
+ "deltaE": 0
+ },
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#77777c",
+ "policy": "exact",
+ "generatedColor": "#77777c",
+ "deltaE": 0
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#e2e2e8",
+ "policy": "exact",
+ "generatedColor": "#e2e2e8",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.15817850570346,
+ "maximumAdjacentDeltaE": 17.782656515036848,
+ "maximumHueDrift": 2.106853838233974,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 15,
+ "color": "#25252a",
+ "policy": "exact",
+ "generatedColor": "#25252a",
+ "deltaE": 0
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#77777c",
+ "policy": "exact",
+ "generatedColor": "#77777c",
+ "deltaE": 0
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#e2e2e8",
+ "policy": "exact",
+ "generatedColor": "#e2e2e8",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "red": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.171807101407877,
+ "maximumAdjacentDeltaE": 17.973198569331565,
+ "maximumHueDrift": 2.6372728345744463,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#8a716d",
+ "policy": "exact",
+ "generatedColor": "#8a716d",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.101761660541818,
+ "maximumAdjacentDeltaE": 17.799233134343268,
+ "maximumHueDrift": 2.101410674891781,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#8a716d",
+ "policy": "exact",
+ "generatedColor": "#8a716d",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "orange": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.086930316646607,
+ "maximumAdjacentDeltaE": 17.92561511794591,
+ "maximumHueDrift": 9.743415311153512,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#8f7154",
+ "policy": "exact",
+ "generatedColor": "#8f7154",
+ "deltaE": 0
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#ffdcbb",
+ "policy": "exact",
+ "generatedColor": "#ffdcbb",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.131278916946704,
+ "maximumAdjacentDeltaE": 17.990828217014066,
+ "maximumHueDrift": 10.240381416912442,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#8f7154",
+ "policy": "exact",
+ "generatedColor": "#8f7154",
+ "deltaE": 0
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#ffdcbb",
+ "policy": "exact",
+ "generatedColor": "#ffdcbb",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "yellow": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 3.7859989136161247,
+ "maximumAdjacentDeltaE": 18.070620631207497,
+ "maximumHueDrift": 10.04987648078145,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#927f25",
+ "policy": "exact",
+ "generatedColor": "#927f25",
+ "deltaE": 0
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#f4e1b7",
+ "policy": "exact",
+ "generatedColor": "#f4e1b7",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 3.731841860883646,
+ "maximumAdjacentDeltaE": 17.90573562079554,
+ "maximumHueDrift": 8.261902963361536,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#927f25",
+ "policy": "exact",
+ "generatedColor": "#927f25",
+ "deltaE": 0
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#f1e1b9",
+ "policy": "exact",
+ "generatedColor": "#f1e1b9",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "green": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.105898582022621,
+ "maximumAdjacentDeltaE": 17.939005433381325,
+ "maximumHueDrift": 1.636644133489085,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#528b49",
+ "policy": "exact",
+ "generatedColor": "#528b49",
+ "deltaE": 0
+ },
+ {
+ "mode": "light",
+ "stop": 85,
+ "color": "#bfdfbb",
+ "policy": "exact",
+ "generatedColor": "#bfdfbb",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.117685471243426,
+ "maximumAdjacentDeltaE": 18.013733837580684,
+ "maximumHueDrift": 1.056905311031528,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#528b49",
+ "policy": "exact",
+ "generatedColor": "#528b49",
+ "deltaE": 0
+ },
+ {
+ "mode": "dark",
+ "stop": 85,
+ "color": "#c3ddbf",
+ "policy": "exact",
+ "generatedColor": "#c3ddbf",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "teal": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.14745104766057,
+ "maximumAdjacentDeltaE": 17.722505270600053,
+ "maximumHueDrift": 2.5965005719581313,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#588174",
+ "policy": "exact",
+ "generatedColor": "#588174",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.0627611605620135,
+ "maximumAdjacentDeltaE": 17.855525302822763,
+ "maximumHueDrift": 2.7322271800874205,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#588174",
+ "policy": "exact",
+ "generatedColor": "#588174",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "cyan": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 3.5227134988318927,
+ "maximumAdjacentDeltaE": 17.97427597317998,
+ "maximumHueDrift": 1.8393988891423305,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#507b86",
+ "policy": "exact",
+ "generatedColor": "#507b86",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 3.7688695276724227,
+ "maximumAdjacentDeltaE": 17.704014854698976,
+ "maximumHueDrift": 3.034371827797827,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#507b86",
+ "policy": "exact",
+ "generatedColor": "#507b86",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "blue": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.030638539167886,
+ "maximumAdjacentDeltaE": 17.88930396437638,
+ "maximumHueDrift": 1.7367472797280925,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#6c7888",
+ "policy": "exact",
+ "generatedColor": "#6c7888",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.039628702422973,
+ "maximumAdjacentDeltaE": 17.76797533894901,
+ "maximumHueDrift": 2.3791375058722224,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#6c7888",
+ "policy": "exact",
+ "generatedColor": "#6c7888",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "purple": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.0935894189320905,
+ "maximumAdjacentDeltaE": 17.910601695842214,
+ "maximumHueDrift": 1.8846988428999794,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#7b7486",
+ "policy": "exact",
+ "generatedColor": "#7b7486",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.07854632694844,
+ "maximumAdjacentDeltaE": 17.733749538789144,
+ "maximumHueDrift": 1.9920206687669406,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#7b7486",
+ "policy": "exact",
+ "generatedColor": "#7b7486",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "pink": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.163653937894069,
+ "maximumAdjacentDeltaE": 18.114687743880147,
+ "maximumHueDrift": 1.4177887428506892,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#83727c",
+ "policy": "exact",
+ "generatedColor": "#83727c",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.100692959603493,
+ "maximumAdjacentDeltaE": 17.693194967894105,
+ "maximumHueDrift": 2.3994811243924232,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#83727c",
+ "policy": "exact",
+ "generatedColor": "#83727c",
+ "deltaE": 0
+ }
+ ]
+ }
+ }
+ },
+ "coordination": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "closestFamilies": [
+ "Purple",
+ "Pink"
+ ],
+ "minimumFamilyDeltaE": 1.8118874213513319,
+ "strongestFamily": "Green",
+ "weakestFamily": "Stone Neutral",
+ "chromaRatio": 15.019610969325289
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "closestFamilies": [
+ "Purple",
+ "Pink"
+ ],
+ "minimumFamilyDeltaE": 1.8118874213513319,
+ "strongestFamily": "Green",
+ "weakestFamily": "Stone Neutral",
+ "chromaRatio": 15.019610969325289
+ }
+ ]
+ }
+}
diff --git a/packages/cli/assets/templates/themes/stone/stonePalettes.generated.ts b/packages/cli/assets/templates/themes/stone/stonePalettes.generated.ts
new file mode 100644
index 0000000000..da19eb4b9c
--- /dev/null
+++ b/packages/cli/assets/templates/themes/stone/stonePalettes.generated.ts
@@ -0,0 +1,501 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+// Generated by astryx-oklch-v1. Review before committing.
+export const black = '#000000' as const;
+export const white = '#ffffff' as const;
+
+// prettier-ignore
+export const palette = {
+ "neutral": {
+ "name": "Stone Neutral",
+ "light": {
+ "0": "#000000",
+ "5": "#101019",
+ "10": "#1b1b21",
+ "15": "#25252a",
+ "20": "#2f2f36",
+ "25": "#3a3a42",
+ "30": "#46464e",
+ "35": "#525259",
+ "40": "#5f5f64",
+ "45": "#6b6b6f",
+ "50": "#77777c",
+ "55": "#848489",
+ "60": "#919197",
+ "65": "#9e9da5",
+ "70": "#ababb3",
+ "75": "#b8b8c2",
+ "80": "#c6c5d0",
+ "85": "#d4d3dd",
+ "90": "#e2e2e8",
+ "95": "#f0f0f7",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#101018",
+ "10": "#1b1b21",
+ "15": "#25252a",
+ "20": "#302f36",
+ "25": "#3a3a42",
+ "30": "#46464e",
+ "35": "#525159",
+ "40": "#5e5e64",
+ "45": "#6a6a70",
+ "50": "#77777c",
+ "55": "#838489",
+ "60": "#909097",
+ "65": "#9d9ea5",
+ "70": "#ababb3",
+ "75": "#b8b8c2",
+ "80": "#c6c6cf",
+ "85": "#d4d4dd",
+ "90": "#e2e2e8",
+ "95": "#f0f0f9",
+ "100": "#ffffff"
+ }
+ },
+ "red": {
+ "name": "Red",
+ "light": {
+ "0": "#000000",
+ "5": "#1c0c09",
+ "10": "#2b1411",
+ "15": "#381d19",
+ "20": "#462722",
+ "25": "#53312c",
+ "30": "#603c37",
+ "35": "#6a4943",
+ "40": "#745752",
+ "45": "#7e6460",
+ "50": "#8a716d",
+ "55": "#987d79",
+ "60": "#a98984",
+ "65": "#ba948e",
+ "70": "#caa099",
+ "75": "#d8ada6",
+ "80": "#e4bcb5",
+ "85": "#f0cac4",
+ "90": "#fbdad4",
+ "95": "#ffece9",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#1b0c0a",
+ "10": "#291613",
+ "15": "#361f1b",
+ "20": "#432825",
+ "25": "#50332e",
+ "30": "#5c3e3a",
+ "35": "#684a45",
+ "40": "#735752",
+ "45": "#7d6460",
+ "50": "#8a716d",
+ "55": "#987e79",
+ "60": "#a78985",
+ "65": "#b79590",
+ "70": "#c6a29c",
+ "75": "#d4afa9",
+ "80": "#e0bdb8",
+ "85": "#ecccc7",
+ "90": "#f7dbd7",
+ "95": "#ffece9",
+ "100": "#ffffff"
+ }
+ },
+ "orange": {
+ "name": "Orange",
+ "light": {
+ "0": "#000000",
+ "5": "#1b0d04",
+ "10": "#291607",
+ "15": "#36200d",
+ "20": "#442a14",
+ "25": "#51341d",
+ "30": "#5e3f27",
+ "35": "#6a4a31",
+ "40": "#77573c",
+ "45": "#836448",
+ "50": "#8f7154",
+ "55": "#9c7d5f",
+ "60": "#aa8a6b",
+ "65": "#b99776",
+ "70": "#c8a382",
+ "75": "#d7b18d",
+ "80": "#e5be9b",
+ "85": "#f2cdaa",
+ "90": "#ffdcbb",
+ "95": "#ffeddd",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#1a0e05",
+ "10": "#28170b",
+ "15": "#342112",
+ "20": "#412b19",
+ "25": "#4e3522",
+ "30": "#5b402b",
+ "35": "#684c34",
+ "40": "#75583f",
+ "45": "#836448",
+ "50": "#8f7154",
+ "55": "#9c7e5f",
+ "60": "#ab8b6b",
+ "65": "#ba9777",
+ "70": "#c9a382",
+ "75": "#d6b18e",
+ "80": "#e5be9c",
+ "85": "#f2cdab",
+ "90": "#ffdcbb",
+ "95": "#ffeedd",
+ "100": "#ffffff"
+ }
+ },
+ "yellow": {
+ "name": "Yellow",
+ "light": {
+ "0": "#000000",
+ "5": "#151101",
+ "10": "#211b02",
+ "15": "#2d2605",
+ "20": "#38300b",
+ "25": "#443b13",
+ "30": "#524818",
+ "35": "#61551a",
+ "40": "#736419",
+ "45": "#83721a",
+ "50": "#927f25",
+ "55": "#a08c36",
+ "60": "#ac9848",
+ "65": "#b8a35a",
+ "70": "#c3af6c",
+ "75": "#cfbb7f",
+ "80": "#dbc790",
+ "85": "#e7d3a4",
+ "90": "#f4e1b7",
+ "95": "#fdf0d3",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#141103",
+ "10": "#201b06",
+ "15": "#2c260c",
+ "20": "#373013",
+ "25": "#433b1b",
+ "30": "#514821",
+ "35": "#615620",
+ "40": "#72641d",
+ "45": "#84721b",
+ "50": "#927f25",
+ "55": "#a08c37",
+ "60": "#ab9849",
+ "65": "#b7a45b",
+ "70": "#c2af6e",
+ "75": "#cdba81",
+ "80": "#d9c794",
+ "85": "#e5d3a6",
+ "90": "#f1e1b9",
+ "95": "#fbf0d5",
+ "100": "#ffffff"
+ }
+ },
+ "green": {
+ "name": "Green",
+ "light": {
+ "0": "#000000",
+ "5": "#0a1408",
+ "10": "#122010",
+ "15": "#1a2b17",
+ "20": "#233620",
+ "25": "#2d4229",
+ "30": "#354f31",
+ "35": "#3c5e37",
+ "40": "#416d3b",
+ "45": "#487d40",
+ "50": "#528b49",
+ "55": "#609757",
+ "60": "#6ea366",
+ "65": "#7eaf76",
+ "70": "#8ebb87",
+ "75": "#9fc798",
+ "80": "#b0d3aa",
+ "85": "#bfdfbb",
+ "90": "#d2eccf",
+ "95": "#e7f6e5",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#0b1409",
+ "10": "#141f12",
+ "15": "#1c2a1a",
+ "20": "#253523",
+ "25": "#2f412c",
+ "30": "#384e35",
+ "35": "#3e5d38",
+ "40": "#426d3b",
+ "45": "#487d40",
+ "50": "#528b49",
+ "55": "#609857",
+ "60": "#6fa467",
+ "65": "#80af78",
+ "70": "#90ba8a",
+ "75": "#a3c59d",
+ "80": "#b3d0af",
+ "85": "#c3ddbf",
+ "90": "#d5e9d2",
+ "95": "#e9f4e7",
+ "100": "#ffffff"
+ }
+ },
+ "teal": {
+ "name": "Teal",
+ "light": {
+ "0": "#000000",
+ "5": "#051410",
+ "10": "#0a201a",
+ "15": "#112b24",
+ "20": "#19372e",
+ "25": "#224339",
+ "30": "#2c4f44",
+ "35": "#365b50",
+ "40": "#40675c",
+ "45": "#4c7468",
+ "50": "#588174",
+ "55": "#658e81",
+ "60": "#729b8e",
+ "65": "#81a89b",
+ "70": "#91b4a8",
+ "75": "#a1c1b6",
+ "80": "#b2cec4",
+ "85": "#c3dbd2",
+ "90": "#d4e8e1",
+ "95": "#e6f5ef",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#071410",
+ "10": "#0e201a",
+ "15": "#152b24",
+ "20": "#1e362f",
+ "25": "#274239",
+ "30": "#304e45",
+ "35": "#3a5b50",
+ "40": "#43675b",
+ "45": "#4d7567",
+ "50": "#588174",
+ "55": "#668e80",
+ "60": "#749a8d",
+ "65": "#84a79b",
+ "70": "#94b3a9",
+ "75": "#a5c0b7",
+ "80": "#b5cdc5",
+ "85": "#c6dad3",
+ "90": "#d6e7e1",
+ "95": "#e7f4f0",
+ "100": "#ffffff"
+ }
+ },
+ "cyan": {
+ "name": "Cyan",
+ "light": {
+ "0": "#000000",
+ "5": "#031418",
+ "10": "#061f25",
+ "15": "#0c2a31",
+ "20": "#14363e",
+ "25": "#1d414a",
+ "30": "#264d57",
+ "35": "#305862",
+ "40": "#3a646e",
+ "45": "#446e79",
+ "50": "#507b86",
+ "55": "#5d8893",
+ "60": "#6c96a1",
+ "65": "#7ba5b0",
+ "70": "#8ab3be",
+ "75": "#99c1cb",
+ "80": "#a9ced8",
+ "85": "#badbe4",
+ "90": "#cbe9f0",
+ "95": "#def6fc",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#051317",
+ "10": "#0b1f24",
+ "15": "#122a30",
+ "20": "#1a353c",
+ "25": "#234048",
+ "30": "#2c4c54",
+ "35": "#345761",
+ "40": "#3c636d",
+ "45": "#456e79",
+ "50": "#507b86",
+ "55": "#5d8893",
+ "60": "#6e96a0",
+ "65": "#7ea4ae",
+ "70": "#8fb2bb",
+ "75": "#9ebfc8",
+ "80": "#aecdd5",
+ "85": "#bedae2",
+ "90": "#cfe8ee",
+ "95": "#e1f5fa",
+ "100": "#ffffff"
+ }
+ },
+ "blue": {
+ "name": "Blue",
+ "light": {
+ "0": "#000000",
+ "5": "#08111e",
+ "10": "#0f1c2d",
+ "15": "#17263a",
+ "20": "#203148",
+ "25": "#293c56",
+ "30": "#344861",
+ "35": "#42546b",
+ "40": "#516074",
+ "45": "#5f6b7c",
+ "50": "#6c7888",
+ "55": "#788597",
+ "60": "#8292a8",
+ "65": "#8ba0ba",
+ "70": "#96adcb",
+ "75": "#a4bbda",
+ "80": "#b3c9e6",
+ "85": "#c2d6f1",
+ "90": "#d3e4fc",
+ "95": "#e8f2ff",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#09111c",
+ "10": "#111c2a",
+ "15": "#1a2637",
+ "20": "#233145",
+ "25": "#2c3c52",
+ "30": "#37485e",
+ "35": "#445469",
+ "40": "#515f72",
+ "45": "#5f6b7c",
+ "50": "#6c7888",
+ "55": "#778596",
+ "60": "#8292a6",
+ "65": "#8ea0b7",
+ "70": "#9aadc7",
+ "75": "#a7bbd5",
+ "80": "#b6c8e1",
+ "85": "#c5d6ed",
+ "90": "#d5e4f8",
+ "95": "#e8f2ff",
+ "100": "#ffffff"
+ }
+ },
+ "purple": {
+ "name": "Purple",
+ "light": {
+ "0": "#000000",
+ "5": "#130e1b",
+ "10": "#1f1828",
+ "15": "#2a2135",
+ "20": "#352b42",
+ "25": "#40364f",
+ "30": "#4c405b",
+ "35": "#574d66",
+ "40": "#635a70",
+ "45": "#6f677a",
+ "50": "#7b7486",
+ "55": "#888094",
+ "60": "#968ca4",
+ "65": "#a398b4",
+ "70": "#b1a4c4",
+ "75": "#beb2d2",
+ "80": "#ccc0de",
+ "85": "#d9cfea",
+ "90": "#e7def5",
+ "95": "#f4edff",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#130e19",
+ "10": "#1e1827",
+ "15": "#292233",
+ "20": "#342c40",
+ "25": "#3f374c",
+ "30": "#4b4258",
+ "35": "#574e64",
+ "40": "#625b6f",
+ "45": "#6f687a",
+ "50": "#7b7486",
+ "55": "#888194",
+ "60": "#958da2",
+ "65": "#a399b1",
+ "70": "#b0a5c0",
+ "75": "#beb3ce",
+ "80": "#cbc1da",
+ "85": "#d9d0e7",
+ "90": "#e6def3",
+ "95": "#f4edfe",
+ "100": "#ffffff"
+ }
+ },
+ "pink": {
+ "name": "Pink",
+ "light": {
+ "0": "#000000",
+ "5": "#1a0c15",
+ "10": "#271420",
+ "15": "#341d2c",
+ "20": "#412737",
+ "25": "#4e3143",
+ "30": "#5a3c4f",
+ "35": "#644959",
+ "40": "#6e5765",
+ "45": "#786470",
+ "50": "#83727c",
+ "55": "#927d89",
+ "60": "#a28898",
+ "65": "#b394a6",
+ "70": "#c39fb4",
+ "75": "#d1adc2",
+ "80": "#ddbbcf",
+ "85": "#e9cadc",
+ "90": "#f5d9ea",
+ "95": "#ffeaf6",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#180c14",
+ "10": "#261620",
+ "15": "#321f2b",
+ "20": "#3e2836",
+ "25": "#4b3242",
+ "30": "#573e4e",
+ "35": "#624a59",
+ "40": "#6d5864",
+ "45": "#776570",
+ "50": "#83727c",
+ "55": "#917d89",
+ "60": "#a08997",
+ "65": "#b095a5",
+ "70": "#bfa1b3",
+ "75": "#cdaec1",
+ "80": "#dabdce",
+ "85": "#e6ccdb",
+ "90": "#f2dbe8",
+ "95": "#fdebf6",
+ "100": "#ffffff"
+ }
+ }
+} as const;
+
+export default palette;
diff --git a/packages/cli/assets/templates/themes/stone/stoneTheme.ts b/packages/cli/assets/templates/themes/stone/stoneTheme.ts
index 6a299170a5..144336fe44 100644
--- a/packages/cli/assets/templates/themes/stone/stoneTheme.ts
+++ b/packages/cli/assets/templates/themes/stone/stoneTheme.ts
@@ -4,65 +4,66 @@
* Stone Theme
*
* A warm, earthy neutral theme inspired by natural stone and sandstone.
- * Core palette: #28282A, #84848B, #D8D8DB, #f3f3f5, #FFFFFF
+ * Colors reference the reviewed Stone palette generated from palette.config.json.
* Montserrat for headings, Figtree for body, JetBrains Mono for code.
*/
import {defineTheme, defineSyntaxTheme} from '@astryxdesign/core/theme';
import {stoneIconRegistry} from './icons';
+import {stonePaletteRefs} from './stonePaletteRefs.generated';
+
+const {blue, cyan, green, neutral, orange, pink, purple, red, teal, yellow} =
+ stonePaletteRefs;
+
+const lightDark = (light: string, dark: string): string =>
+ `light-dark(${light}, ${dark})`;
+const withAlpha = (color: string, alpha: string): string => `${color}${alpha}`;
/**
- * Input status border overrides (per-component, per-status). All 9 input
- * components share inputStatusBorderStyles in core, which read
- * --color-{success,warning,error} (T30 light / T80 dark = saturated text
- * tone). Stone redefines those vars inside each input's status scope to
- * T60 light / T70 dark so the border (and the matching status icon) reads
- * as a softer hue rim, in line with the gentle T90 status message bubble.
+ * Input status borders and icons use softer mid-ramp stops than status text.
+ * All supported input components share this one mapping so their status
+ * treatment remains consistent.
*/
const INPUT_STATUS_VARS = {
'status:success': {
- '--color-success': 'light-dark(#7f977e, #99b298)', // Green T60 / T70
+ '--color-success': lightDark(green.light[55], green.dark[70]),
},
'status:warning': {
- '--color-warning': 'light-dark(#9f8f68, #bbaa81)', // Yellow T60 / T70
+ '--color-warning': lightDark(yellow.light[55], yellow.dark[70]),
},
'status:error': {
- '--color-error': 'light-dark(#a58b86, #c0a5a1)', // Red T60 / T70
+ '--color-error': lightDark(red.light[60], red.dark[70]),
},
} as const;
/**
- * Stone syntax palette — light values snap to T40 / T45 stops on the
- * stone categorical ramps (per audit drawer); dark values stay at T70.
- *
- * `string` and `property` both land on Teal T40 — intentional; the audit
- * unified them since green and teal are visually adjacent at T40 and
- * the stone neutral palette doesn't carry a distinct green stop.
+ * Stone syntax uses mid-ramp colors in light mode and lighter stops in dark
+ * mode. Light strings and properties share Teal; dark strings use Green 70,
+ * while dark properties remain Teal.
*/
const stoneSyntax = defineSyntaxTheme({
name: 'astryx-stone',
tokens: {
- keyword: ['#645a72', '#b2a7c1'], // Purple T40 / T70
- string: ['#4e6357', '#9bb19a'], // Teal T40 / Green T70
- comment: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70
- number: ['#755752', '#bea792'], // Red T40 / Orange T70
- function: ['#506072', '#99adc6'], // Blue T40 / T70
- type: ['#645a72', '#b2a7c1'], // Purple T40 / T70
- variable: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70
- operator: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70
- constant: ['#755752', '#bea792'], // Red T40 / Orange T70
- tag: ['#775751', '#c7a39d'], // Red T40 / T70
- attribute: ['#79693f', '#b6aa90'], // Yellow T45 / T70
- property: ['#4e6357', '#94b2a0'], // Teal T40 / T70
- punctuation: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70
- background: ['#f3f3f5', '#171719'],
- // Diff rows: the muted green/red at 25% in light and 20% in dark keep
- // every token at or above 4.5:1 on the tint; the markers are the tinted
- // text tokens (8.1:1 light, 8.8:1 dark on their tints).
- added: ['#d0e9ce40', '#b4cdb233'],
- removed: ['#f9dcd740', '#dcc0bc33'],
- 'added-marker': ['#374c36', '#d0e9ce'],
- 'removed-marker': ['#58413e', '#f9dcd7'],
+ keyword: [purple.light[40], purple.dark[70]],
+ string: [teal.light[40], green.dark[70]],
+ comment: [neutral.light[40], neutral.dark[70]],
+ number: [red.light[40], orange.dark[70]],
+ function: [blue.light[40], blue.dark[70]],
+ type: [purple.light[40], purple.dark[70]],
+ variable: [neutral.light[40], neutral.dark[70]],
+ operator: [neutral.light[40], neutral.dark[70]],
+ constant: [red.light[40], orange.dark[70]],
+ tag: [red.light[40], red.dark[70]],
+ attribute: [yellow.light[40], yellow.dark[70]],
+ property: [teal.light[40], teal.dark[70]],
+ punctuation: [neutral.light[40], neutral.dark[70]],
+ background: [neutral.light[95], neutral.dark[5]],
+ // Translucent diff rows retain each token's contrast while the opaque
+ // markers carry the same Green and Red families as their row tint.
+ added: [withAlpha(green.light[90], '40'), withAlpha(green.dark[80], '33')],
+ removed: [withAlpha(red.light[90], '40'), withAlpha(red.dark[80], '33')],
+ 'added-marker': [green.light[30], green.dark[90]],
+ 'removed-marker': [red.light[30], red.dark[90]],
},
});
@@ -151,145 +152,135 @@ export const stoneTheme = defineTheme({
syntax: stoneSyntax,
tokens: {
- // =========================================================================
- // Colors — warm stone palette
- // Core: #28282A, #84848B, #D8D8DB, #f3f3f5, #FFFFFF
- // =========================================================================
-
- // Core semantic — all neutrals H=291
- // Stone 900 T=16 C=1.4, Stone 500 T=55 C=4, Stone 300 T=86 C=1.6, Stone 100 T=96 C=1
- '--color-accent': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15
- '--color-accent-muted': ['#25252a14', '#f3f3f520'], // light: Stone Neutral T15 · 8% / dark: T96 · 12.5%
- '--color-neutral': ['#25252a0f', '#f3f3f51a'], // light: Stone Neutral T15 · 6% / dark: T96 · 10%
- '--color-background-surface': ['#ffffff', '#1b1b1f'], // dark: Stone Neutral T10
- '--color-background-body': ['#f3f3f5', '#111015'], // dark: Stone Neutral T5
- '--color-overlay': ['#25252a80', '#28282acc'], // light: Stone Neutral T15 · 50% / dark: 80%
- '--color-overlay-hover': ['#25252a0d', '#f3f3f50d'], // light: Stone Neutral T15 · 5% / dark: T96 · 5%
- '--color-overlay-pressed': ['#25252a1a', '#f3f3f51a'], // light: Stone Neutral T15 · 10% / dark: T96 · 10%
- '--color-background-muted': ['#e2e2e8', '#3b3b3f'], // light: Stone Neutral T90
-
- // Text — H=291
- '--color-text-primary': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15
- // T40/T70 keeps normal secondary text above AA on every stone surface,
- // including the muted and tinted fills that components pair it with.
- '--color-text-secondary': ['#5e5e63', '#ababb0'], // Stone Neutral T40 / T70
- '--color-text-disabled': ['#d7d7da', '#5e5e61'], // T86 C=1.6 / T40 C=2
- '--color-text-accent': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15
- '--color-on-dark': '#FFFFFF',
- '--color-on-light': ['#25252a', '#28282a'], // light: Stone Neutral T15
- '--color-on-accent': ['#ffffff', '#25252a'], // dark: Stone Neutral T15
- // Text on top of matching status surface (badge fill, banner content).
- '--color-on-success': ['#374c36', '#d0e9ce'], // Green T30 / T90
- '--color-on-error': ['#58413e', '#f9dcd7'], // Red T30 / T90
- '--color-on-warning': ['#524622', '#f4e1b7'], // Yellow T30 / T90
-
- // Icon — H=291
- '--color-icon-accent': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15
- '--color-icon-primary': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15
- '--color-icon-secondary': ['#83838a', '#9d9da3'], // T55 C=4 / T65 C=3
- '--color-icon-disabled': ['#d7d7da', '#5e5e61'], // T86 C=1.6 / T40 C=2
-
- // Surface variants — H=291
- '--color-background-card': ['#FFFFFF', '#242325'], // T14
- '--color-background-popover': ['#ffffff', '#25252a'], // dark: Stone Neutral T15
- '--color-background-inverted': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15
-
- // Status / Sentiment — T50 from palette for icons/borders (visible color)
- '--color-success': ['#374c36', '#b4cdb2'], // Green T30 / T80
- '--color-success-muted': ['#d0e9ce', '#b4cdb2'], // Green T90 / T80
- '--color-error': ['#58413e', '#dcc0bc'], // Red T30 / T80
- '--color-error-muted': ['#f9dcd7', '#dcc0bc'], // Red T90 / T80
- '--color-warning': ['#524622', '#d7c59c'], // Yellow T30 / T80
- '--color-warning-muted': ['#f4e1b7', '#d7c59c'], // Yellow T90 / T80
-
- // Border — H=291
- '--color-border': ['#e2e2e8', '#f3f3f51a'], // light: Stone Neutral T90 / dark: T96 · 10%
- '--color-border-emphasized': ['#83838a', '#5e5e61'], // T55 C=4 / T40 C=2
-
- // Effects — H=291
- '--color-skeleton': ['#d4d4da', '#5e5e64'], // T85 / T40 from H=291 C=3
- '--color-shadow': ['#25252a1a', '#0000004d'], // light: Stone Neutral T15 · 10% / dark: 30%
- '--color-tint-hover': ['black', 'white'],
+ // Core neutrals
+ '--color-accent': [neutral.light[15], neutral.dark[95]],
+ '--color-accent-muted': [
+ withAlpha(neutral.light[15], '14'),
+ withAlpha(neutral.dark[95], '20'),
+ ],
+ '--color-neutral': [
+ withAlpha(neutral.light[15], '0f'),
+ withAlpha(neutral.dark[95], '1a'),
+ ],
+ '--color-background-surface': [neutral.light[100], neutral.dark[10]],
+ '--color-background-body': [neutral.light[95], neutral.dark[5]],
+ '--color-overlay': [
+ withAlpha(neutral.light[15], '80'),
+ withAlpha(neutral.dark[15], 'cc'),
+ ],
+ '--color-overlay-hover': [
+ withAlpha(neutral.light[15], '0d'),
+ withAlpha(neutral.dark[95], '0d'),
+ ],
+ '--color-overlay-pressed': [
+ withAlpha(neutral.light[15], '1a'),
+ withAlpha(neutral.dark[95], '1a'),
+ ],
+ '--color-background-muted': [neutral.light[90], neutral.dark[25]],
+
+ // Text
+ '--color-text-primary': [neutral.light[15], neutral.dark[95]],
+ // These stops keep normal secondary text readable on Stone's body,
+ // muted, and categorical surfaces.
+ '--color-text-secondary': [neutral.light[40], neutral.dark[70]],
+ '--color-text-disabled': [neutral.light[85], neutral.dark[40]],
+ '--color-text-accent': [neutral.light[15], neutral.dark[95]],
+ '--color-on-dark': neutral.light[100],
+ '--color-on-light': [neutral.light[15], neutral.dark[15]],
+ '--color-on-accent': [neutral.light[100], neutral.dark[15]],
+ '--color-on-success': [green.light[30], green.dark[90]],
+ '--color-on-error': [red.light[30], red.dark[90]],
+ '--color-on-warning': [yellow.light[30], yellow.dark[90]],
+
+ // Icon
+ '--color-icon-accent': [neutral.light[15], neutral.dark[95]],
+ '--color-icon-primary': [neutral.light[15], neutral.dark[95]],
+ '--color-icon-secondary': [neutral.light[55], neutral.dark[65]],
+ '--color-icon-disabled': [neutral.light[85], neutral.dark[40]],
+
+ // Surface variants
+ '--color-background-card': [neutral.light[100], neutral.dark[15]],
+ '--color-background-popover': [neutral.light[100], neutral.dark[20]],
+ '--color-background-inverted': [neutral.light[15], neutral.dark[95]],
+
+ // Status / sentiment
+ '--color-success': [green.light[30], green.dark[80]],
+ '--color-success-muted': [green.light[90], green.dark[80]],
+ '--color-error': [red.light[30], red.dark[80]],
+ '--color-error-muted': [red.light[90], red.dark[80]],
+ '--color-warning': [yellow.light[30], yellow.dark[80]],
+ '--color-warning-muted': [yellow.light[90], yellow.dark[80]],
+
+ // Border
+ '--color-border': [neutral.light[90], withAlpha(neutral.dark[95], '1a')],
+ '--color-border-emphasized': [neutral.light[55], neutral.dark[40]],
+
+ // Effects
+ '--color-skeleton': [neutral.light[85], neutral.dark[40]],
+ '--color-shadow': [
+ withAlpha(neutral.light[15], '1a'),
+ withAlpha(neutral.dark[0], '4d'),
+ ],
+ '--color-tint-hover': [neutral.light[0], neutral.dark[100]],
// Typography override
'--text-supporting-size': '12px',
- // Categorical hues
- // Light: T90 solid bg + T30 text (pastel surface, dark text)
- // Dark: T35 solid bg + T90 text — snaps to canonical palette stops
- // per theming-infra.mdc §7. T90 dark text is the SAME hex as
- // the light-mode bg pastel — clean palette symmetry, ~6–9:1
- // contrast on the T35 surface across all hues (passes AA Body).
- // Borders: light T85 / dark T25 — one step inward from surface in both
- // modes, matching the light-mode T90/T85 spacing.
-
- // Categorical — Blue H=265 C=10
- '--color-background-blue': ['#d7e4f5', '#485362'], // light T90 / dark T35
- '--color-border-blue': ['#c9d6e7', '#313c4a'], // light T85 / dark T25
- '--color-icon-blue': ['#3c4856', '#d7e4f5'], // light T30 / dark T90
- '--color-text-blue': ['#3c4856', '#d7e4f5'],
-
- // Categorical — Cyan H=190 C=10
- '--color-background-cyan': ['#cce8e5', '#3e5755'],
- '--color-border-cyan': ['#bedad7', '#28403e'],
- '--color-icon-cyan': ['#334b49', '#cce8e5'],
- '--color-text-cyan': ['#334b49', '#cce8e5'],
-
- // Categorical — Gray (pure neutral, C=0). Same T35/T25/T90 pattern from
- // the neutral H=291 C=3 ramp.
- '--color-background-gray': ['#e2e2e8', '#525257'], // light: Stone Neutral T90
- '--color-border-gray': ['#d4d4da', '#3b3b3f'], // light: Stone Neutral T85
- '--color-icon-gray': ['#46464b', '#e2e2e8'], // light: Stone Neutral T30
- '--color-text-gray': ['#46464b', '#e2e2e8'], // light: Stone Neutral T30
-
- // Categorical — Green H=142 C=17
- '--color-background-green': ['#d0e9ce', '#425841'],
- '--color-border-green': ['#c2dbc0', '#2b402b'],
- '--color-icon-green': ['#374c36', '#d0e9ce'],
- '--color-text-green': ['#374c36', '#d0e9ce'],
-
- // Categorical — Orange H=70 C=22
- '--color-background-orange': ['#ffdcbb', '#684d32'],
- '--color-border-orange': ['#f1ceae', '#4f361c'],
- '--color-icon-orange': ['#5b4227', '#ffdcbb'],
- '--color-text-orange': ['#5b4227', '#ffdcbb'],
-
- // Categorical — Pink H=340 C=9
- '--color-background-pink': ['#f0dde8', '#5e4e57'],
- '--color-border-pink': ['#e2cfda', '#463740'],
- '--color-icon-pink': ['#52424c', '#f0dde8'],
- '--color-text-pink': ['#52424c', '#f0dde8'],
-
- // Categorical — Purple H=307 C=11
- '--color-background-purple': ['#e8dff3', '#564f60'],
- '--color-border-purple': ['#d9d1e5', '#3f3949'],
- '--color-icon-purple': ['#4b4454', '#e8dff3'],
- '--color-text-purple': ['#4b4454', '#e8dff3'],
-
- // Categorical — Red H=33 C=11
- '--color-background-red': ['#f9dcd7', '#644d49'],
- '--color-border-red': ['#ebcec9', '#4c3633'],
- '--color-icon-red': ['#58413e', '#f9dcd7'],
- '--color-text-red': ['#58413e', '#f9dcd7'],
-
- // Categorical — Teal H=158 C=9
- '--color-background-teal': ['#d4e7dc', '#46564d'],
- '--color-border-teal': ['#c6d9ce', '#303f36'],
- '--color-icon-teal': ['#3b4a41', '#d4e7dc'],
- '--color-text-teal': ['#3b4a41', '#d4e7dc'],
-
- // Categorical — Yellow H=90 C=23
- '--color-background-yellow': ['#f4e1b7', '#5e512d'],
- '--color-border-yellow': ['#e5d3a9', '#463a18'],
- '--color-icon-yellow': ['#524622', '#f4e1b7'],
- '--color-text-yellow': ['#524622', '#f4e1b7'],
-
- // =========================================================================
- // Radius — clean and subtle
- // --radius-none and --radius-full are always fixed and must never be
- // scaled by a theme (see defineTheme's radius config docs) — 0 and
- // 9999px respectively, matching @astryxdesign/core's own defaults.
- // =========================================================================
+ // Categorical
+ // Light mode pairs pastel stop 90 surfaces with stop 30 foregrounds.
+ // Dark mode pairs stop 35 surfaces with stop 90 foregrounds; borders move
+ // one step inward in both modes.
+ '--color-background-blue': [blue.light[90], blue.dark[35]],
+ '--color-border-blue': [blue.light[85], blue.dark[25]],
+ '--color-icon-blue': [blue.light[30], blue.dark[90]],
+ '--color-text-blue': [blue.light[30], blue.dark[90]],
+
+ '--color-background-cyan': [cyan.light[90], cyan.dark[35]],
+ '--color-border-cyan': [cyan.light[85], cyan.dark[25]],
+ '--color-icon-cyan': [cyan.light[30], cyan.dark[90]],
+ '--color-text-cyan': [cyan.light[30], cyan.dark[90]],
+
+ '--color-background-gray': [neutral.light[90], neutral.dark[35]],
+ '--color-border-gray': [neutral.light[85], neutral.dark[25]],
+ '--color-icon-gray': [neutral.light[30], neutral.dark[90]],
+ '--color-text-gray': [neutral.light[30], neutral.dark[90]],
+
+ '--color-background-green': [green.light[90], green.dark[35]],
+ '--color-border-green': [green.light[85], green.dark[25]],
+ '--color-icon-green': [green.light[30], green.dark[90]],
+ '--color-text-green': [green.light[30], green.dark[90]],
+
+ '--color-background-orange': [orange.light[90], orange.dark[35]],
+ '--color-border-orange': [orange.light[85], orange.dark[25]],
+ '--color-icon-orange': [orange.light[30], orange.dark[90]],
+ '--color-text-orange': [orange.light[30], orange.dark[90]],
+
+ '--color-background-pink': [pink.light[90], pink.dark[35]],
+ '--color-border-pink': [pink.light[85], pink.dark[25]],
+ '--color-icon-pink': [pink.light[30], pink.dark[90]],
+ '--color-text-pink': [pink.light[30], pink.dark[90]],
+
+ '--color-background-purple': [purple.light[90], purple.dark[35]],
+ '--color-border-purple': [purple.light[85], purple.dark[25]],
+ '--color-icon-purple': [purple.light[30], purple.dark[90]],
+ '--color-text-purple': [purple.light[30], purple.dark[90]],
+
+ '--color-background-red': [red.light[90], red.dark[35]],
+ '--color-border-red': [red.light[85], red.dark[25]],
+ '--color-icon-red': [red.light[30], red.dark[90]],
+ '--color-text-red': [red.light[30], red.dark[90]],
+
+ '--color-background-teal': [teal.light[90], teal.dark[35]],
+ '--color-border-teal': [teal.light[85], teal.dark[25]],
+ '--color-icon-teal': [teal.light[30], teal.dark[90]],
+ '--color-text-teal': [teal.light[30], teal.dark[90]],
+
+ '--color-background-yellow': [yellow.light[90], yellow.dark[35]],
+ '--color-border-yellow': [yellow.light[85], yellow.dark[25]],
+ '--color-icon-yellow': [yellow.light[30], yellow.dark[90]],
+ '--color-text-yellow': [yellow.light[30], yellow.dark[90]],
+
+ // Radius
'--radius-none': '0px',
'--radius-inner': '0.25rem',
'--radius-element': '0.5rem',
@@ -297,17 +288,15 @@ export const stoneTheme = defineTheme({
'--radius-page': '1.5rem',
'--radius-full': '9999px',
- // =========================================================================
// Shadows
- // =========================================================================
- '--shadow-low': '0 2px 4px #28282A0D, 0 4px 8px #28282A1A',
- '--shadow-med': '0 2px 4px #28282A0D, 0 4px 12px #28282A1A',
- '--shadow-high': '0 4px 6px #28282A1A, 0 12px 24px #28282A26',
- '--shadow-inset-hover': 'inset 0px 0px 0px 2px #28282A30',
- '--shadow-inset-selected': 'inset 0px 0px 0px 2px #28282A50',
- '--shadow-inset-success': 'inset 0px 0px 0px 2px #83838a30',
- '--shadow-inset-warning': 'inset 0px 0px 0px 2px #83838a30',
- '--shadow-inset-error': 'inset 0px 0px 0px 2px #83838a30',
+ '--shadow-low': `0 2px 4px ${withAlpha(neutral.light[15], '0d')}, 0 4px 8px ${withAlpha(neutral.light[15], '1a')}`,
+ '--shadow-med': `0 2px 4px ${withAlpha(neutral.light[15], '0d')}, 0 4px 12px ${withAlpha(neutral.light[15], '1a')}`,
+ '--shadow-high': `0 4px 6px ${withAlpha(neutral.light[15], '1a')}, 0 12px 24px ${withAlpha(neutral.light[15], '26')}`,
+ '--shadow-inset-hover': `inset 0 0 0 2px ${withAlpha(neutral.light[15], '30')}`,
+ '--shadow-inset-selected': `inset 0 0 0 2px ${withAlpha(neutral.light[15], '50')}`,
+ '--shadow-inset-success': `inset 0 0 0 2px ${withAlpha(neutral.light[55], '30')}`,
+ '--shadow-inset-warning': `inset 0 0 0 2px ${withAlpha(neutral.light[55], '30')}`,
+ '--shadow-inset-error': `inset 0 0 0 2px ${withAlpha(neutral.light[55], '30')}`,
},
components: {
@@ -322,7 +311,8 @@ export const stoneTheme = defineTheme({
},
},
- // Semantic variants point at categorical hue tokens — single source of truth.
+ // Badges, banners, and field status messages share the categorical
+ // surfaces and foregrounds so each semantic state has one visual source.
badge: {
'variant:info': {
backgroundColor: 'var(--color-background-blue)',
@@ -346,10 +336,8 @@ export const stoneTheme = defineTheme({
},
},
- // StyleX paints the banner surface from @layer priority4 (above
- // @layer astryx-theme), so a direct backgroundColor override loses the
- // cascade. Redefine the muted token instead so StyleX's var() resolves
- // to the categorical bg in our scope.
+ // Banner surface declarations live above the theme layer, so redirect the
+ // semantic variables here instead of attempting a losing direct fill.
banner: {
'status:info': {
'--color-accent-muted': 'var(--color-background-blue)',
@@ -377,44 +365,38 @@ export const stoneTheme = defineTheme({
},
},
- // Fill: light = T90 (same hex as banner/badge surface — fill reads as
- // the same color family as the matching status surface). Dark = T70.
- // Hexes from the preview Tonal Palettes ramp. accent (default) +
- // indeterminate both route to blue for the in-progress / loading look.
+ // Progress fills use the same family as their matching status surface;
+ // the darker stop in dark mode keeps the channel visible on dark tracks.
'progress-bar-fill': {
'variant:accent': {
- backgroundColor: 'light-dark(#d7e4f5, #a0acbc)', // Blue T90 / T70
+ backgroundColor: lightDark(blue.light[90], blue.dark[70]),
},
'variant:success': {
- backgroundColor: 'light-dark(#d0e9ce, #9ab298)', // Green T90 / T70
+ backgroundColor: lightDark(green.light[90], green.dark[70]),
},
'variant:warning': {
- backgroundColor: 'light-dark(#f4e1b7, #bbaa82)', // Yellow T90 / T70
+ backgroundColor: lightDark(yellow.light[90], yellow.dark[70]),
},
'variant:error': {
- backgroundColor: 'light-dark(#f9dcd7, #c0a5a0)', // Red T90 / T70
+ backgroundColor: lightDark(red.light[90], red.dark[70]),
},
},
- // Track default --color-background-muted reads near-body in stone;
- // redirect to --color-skeleton so the channel stays visible.
+ // The default muted track is too close to Stone's body surface.
'progress-bar-track': {
base: {
backgroundColor: 'var(--color-skeleton)',
},
},
- // Switch off-state track reads --color-background-gray by default.
- // Redefine it inside the switch scope to --color-skeleton, matching
- // the ProgressBar track. The on-state reads --color-accent (unaffected);
- // disabled-off also picks up --color-skeleton for consistency.
+ // Match the Switch off-state track to the visible ProgressBar track.
switch: {
base: {
'--color-background-gray': 'var(--color-skeleton)',
},
},
- // FieldStatus surface matches badge — see badge override above.
+ // FieldStatus surfaces match the corresponding badge and banner family.
'field-status': {
'type:success': {
backgroundColor: 'var(--color-background-green)',
@@ -427,8 +409,7 @@ export const stoneTheme = defineTheme({
},
},
- // Input status borders + icons across all 9 input components share the
- // same softer T60/T70 redirection. See INPUT_STATUS_VARS above.
+ // Every input status border and icon uses INPUT_STATUS_VARS above.
'text-input': INPUT_STATUS_VARS,
'text-area': INPUT_STATUS_VARS,
'number-input': INPUT_STATUS_VARS,
@@ -460,9 +441,11 @@ export const stoneTheme = defineTheme({
});
/**
- * Raw tonal palettes — every color at every tone step (0–100 in 5s).
- * Same hue and chroma used to derive all theme tokens.
- * Use these for custom components or data visualization.
+ * Frozen released compatibility palettes. These values preserve the public
+ * `stonePalettes` numeric stops, `hue`, and `chroma` for existing consumers;
+ * the maintained theme renders selected stops from
+ * `stonePalettes.generated.ts` instead. Components should consume semantic
+ * theme tokens, and charts should use the data-visualization color API.
*/
export const stonePalettes = {
neutral: {
diff --git a/packages/themes/stone/README.md b/packages/themes/stone/README.md
index 96b74121f0..a7594234ac 100644
--- a/packages/themes/stone/README.md
+++ b/packages/themes/stone/README.md
@@ -23,14 +23,51 @@ function App() {
### Import paths
-| Path | Use case |
-| ---------------------------- | ------------------------------------------------------ |
-| `@astryxdesign/theme-stone` | Source build (StyleX compilation via `@astryxdesign/build`) |
-| `@astryxdesign/theme-stone/built` | Pre-built dist (Tailwind, plain CSS, or no build step) |
-| `@astryxdesign/theme-stone/theme.css` | Pre-built CSS file (import in your stylesheet) |
+| Path | Use case |
+| ------------------------------------- | ----------------------------------------------------------- |
+| `@astryxdesign/theme-stone` | Source build (StyleX compilation via `@astryxdesign/build`) |
+| `@astryxdesign/theme-stone/built` | Pre-built dist (Tailwind, plain CSS, or no build step) |
+| `@astryxdesign/theme-stone/theme.css` | Pre-built CSS file (import in your stylesheet) |
If you're using `@astryxdesign/build` for StyleX source compilation, import from the bare path. Otherwise, use `/built`.
+## Approved palette
+
+Stone keeps its generation request in `palette.config.json`, the reviewed
+`astryx-oklch-v1` output in `src/stonePalettes.generated.ts`, and the detached
+generation receipt beside it. `stonePaletteRefs.generated.ts` provides the
+small runtime projection consumed by the maintained theme.
+
+The palette preserves Stone's exact configured neutral and pastel anchors while
+generating separate light and dark ramps. Green, Yellow, Teal, and Cyan use
+reviewed re-seeded midtones rather than preserving their released compatibility
+ramp values. The complete palette remains available for authoring and audits; the
+runtime theme imports only the selected stops in
+`stonePaletteRefs.generated.ts`.
+
+Use semantic theme tokens in components. Stone's theme source maps those roles
+to named palette stops; components never read raw palette values directly. The
+prebuilt theme and CSS contain resolved values. Changing the generated palette
+must include the regenerated receipt, selected-reference module, token diff,
+tests, and visual review. Keep `stoneTheme.ts` and the CLI template copy
+synchronized when changing a mapping.
+
+The bare package export preserves the original `stonePalettes.family[stop]`,
+`stonePalettes.family.hue`, and `stonePalettes.family.chroma` shape. The generated
+light and dark ramps are private authoring artifacts used by the maintained theme,
+tests, and review tooling rather than an expanded public palette API:
+
+```ts
+import {stonePalettes} from '@astryxdesign/theme-stone';
+
+const existingSharedRampValue = stonePalettes.orange[90];
+```
+
+The palette is an authoring and audit reference, not a component styling API,
+chart-color API, or accessibility guarantee. Components should read semantic
+tokens, charts should use the data-visualization color API, and every custom
+foreground/background pair still needs contextual contrast verification.
+
### CSS import
Add the theme CSS to your stylesheet:
diff --git a/packages/themes/stone/package.json b/packages/themes/stone/package.json
index 9a61e0958c..223dcb0c8a 100644
--- a/packages/themes/stone/package.json
+++ b/packages/themes/stone/package.json
@@ -51,10 +51,11 @@
"dist",
"src",
"fonts.css",
- "fonts.css.d.ts"
+ "fonts.css.d.ts",
+ "palette.config.json"
],
"scripts": {
- "build": "node ../../../scripts/clean-dist.mjs && astryx theme build src/stoneTheme.ts -o dist/theme.css --icons-specifier ./icons.mjs && tsup && tsc --project tsconfig.build.json && node ../../../scripts/check-fully-specified.mjs"
+ "build": "node ../../../scripts/clean-dist.mjs && node ../../../scripts/generate-stone-palette-refs.mjs --check && astryx theme build src/stoneTheme.ts -o dist/theme.css --icons-specifier ./icons.mjs && tsup && tsc --project tsconfig.build.json && node ../../../scripts/check-fully-specified.mjs"
},
"dependencies": {
"lucide-react": "^1.18.0"
diff --git a/packages/themes/stone/palette.config.json b/packages/themes/stone/palette.config.json
new file mode 100644
index 0000000000..06c1ba66a1
--- /dev/null
+++ b/packages/themes/stone/palette.config.json
@@ -0,0 +1,262 @@
+{
+ "recipe": "astryx-oklch-v1",
+ "vibrancy": 16,
+ "neutralProfile": "neutral-v1",
+ "modeStrategy": "light-and-dark",
+ "stops": [
+ 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90,
+ 95, 100
+ ],
+ "families": [
+ {
+ "id": "neutral",
+ "name": "Stone Neutral",
+ "seed": "#77777c",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 15,
+ "color": "#25252a",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#77777c",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#e2e2e8",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 15,
+ "color": "#25252a",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#77777c",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#e2e2e8",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "red",
+ "name": "Red",
+ "seed": "#8a716d",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#8a716d",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#8a716d",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "orange",
+ "name": "Orange",
+ "seed": "#8f7154",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#8f7154",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#ffdcbb",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#8f7154",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#ffdcbb",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "yellow",
+ "name": "Yellow",
+ "seed": "#927f25",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#927f25",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#f4e1b7",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#927f25",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#f1e1b9",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "green",
+ "name": "Green",
+ "seed": "#528b49",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#528b49",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 85,
+ "color": "#bfdfbb",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#528b49",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 85,
+ "color": "#c3ddbf",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "teal",
+ "name": "Teal",
+ "seed": "#477b6b",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#588174",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#588174",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "cyan",
+ "name": "Cyan",
+ "seed": "#507b86",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#507b86",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#507b86",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "blue",
+ "name": "Blue",
+ "seed": "#6c7888",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#6c7888",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#6c7888",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "purple",
+ "name": "Purple",
+ "seed": "#7b7486",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#7b7486",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#7b7486",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "pink",
+ "name": "Pink",
+ "seed": "#83727c",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#83727c",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#83727c",
+ "policy": "exact"
+ }
+ ]
+ }
+ ]
+}
diff --git a/packages/themes/stone/src/source.ts b/packages/themes/stone/src/source.ts
index 9719aa4c54..db71855be0 100644
--- a/packages/themes/stone/src/source.ts
+++ b/packages/themes/stone/src/source.ts
@@ -1,4 +1,4 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
-export {stoneTheme, stonePalettes} from './stoneTheme';
+export {stonePalettes, stoneTheme} from './stoneTheme';
export {stoneIconRegistry} from './icons';
diff --git a/packages/themes/stone/src/stoneColorMapping.test.ts b/packages/themes/stone/src/stoneColorMapping.test.ts
new file mode 100644
index 0000000000..7bd834a60d
--- /dev/null
+++ b/packages/themes/stone/src/stoneColorMapping.test.ts
@@ -0,0 +1,44 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+import {readFileSync} from 'node:fs';
+import {describe, expect, it} from 'vitest';
+import {stoneTheme} from './stoneTheme';
+
+const source = readFileSync(
+ new URL('./stoneTheme.ts', import.meta.url),
+ 'utf8',
+);
+
+const publicPaletteStart = source.indexOf('export const stonePalettes');
+if (publicPaletteStart < 0) {
+ throw new Error('stoneTheme.ts: stonePalettes export marker not found');
+}
+const maintainedThemeSource = source.slice(0, publicPaletteStart);
+
+describe('stone color token mapping completeness', () => {
+ it('maps every color token Stone owns through its reviewed palette', () => {
+ expect(
+ Object.keys(stoneTheme.tokens).filter(name =>
+ name.startsWith('--color-data-'),
+ ),
+ ).toEqual([]);
+ });
+
+ it('keeps every resolved root color concrete', () => {
+ for (const [name, value] of Object.entries(stoneTheme.tokens)) {
+ if (!name.startsWith('--color-') || name.startsWith('--color-data-')) {
+ continue;
+ }
+ expect(typeof value, name).toBe('string');
+ expect(value, name).toMatch(
+ /^(?:transparent|#[0-9a-f]{6}(?:[0-9a-f]{2})?|light-dark\(#[0-9a-f]{6}(?:[0-9a-f]{2})?, #[0-9a-f]{6}(?:[0-9a-f]{2})?\))$/i,
+ );
+ }
+ });
+
+ it('uses no one-off color literals in the maintained theme source', () => {
+ expect(maintainedThemeSource).not.toMatch(
+ /#[0-9a-f]{3,8}\b|\brgba?\(|\bhsl[a]?\(|\boklch\(|\bblack\b|\bwhite\b/i,
+ );
+ });
+});
diff --git a/packages/themes/stone/src/stonePaletteRefs.generated.ts b/packages/themes/stone/src/stonePaletteRefs.generated.ts
new file mode 100644
index 0000000000..6653c73b40
--- /dev/null
+++ b/packages/themes/stone/src/stonePaletteRefs.generated.ts
@@ -0,0 +1,51 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+// Generated from the committed full palette for the stops used by Stone's
+// theme source. Regenerate with `pnpm generate:stone-palette-refs`.
+// Keep the complete palette available for authoring and audits without
+// making consumers pay for unused palette stops.
+// prettier-ignore
+export const stonePaletteRefs = {
+ green: {
+ light: {30: '#354f31', 55: '#609757', 85: '#bfdfbb', 90: '#d2eccf'},
+ dark: {25: '#2f412c', 35: '#3e5d38', 70: '#90ba8a', 80: '#b3d0af', 90: '#d5e9d2'},
+ },
+ yellow: {
+ light: {30: '#524818', 40: '#736419', 55: '#a08c36', 85: '#e7d3a4', 90: '#f4e1b7'},
+ dark: {25: '#433b1b', 35: '#615620', 70: '#c2af6e', 80: '#d9c794', 90: '#f1e1b9'},
+ },
+ red: {
+ light: {30: '#603c37', 40: '#745752', 60: '#a98984', 85: '#f0cac4', 90: '#fbdad4'},
+ dark: {25: '#50332e', 35: '#684a45', 70: '#c6a29c', 80: '#e0bdb8', 90: '#f7dbd7'},
+ },
+ purple: {
+ light: {30: '#4c405b', 40: '#635a70', 85: '#d9cfea', 90: '#e7def5'},
+ dark: {25: '#3f374c', 35: '#574e64', 70: '#b0a5c0', 90: '#e6def3'},
+ },
+ teal: {
+ light: {30: '#2c4f44', 40: '#40675c', 85: '#c3dbd2', 90: '#d4e8e1'},
+ dark: {25: '#274239', 35: '#3a5b50', 70: '#94b3a9', 90: '#d6e7e1'},
+ },
+ neutral: {
+ light: {0: '#000000', 15: '#25252a', 30: '#46464e', 40: '#5f5f64', 55: '#848489', 85: '#d4d3dd', 90: '#e2e2e8', 95: '#f0f0f7', 100: '#ffffff'},
+ dark: {0: '#000000', 5: '#101018', 10: '#1b1b21', 15: '#25252a', 20: '#302f36', 25: '#3a3a42', 35: '#525159', 40: '#5e5e64', 65: '#9d9ea5', 70: '#ababb3', 90: '#e2e2e8', 95: '#f0f0f9', 100: '#ffffff'},
+ },
+ orange: {
+ dark: {25: '#4e3522', 35: '#684c34', 70: '#c9a382', 90: '#ffdcbb'},
+ light: {30: '#5e3f27', 85: '#f2cdaa', 90: '#ffdcbb'},
+ },
+ blue: {
+ light: {30: '#344861', 40: '#516074', 85: '#c2d6f1', 90: '#d3e4fc'},
+ dark: {25: '#2c3c52', 35: '#445469', 70: '#9aadc7', 90: '#d5e4f8'},
+ },
+ cyan: {
+ light: {30: '#264d57', 85: '#badbe4', 90: '#cbe9f0'},
+ dark: {25: '#234048', 35: '#345761', 90: '#cfe8ee'},
+ },
+ pink: {
+ light: {30: '#5a3c4f', 85: '#e9cadc', 90: '#f5d9ea'},
+ dark: {25: '#4b3242', 35: '#624a59', 90: '#f2dbe8'},
+ },
+} as const;
+
+export default stonePaletteRefs;
diff --git a/packages/themes/stone/src/stonePalettes.generated.receipt.json b/packages/themes/stone/src/stonePalettes.generated.receipt.json
new file mode 100644
index 0000000000..f1630c1948
--- /dev/null
+++ b/packages/themes/stone/src/stonePalettes.generated.receipt.json
@@ -0,0 +1,840 @@
+{
+ "schemaVersion": 1,
+ "recipe": "astryx-oklch-v1",
+ "generatorVersion": "palette-generator-v1",
+ "candidateFormatVersion": "palette-typescript-v1",
+ "candidateSha256": "7f78a3fd8477342eaa6ecffdc5d6d0026804857383933cd882da47858a091a58",
+ "preview": {
+ "version": "palette-preview-v1",
+ "sha256": "e8eebb814aab58152064b6c5fc57c2a147a077378c062d000beb1e659b5901fc"
+ },
+ "request": {
+ "recipe": "astryx-oklch-v1",
+ "vibrancy": 16,
+ "neutralProfile": "neutral-v1",
+ "modeStrategy": "light-and-dark",
+ "stops": [
+ 0,
+ 5,
+ 10,
+ 15,
+ 20,
+ 25,
+ 30,
+ 35,
+ 40,
+ 45,
+ 50,
+ 55,
+ 60,
+ 65,
+ 70,
+ 75,
+ 80,
+ 85,
+ 90,
+ 95,
+ 100
+ ],
+ "families": [
+ {
+ "id": "neutral",
+ "name": "Stone Neutral",
+ "seed": "#77777c",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 15,
+ "color": "#25252a",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#77777c",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#e2e2e8",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 15,
+ "color": "#25252a",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#77777c",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#e2e2e8",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "red",
+ "name": "Red",
+ "seed": "#8a716d",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#8a716d",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#8a716d",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "orange",
+ "name": "Orange",
+ "seed": "#8f7154",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#8f7154",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#ffdcbb",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#8f7154",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#ffdcbb",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "yellow",
+ "name": "Yellow",
+ "seed": "#927f25",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#927f25",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#f4e1b7",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#927f25",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#f1e1b9",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "green",
+ "name": "Green",
+ "seed": "#528b49",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#528b49",
+ "policy": "exact"
+ },
+ {
+ "mode": "light",
+ "stop": 85,
+ "color": "#bfdfbb",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#528b49",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 85,
+ "color": "#c3ddbf",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "teal",
+ "name": "Teal",
+ "seed": "#477b6b",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#588174",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#588174",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "cyan",
+ "name": "Cyan",
+ "seed": "#507b86",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#507b86",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#507b86",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "blue",
+ "name": "Blue",
+ "seed": "#6c7888",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#6c7888",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#6c7888",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "purple",
+ "name": "Purple",
+ "seed": "#7b7486",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#7b7486",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#7b7486",
+ "policy": "exact"
+ }
+ ]
+ },
+ {
+ "id": "pink",
+ "name": "Pink",
+ "seed": "#83727c",
+ "kind": "chromatic",
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#83727c",
+ "policy": "exact"
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#83727c",
+ "policy": "exact"
+ }
+ ]
+ }
+ ]
+ },
+ "diagnostics": {
+ "families": {
+ "neutral": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.089366176643976,
+ "maximumAdjacentDeltaE": 17.860647502746772,
+ "maximumHueDrift": 4.1859335840684935,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 15,
+ "color": "#25252a",
+ "policy": "exact",
+ "generatedColor": "#25252a",
+ "deltaE": 0
+ },
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#77777c",
+ "policy": "exact",
+ "generatedColor": "#77777c",
+ "deltaE": 0
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#e2e2e8",
+ "policy": "exact",
+ "generatedColor": "#e2e2e8",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.15817850570346,
+ "maximumAdjacentDeltaE": 17.782656515036848,
+ "maximumHueDrift": 2.106853838233974,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 15,
+ "color": "#25252a",
+ "policy": "exact",
+ "generatedColor": "#25252a",
+ "deltaE": 0
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#77777c",
+ "policy": "exact",
+ "generatedColor": "#77777c",
+ "deltaE": 0
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#e2e2e8",
+ "policy": "exact",
+ "generatedColor": "#e2e2e8",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "red": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.171807101407877,
+ "maximumAdjacentDeltaE": 17.973198569331565,
+ "maximumHueDrift": 2.6372728345744463,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#8a716d",
+ "policy": "exact",
+ "generatedColor": "#8a716d",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.101761660541818,
+ "maximumAdjacentDeltaE": 17.799233134343268,
+ "maximumHueDrift": 2.101410674891781,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#8a716d",
+ "policy": "exact",
+ "generatedColor": "#8a716d",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "orange": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.086930316646607,
+ "maximumAdjacentDeltaE": 17.92561511794591,
+ "maximumHueDrift": 9.743415311153512,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#8f7154",
+ "policy": "exact",
+ "generatedColor": "#8f7154",
+ "deltaE": 0
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#ffdcbb",
+ "policy": "exact",
+ "generatedColor": "#ffdcbb",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.131278916946704,
+ "maximumAdjacentDeltaE": 17.990828217014066,
+ "maximumHueDrift": 10.240381416912442,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#8f7154",
+ "policy": "exact",
+ "generatedColor": "#8f7154",
+ "deltaE": 0
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#ffdcbb",
+ "policy": "exact",
+ "generatedColor": "#ffdcbb",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "yellow": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 3.7859989136161247,
+ "maximumAdjacentDeltaE": 18.070620631207497,
+ "maximumHueDrift": 10.04987648078145,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#927f25",
+ "policy": "exact",
+ "generatedColor": "#927f25",
+ "deltaE": 0
+ },
+ {
+ "mode": "light",
+ "stop": 90,
+ "color": "#f4e1b7",
+ "policy": "exact",
+ "generatedColor": "#f4e1b7",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 3.731841860883646,
+ "maximumAdjacentDeltaE": 17.90573562079554,
+ "maximumHueDrift": 8.261902963361536,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#927f25",
+ "policy": "exact",
+ "generatedColor": "#927f25",
+ "deltaE": 0
+ },
+ {
+ "mode": "dark",
+ "stop": 90,
+ "color": "#f1e1b9",
+ "policy": "exact",
+ "generatedColor": "#f1e1b9",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "green": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.105898582022621,
+ "maximumAdjacentDeltaE": 17.939005433381325,
+ "maximumHueDrift": 1.636644133489085,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#528b49",
+ "policy": "exact",
+ "generatedColor": "#528b49",
+ "deltaE": 0
+ },
+ {
+ "mode": "light",
+ "stop": 85,
+ "color": "#bfdfbb",
+ "policy": "exact",
+ "generatedColor": "#bfdfbb",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.117685471243426,
+ "maximumAdjacentDeltaE": 18.013733837580684,
+ "maximumHueDrift": 1.056905311031528,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#528b49",
+ "policy": "exact",
+ "generatedColor": "#528b49",
+ "deltaE": 0
+ },
+ {
+ "mode": "dark",
+ "stop": 85,
+ "color": "#c3ddbf",
+ "policy": "exact",
+ "generatedColor": "#c3ddbf",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "teal": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.14745104766057,
+ "maximumAdjacentDeltaE": 17.722505270600053,
+ "maximumHueDrift": 2.5965005719581313,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#588174",
+ "policy": "exact",
+ "generatedColor": "#588174",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.0627611605620135,
+ "maximumAdjacentDeltaE": 17.855525302822763,
+ "maximumHueDrift": 2.7322271800874205,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#588174",
+ "policy": "exact",
+ "generatedColor": "#588174",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "cyan": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 3.5227134988318927,
+ "maximumAdjacentDeltaE": 17.97427597317998,
+ "maximumHueDrift": 1.8393988891423305,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#507b86",
+ "policy": "exact",
+ "generatedColor": "#507b86",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 3.7688695276724227,
+ "maximumAdjacentDeltaE": 17.704014854698976,
+ "maximumHueDrift": 3.034371827797827,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#507b86",
+ "policy": "exact",
+ "generatedColor": "#507b86",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "blue": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.030638539167886,
+ "maximumAdjacentDeltaE": 17.88930396437638,
+ "maximumHueDrift": 1.7367472797280925,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#6c7888",
+ "policy": "exact",
+ "generatedColor": "#6c7888",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.039628702422973,
+ "maximumAdjacentDeltaE": 17.76797533894901,
+ "maximumHueDrift": 2.3791375058722224,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#6c7888",
+ "policy": "exact",
+ "generatedColor": "#6c7888",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "purple": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.0935894189320905,
+ "maximumAdjacentDeltaE": 17.910601695842214,
+ "maximumHueDrift": 1.8846988428999794,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#7b7486",
+ "policy": "exact",
+ "generatedColor": "#7b7486",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.07854632694844,
+ "maximumAdjacentDeltaE": 17.733749538789144,
+ "maximumHueDrift": 1.9920206687669406,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#7b7486",
+ "policy": "exact",
+ "generatedColor": "#7b7486",
+ "deltaE": 0
+ }
+ ]
+ }
+ },
+ "pink": {
+ "light": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.163653937894069,
+ "maximumAdjacentDeltaE": 18.114687743880147,
+ "maximumHueDrift": 1.4177887428506892,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 95,
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "color": "#83727c",
+ "policy": "exact",
+ "generatedColor": "#83727c",
+ "deltaE": 0
+ }
+ ]
+ },
+ "dark": {
+ "monotonic": true,
+ "minimumAdjacentDeltaE": 4.100692959603493,
+ "maximumAdjacentDeltaE": 17.693194967894105,
+ "maximumHueDrift": 2.3994811243924232,
+ "hueIdentityRisk": null,
+ "gamutMappedStops": [
+ 100
+ ],
+ "anchors": [
+ {
+ "mode": "dark",
+ "stop": 50,
+ "color": "#83727c",
+ "policy": "exact",
+ "generatedColor": "#83727c",
+ "deltaE": 0
+ }
+ ]
+ }
+ }
+ },
+ "coordination": [
+ {
+ "mode": "light",
+ "stop": 50,
+ "closestFamilies": [
+ "Purple",
+ "Pink"
+ ],
+ "minimumFamilyDeltaE": 1.8118874213513319,
+ "strongestFamily": "Green",
+ "weakestFamily": "Stone Neutral",
+ "chromaRatio": 15.019610969325289
+ },
+ {
+ "mode": "dark",
+ "stop": 50,
+ "closestFamilies": [
+ "Purple",
+ "Pink"
+ ],
+ "minimumFamilyDeltaE": 1.8118874213513319,
+ "strongestFamily": "Green",
+ "weakestFamily": "Stone Neutral",
+ "chromaRatio": 15.019610969325289
+ }
+ ]
+ }
+}
diff --git a/packages/themes/stone/src/stonePalettes.generated.ts b/packages/themes/stone/src/stonePalettes.generated.ts
new file mode 100644
index 0000000000..da19eb4b9c
--- /dev/null
+++ b/packages/themes/stone/src/stonePalettes.generated.ts
@@ -0,0 +1,501 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+// Generated by astryx-oklch-v1. Review before committing.
+export const black = '#000000' as const;
+export const white = '#ffffff' as const;
+
+// prettier-ignore
+export const palette = {
+ "neutral": {
+ "name": "Stone Neutral",
+ "light": {
+ "0": "#000000",
+ "5": "#101019",
+ "10": "#1b1b21",
+ "15": "#25252a",
+ "20": "#2f2f36",
+ "25": "#3a3a42",
+ "30": "#46464e",
+ "35": "#525259",
+ "40": "#5f5f64",
+ "45": "#6b6b6f",
+ "50": "#77777c",
+ "55": "#848489",
+ "60": "#919197",
+ "65": "#9e9da5",
+ "70": "#ababb3",
+ "75": "#b8b8c2",
+ "80": "#c6c5d0",
+ "85": "#d4d3dd",
+ "90": "#e2e2e8",
+ "95": "#f0f0f7",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#101018",
+ "10": "#1b1b21",
+ "15": "#25252a",
+ "20": "#302f36",
+ "25": "#3a3a42",
+ "30": "#46464e",
+ "35": "#525159",
+ "40": "#5e5e64",
+ "45": "#6a6a70",
+ "50": "#77777c",
+ "55": "#838489",
+ "60": "#909097",
+ "65": "#9d9ea5",
+ "70": "#ababb3",
+ "75": "#b8b8c2",
+ "80": "#c6c6cf",
+ "85": "#d4d4dd",
+ "90": "#e2e2e8",
+ "95": "#f0f0f9",
+ "100": "#ffffff"
+ }
+ },
+ "red": {
+ "name": "Red",
+ "light": {
+ "0": "#000000",
+ "5": "#1c0c09",
+ "10": "#2b1411",
+ "15": "#381d19",
+ "20": "#462722",
+ "25": "#53312c",
+ "30": "#603c37",
+ "35": "#6a4943",
+ "40": "#745752",
+ "45": "#7e6460",
+ "50": "#8a716d",
+ "55": "#987d79",
+ "60": "#a98984",
+ "65": "#ba948e",
+ "70": "#caa099",
+ "75": "#d8ada6",
+ "80": "#e4bcb5",
+ "85": "#f0cac4",
+ "90": "#fbdad4",
+ "95": "#ffece9",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#1b0c0a",
+ "10": "#291613",
+ "15": "#361f1b",
+ "20": "#432825",
+ "25": "#50332e",
+ "30": "#5c3e3a",
+ "35": "#684a45",
+ "40": "#735752",
+ "45": "#7d6460",
+ "50": "#8a716d",
+ "55": "#987e79",
+ "60": "#a78985",
+ "65": "#b79590",
+ "70": "#c6a29c",
+ "75": "#d4afa9",
+ "80": "#e0bdb8",
+ "85": "#ecccc7",
+ "90": "#f7dbd7",
+ "95": "#ffece9",
+ "100": "#ffffff"
+ }
+ },
+ "orange": {
+ "name": "Orange",
+ "light": {
+ "0": "#000000",
+ "5": "#1b0d04",
+ "10": "#291607",
+ "15": "#36200d",
+ "20": "#442a14",
+ "25": "#51341d",
+ "30": "#5e3f27",
+ "35": "#6a4a31",
+ "40": "#77573c",
+ "45": "#836448",
+ "50": "#8f7154",
+ "55": "#9c7d5f",
+ "60": "#aa8a6b",
+ "65": "#b99776",
+ "70": "#c8a382",
+ "75": "#d7b18d",
+ "80": "#e5be9b",
+ "85": "#f2cdaa",
+ "90": "#ffdcbb",
+ "95": "#ffeddd",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#1a0e05",
+ "10": "#28170b",
+ "15": "#342112",
+ "20": "#412b19",
+ "25": "#4e3522",
+ "30": "#5b402b",
+ "35": "#684c34",
+ "40": "#75583f",
+ "45": "#836448",
+ "50": "#8f7154",
+ "55": "#9c7e5f",
+ "60": "#ab8b6b",
+ "65": "#ba9777",
+ "70": "#c9a382",
+ "75": "#d6b18e",
+ "80": "#e5be9c",
+ "85": "#f2cdab",
+ "90": "#ffdcbb",
+ "95": "#ffeedd",
+ "100": "#ffffff"
+ }
+ },
+ "yellow": {
+ "name": "Yellow",
+ "light": {
+ "0": "#000000",
+ "5": "#151101",
+ "10": "#211b02",
+ "15": "#2d2605",
+ "20": "#38300b",
+ "25": "#443b13",
+ "30": "#524818",
+ "35": "#61551a",
+ "40": "#736419",
+ "45": "#83721a",
+ "50": "#927f25",
+ "55": "#a08c36",
+ "60": "#ac9848",
+ "65": "#b8a35a",
+ "70": "#c3af6c",
+ "75": "#cfbb7f",
+ "80": "#dbc790",
+ "85": "#e7d3a4",
+ "90": "#f4e1b7",
+ "95": "#fdf0d3",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#141103",
+ "10": "#201b06",
+ "15": "#2c260c",
+ "20": "#373013",
+ "25": "#433b1b",
+ "30": "#514821",
+ "35": "#615620",
+ "40": "#72641d",
+ "45": "#84721b",
+ "50": "#927f25",
+ "55": "#a08c37",
+ "60": "#ab9849",
+ "65": "#b7a45b",
+ "70": "#c2af6e",
+ "75": "#cdba81",
+ "80": "#d9c794",
+ "85": "#e5d3a6",
+ "90": "#f1e1b9",
+ "95": "#fbf0d5",
+ "100": "#ffffff"
+ }
+ },
+ "green": {
+ "name": "Green",
+ "light": {
+ "0": "#000000",
+ "5": "#0a1408",
+ "10": "#122010",
+ "15": "#1a2b17",
+ "20": "#233620",
+ "25": "#2d4229",
+ "30": "#354f31",
+ "35": "#3c5e37",
+ "40": "#416d3b",
+ "45": "#487d40",
+ "50": "#528b49",
+ "55": "#609757",
+ "60": "#6ea366",
+ "65": "#7eaf76",
+ "70": "#8ebb87",
+ "75": "#9fc798",
+ "80": "#b0d3aa",
+ "85": "#bfdfbb",
+ "90": "#d2eccf",
+ "95": "#e7f6e5",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#0b1409",
+ "10": "#141f12",
+ "15": "#1c2a1a",
+ "20": "#253523",
+ "25": "#2f412c",
+ "30": "#384e35",
+ "35": "#3e5d38",
+ "40": "#426d3b",
+ "45": "#487d40",
+ "50": "#528b49",
+ "55": "#609857",
+ "60": "#6fa467",
+ "65": "#80af78",
+ "70": "#90ba8a",
+ "75": "#a3c59d",
+ "80": "#b3d0af",
+ "85": "#c3ddbf",
+ "90": "#d5e9d2",
+ "95": "#e9f4e7",
+ "100": "#ffffff"
+ }
+ },
+ "teal": {
+ "name": "Teal",
+ "light": {
+ "0": "#000000",
+ "5": "#051410",
+ "10": "#0a201a",
+ "15": "#112b24",
+ "20": "#19372e",
+ "25": "#224339",
+ "30": "#2c4f44",
+ "35": "#365b50",
+ "40": "#40675c",
+ "45": "#4c7468",
+ "50": "#588174",
+ "55": "#658e81",
+ "60": "#729b8e",
+ "65": "#81a89b",
+ "70": "#91b4a8",
+ "75": "#a1c1b6",
+ "80": "#b2cec4",
+ "85": "#c3dbd2",
+ "90": "#d4e8e1",
+ "95": "#e6f5ef",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#071410",
+ "10": "#0e201a",
+ "15": "#152b24",
+ "20": "#1e362f",
+ "25": "#274239",
+ "30": "#304e45",
+ "35": "#3a5b50",
+ "40": "#43675b",
+ "45": "#4d7567",
+ "50": "#588174",
+ "55": "#668e80",
+ "60": "#749a8d",
+ "65": "#84a79b",
+ "70": "#94b3a9",
+ "75": "#a5c0b7",
+ "80": "#b5cdc5",
+ "85": "#c6dad3",
+ "90": "#d6e7e1",
+ "95": "#e7f4f0",
+ "100": "#ffffff"
+ }
+ },
+ "cyan": {
+ "name": "Cyan",
+ "light": {
+ "0": "#000000",
+ "5": "#031418",
+ "10": "#061f25",
+ "15": "#0c2a31",
+ "20": "#14363e",
+ "25": "#1d414a",
+ "30": "#264d57",
+ "35": "#305862",
+ "40": "#3a646e",
+ "45": "#446e79",
+ "50": "#507b86",
+ "55": "#5d8893",
+ "60": "#6c96a1",
+ "65": "#7ba5b0",
+ "70": "#8ab3be",
+ "75": "#99c1cb",
+ "80": "#a9ced8",
+ "85": "#badbe4",
+ "90": "#cbe9f0",
+ "95": "#def6fc",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#051317",
+ "10": "#0b1f24",
+ "15": "#122a30",
+ "20": "#1a353c",
+ "25": "#234048",
+ "30": "#2c4c54",
+ "35": "#345761",
+ "40": "#3c636d",
+ "45": "#456e79",
+ "50": "#507b86",
+ "55": "#5d8893",
+ "60": "#6e96a0",
+ "65": "#7ea4ae",
+ "70": "#8fb2bb",
+ "75": "#9ebfc8",
+ "80": "#aecdd5",
+ "85": "#bedae2",
+ "90": "#cfe8ee",
+ "95": "#e1f5fa",
+ "100": "#ffffff"
+ }
+ },
+ "blue": {
+ "name": "Blue",
+ "light": {
+ "0": "#000000",
+ "5": "#08111e",
+ "10": "#0f1c2d",
+ "15": "#17263a",
+ "20": "#203148",
+ "25": "#293c56",
+ "30": "#344861",
+ "35": "#42546b",
+ "40": "#516074",
+ "45": "#5f6b7c",
+ "50": "#6c7888",
+ "55": "#788597",
+ "60": "#8292a8",
+ "65": "#8ba0ba",
+ "70": "#96adcb",
+ "75": "#a4bbda",
+ "80": "#b3c9e6",
+ "85": "#c2d6f1",
+ "90": "#d3e4fc",
+ "95": "#e8f2ff",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#09111c",
+ "10": "#111c2a",
+ "15": "#1a2637",
+ "20": "#233145",
+ "25": "#2c3c52",
+ "30": "#37485e",
+ "35": "#445469",
+ "40": "#515f72",
+ "45": "#5f6b7c",
+ "50": "#6c7888",
+ "55": "#778596",
+ "60": "#8292a6",
+ "65": "#8ea0b7",
+ "70": "#9aadc7",
+ "75": "#a7bbd5",
+ "80": "#b6c8e1",
+ "85": "#c5d6ed",
+ "90": "#d5e4f8",
+ "95": "#e8f2ff",
+ "100": "#ffffff"
+ }
+ },
+ "purple": {
+ "name": "Purple",
+ "light": {
+ "0": "#000000",
+ "5": "#130e1b",
+ "10": "#1f1828",
+ "15": "#2a2135",
+ "20": "#352b42",
+ "25": "#40364f",
+ "30": "#4c405b",
+ "35": "#574d66",
+ "40": "#635a70",
+ "45": "#6f677a",
+ "50": "#7b7486",
+ "55": "#888094",
+ "60": "#968ca4",
+ "65": "#a398b4",
+ "70": "#b1a4c4",
+ "75": "#beb2d2",
+ "80": "#ccc0de",
+ "85": "#d9cfea",
+ "90": "#e7def5",
+ "95": "#f4edff",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#130e19",
+ "10": "#1e1827",
+ "15": "#292233",
+ "20": "#342c40",
+ "25": "#3f374c",
+ "30": "#4b4258",
+ "35": "#574e64",
+ "40": "#625b6f",
+ "45": "#6f687a",
+ "50": "#7b7486",
+ "55": "#888194",
+ "60": "#958da2",
+ "65": "#a399b1",
+ "70": "#b0a5c0",
+ "75": "#beb3ce",
+ "80": "#cbc1da",
+ "85": "#d9d0e7",
+ "90": "#e6def3",
+ "95": "#f4edfe",
+ "100": "#ffffff"
+ }
+ },
+ "pink": {
+ "name": "Pink",
+ "light": {
+ "0": "#000000",
+ "5": "#1a0c15",
+ "10": "#271420",
+ "15": "#341d2c",
+ "20": "#412737",
+ "25": "#4e3143",
+ "30": "#5a3c4f",
+ "35": "#644959",
+ "40": "#6e5765",
+ "45": "#786470",
+ "50": "#83727c",
+ "55": "#927d89",
+ "60": "#a28898",
+ "65": "#b394a6",
+ "70": "#c39fb4",
+ "75": "#d1adc2",
+ "80": "#ddbbcf",
+ "85": "#e9cadc",
+ "90": "#f5d9ea",
+ "95": "#ffeaf6",
+ "100": "#ffffff"
+ },
+ "dark": {
+ "0": "#000000",
+ "5": "#180c14",
+ "10": "#261620",
+ "15": "#321f2b",
+ "20": "#3e2836",
+ "25": "#4b3242",
+ "30": "#573e4e",
+ "35": "#624a59",
+ "40": "#6d5864",
+ "45": "#776570",
+ "50": "#83727c",
+ "55": "#917d89",
+ "60": "#a08997",
+ "65": "#b095a5",
+ "70": "#bfa1b3",
+ "75": "#cdaec1",
+ "80": "#dabdce",
+ "85": "#e6ccdb",
+ "90": "#f2dbe8",
+ "95": "#fdebf6",
+ "100": "#ffffff"
+ }
+ }
+} as const;
+
+export default palette;
diff --git a/packages/themes/stone/src/stonePalettes.test.ts b/packages/themes/stone/src/stonePalettes.test.ts
new file mode 100644
index 0000000000..2c6bd4d615
--- /dev/null
+++ b/packages/themes/stone/src/stonePalettes.test.ts
@@ -0,0 +1,87 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+import {describe, expect, it} from 'vitest';
+import {palette as stoneModePalettes} from './stonePalettes.generated';
+import {stonePalettes} from './stoneTheme';
+
+const stops = [
+ 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95,
+ 100,
+] as const;
+
+const chromaticFamilies = [
+ 'blue',
+ 'cyan',
+ 'green',
+ 'teal',
+ 'yellow',
+ 'orange',
+ 'red',
+ 'pink',
+ 'purple',
+] as const;
+
+const exactMidpoints = {
+ red: '#8a716d',
+ orange: '#8f7154',
+ yellow: '#927f25',
+ green: '#528b49',
+ teal: '#588174',
+ cyan: '#507b86',
+ blue: '#6c7888',
+ purple: '#7b7486',
+ pink: '#83727c',
+} as const;
+
+describe('stone palette artifact', () => {
+ it('keeps every reviewed family and mode structurally complete', () => {
+ expect(Object.keys(stonePalettes)).toEqual([
+ 'neutral',
+ ...chromaticFamilies,
+ ]);
+
+ for (const familyName of ['neutral', ...chromaticFamilies] as const) {
+ const family = stonePalettes[familyName];
+ expect(family.hue).toBeTypeOf('number');
+ expect(family.chroma).toBeTypeOf('number');
+ for (const stop of stops) {
+ expect(family[stop]).toMatch(/^#[0-9a-f]{6}$/i);
+ expect(stoneModePalettes[familyName].light[stop]).toMatch(
+ /^#[0-9a-f]{6}$/i,
+ );
+ expect(stoneModePalettes[familyName].dark[stop]).toMatch(
+ /^#[0-9a-f]{6}$/i,
+ );
+ }
+ expect(family[0]).toBe('#000000');
+ expect(family[100]).toBe('#ffffff');
+ }
+ });
+
+ it('preserves Stone exact anchors in both modes', () => {
+ expect(stoneModePalettes.neutral.light[15]).toBe('#25252a');
+ expect(stoneModePalettes.neutral.light[50]).toBe('#77777c');
+ expect(stoneModePalettes.neutral.light[90]).toBe('#e2e2e8');
+ expect(stoneModePalettes.neutral.dark[15]).toBe('#25252a');
+ expect(stoneModePalettes.neutral.dark[50]).toBe('#77777c');
+ expect(stoneModePalettes.neutral.dark[90]).toBe('#e2e2e8');
+
+ for (const familyName of chromaticFamilies) {
+ expect(stoneModePalettes[familyName].light[50]).toBe(
+ exactMidpoints[familyName],
+ );
+ expect(stoneModePalettes[familyName].dark[50]).toBe(
+ exactMidpoints[familyName],
+ );
+ expect(stonePalettes[familyName]).not.toHaveProperty('light');
+ expect(stonePalettes[familyName]).not.toHaveProperty('dark');
+ }
+
+ expect(stoneModePalettes.yellow.light[90]).toBe('#f4e1b7');
+ expect(stoneModePalettes.yellow.dark[90]).toBe('#f1e1b9');
+ expect(stoneModePalettes.orange.light[90]).toBe('#ffdcbb');
+ expect(stoneModePalettes.orange.dark[90]).toBe('#ffdcbb');
+ expect(stoneModePalettes.green.light[85]).toBe('#bfdfbb');
+ expect(stoneModePalettes.green.dark[85]).toBe('#c3ddbf');
+ });
+});
diff --git a/packages/themes/stone/src/stoneTheme.test.ts b/packages/themes/stone/src/stoneTheme.test.ts
index e5c681f3f9..3008f809db 100644
--- a/packages/themes/stone/src/stoneTheme.test.ts
+++ b/packages/themes/stone/src/stoneTheme.test.ts
@@ -1,9 +1,45 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
import {describe, expect, it} from 'vitest';
-import {generateThemeCSS} from '@astryxdesign/core/theme';
+import {generateThemeCSS, resolveThemeTokens} from '@astryxdesign/core/theme';
+import {palette as stoneModePalettes} from './stonePalettes.generated';
import {stoneTheme} from './stoneTheme';
+function channels(color: string): [number, number, number] {
+ return [1, 3, 5].map(index =>
+ Number.parseInt(color.slice(index, index + 2), 16),
+ ) as [number, number, number];
+}
+
+function luminance(color: string): number {
+ const [red, green, blue] = channels(color).map(channel => {
+ const value = channel / 255;
+ return value <= 0.04045
+ ? value / 12.92
+ : Math.pow((value + 0.055) / 1.055, 2.4);
+ });
+ return 0.2126 * red + 0.7152 * green + 0.0722 * blue;
+}
+
+function contrast(foreground: string, background: string): number {
+ const [lighter, darker] = [luminance(foreground), luminance(background)].sort(
+ (left, right) => right - left,
+ );
+ return (lighter + 0.05) / (darker + 0.05);
+}
+
+function blend(foreground: string, background: string, alpha: number): string {
+ const front = channels(foreground);
+ const back = channels(background);
+ return `#${front
+ .map((channel, index) =>
+ Math.round(channel * alpha + back[index] * (1 - alpha))
+ .toString(16)
+ .padStart(2, '0'),
+ )
+ .join('')}`;
+}
+
describe('stone touch + narrow type pin', () => {
it('floors body to 16px and holds Display 1 at its desktop size', () => {
const rule = stoneTheme.__adaptationRules?.[0];
@@ -31,3 +67,90 @@ describe('stone secondary ComplexSelector', () => {
);
});
});
+
+const categoricalFamilies = [
+ 'blue',
+ 'cyan',
+ 'green',
+ 'orange',
+ 'pink',
+ 'purple',
+ 'red',
+ 'teal',
+ 'yellow',
+] as const;
+
+describe('stone palette mapping', () => {
+ it.each(['light', 'dark'] as const)(
+ 'resolves the neutral surface ladder from reviewed %s stops',
+ mode => {
+ const tokens = resolveThemeTokens(stoneTheme, {mode});
+ const ramp = stoneModePalettes.neutral[mode];
+
+ expect(tokens['--color-background-body']).toBe(
+ ramp[mode === 'light' ? 95 : 5],
+ );
+ expect(tokens['--color-background-surface']).toBe(
+ ramp[mode === 'light' ? 100 : 10],
+ );
+ expect(tokens['--color-background-card']).toBe(
+ ramp[mode === 'light' ? 100 : 15],
+ );
+ expect(tokens['--color-background-popover']).toBe(
+ ramp[mode === 'light' ? 100 : 20],
+ );
+ expect(tokens['--color-text-primary']).toBe(
+ ramp[mode === 'light' ? 15 : 95],
+ );
+ expect(tokens['--color-text-secondary']).toBe(
+ ramp[mode === 'light' ? 40 : 70],
+ );
+ },
+ );
+
+ it.each(['light', 'dark'] as const)(
+ 'keeps every categorical %s role on the same four-stop pattern',
+ mode => {
+ const tokens = resolveThemeTokens(stoneTheme, {mode});
+ for (const family of categoricalFamilies) {
+ const ramp = stoneModePalettes[family][mode];
+ expect(tokens[`--color-background-${family}`]).toBe(
+ ramp[mode === 'light' ? 90 : 35],
+ );
+ expect(tokens[`--color-border-${family}`]).toBe(
+ ramp[mode === 'light' ? 85 : 25],
+ );
+ expect(tokens[`--color-icon-${family}`]).toBe(
+ ramp[mode === 'light' ? 30 : 90],
+ );
+ expect(tokens[`--color-text-${family}`]).toBe(
+ ramp[mode === 'light' ? 30 : 90],
+ );
+ }
+ },
+ );
+
+ it('keeps light input rims and syntax attributes above their thresholds', () => {
+ const {green, neutral, red, yellow} = stoneModePalettes;
+ const surface = neutral.light[100];
+ const syntaxBackground = neutral.light[95];
+ const diffAlpha = 0x40 / 255;
+ const addedRow = blend(green.light[90], syntaxBackground, diffAlpha);
+ const removedRow = blend(red.light[90], syntaxBackground, diffAlpha);
+
+ expect(contrast(green.light[55], surface)).toBeGreaterThanOrEqual(3);
+ expect(contrast(yellow.light[55], surface)).toBeGreaterThanOrEqual(3);
+ for (const background of [syntaxBackground, addedRow, removedRow]) {
+ expect(contrast(yellow.light[40], background)).toBeGreaterThanOrEqual(
+ 4.5,
+ );
+ }
+
+ expect(stoneTheme.components?.['text-input']?.['status:success']).toEqual({
+ '--color-success': `light-dark(${green.light[55]}, ${green.dark[70]})`,
+ });
+ expect(stoneTheme.components?.['text-input']?.['status:warning']).toEqual({
+ '--color-warning': `light-dark(${yellow.light[55]}, ${yellow.dark[70]})`,
+ });
+ });
+});
diff --git a/packages/themes/stone/src/stoneTheme.ts b/packages/themes/stone/src/stoneTheme.ts
index 6a299170a5..144336fe44 100644
--- a/packages/themes/stone/src/stoneTheme.ts
+++ b/packages/themes/stone/src/stoneTheme.ts
@@ -4,65 +4,66 @@
* Stone Theme
*
* A warm, earthy neutral theme inspired by natural stone and sandstone.
- * Core palette: #28282A, #84848B, #D8D8DB, #f3f3f5, #FFFFFF
+ * Colors reference the reviewed Stone palette generated from palette.config.json.
* Montserrat for headings, Figtree for body, JetBrains Mono for code.
*/
import {defineTheme, defineSyntaxTheme} from '@astryxdesign/core/theme';
import {stoneIconRegistry} from './icons';
+import {stonePaletteRefs} from './stonePaletteRefs.generated';
+
+const {blue, cyan, green, neutral, orange, pink, purple, red, teal, yellow} =
+ stonePaletteRefs;
+
+const lightDark = (light: string, dark: string): string =>
+ `light-dark(${light}, ${dark})`;
+const withAlpha = (color: string, alpha: string): string => `${color}${alpha}`;
/**
- * Input status border overrides (per-component, per-status). All 9 input
- * components share inputStatusBorderStyles in core, which read
- * --color-{success,warning,error} (T30 light / T80 dark = saturated text
- * tone). Stone redefines those vars inside each input's status scope to
- * T60 light / T70 dark so the border (and the matching status icon) reads
- * as a softer hue rim, in line with the gentle T90 status message bubble.
+ * Input status borders and icons use softer mid-ramp stops than status text.
+ * All supported input components share this one mapping so their status
+ * treatment remains consistent.
*/
const INPUT_STATUS_VARS = {
'status:success': {
- '--color-success': 'light-dark(#7f977e, #99b298)', // Green T60 / T70
+ '--color-success': lightDark(green.light[55], green.dark[70]),
},
'status:warning': {
- '--color-warning': 'light-dark(#9f8f68, #bbaa81)', // Yellow T60 / T70
+ '--color-warning': lightDark(yellow.light[55], yellow.dark[70]),
},
'status:error': {
- '--color-error': 'light-dark(#a58b86, #c0a5a1)', // Red T60 / T70
+ '--color-error': lightDark(red.light[60], red.dark[70]),
},
} as const;
/**
- * Stone syntax palette — light values snap to T40 / T45 stops on the
- * stone categorical ramps (per audit drawer); dark values stay at T70.
- *
- * `string` and `property` both land on Teal T40 — intentional; the audit
- * unified them since green and teal are visually adjacent at T40 and
- * the stone neutral palette doesn't carry a distinct green stop.
+ * Stone syntax uses mid-ramp colors in light mode and lighter stops in dark
+ * mode. Light strings and properties share Teal; dark strings use Green 70,
+ * while dark properties remain Teal.
*/
const stoneSyntax = defineSyntaxTheme({
name: 'astryx-stone',
tokens: {
- keyword: ['#645a72', '#b2a7c1'], // Purple T40 / T70
- string: ['#4e6357', '#9bb19a'], // Teal T40 / Green T70
- comment: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70
- number: ['#755752', '#bea792'], // Red T40 / Orange T70
- function: ['#506072', '#99adc6'], // Blue T40 / T70
- type: ['#645a72', '#b2a7c1'], // Purple T40 / T70
- variable: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70
- operator: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70
- constant: ['#755752', '#bea792'], // Red T40 / Orange T70
- tag: ['#775751', '#c7a39d'], // Red T40 / T70
- attribute: ['#79693f', '#b6aa90'], // Yellow T45 / T70
- property: ['#4e6357', '#94b2a0'], // Teal T40 / T70
- punctuation: ['#5e5e5e', '#ababb0'], // Stone Neutral T40 / T70
- background: ['#f3f3f5', '#171719'],
- // Diff rows: the muted green/red at 25% in light and 20% in dark keep
- // every token at or above 4.5:1 on the tint; the markers are the tinted
- // text tokens (8.1:1 light, 8.8:1 dark on their tints).
- added: ['#d0e9ce40', '#b4cdb233'],
- removed: ['#f9dcd740', '#dcc0bc33'],
- 'added-marker': ['#374c36', '#d0e9ce'],
- 'removed-marker': ['#58413e', '#f9dcd7'],
+ keyword: [purple.light[40], purple.dark[70]],
+ string: [teal.light[40], green.dark[70]],
+ comment: [neutral.light[40], neutral.dark[70]],
+ number: [red.light[40], orange.dark[70]],
+ function: [blue.light[40], blue.dark[70]],
+ type: [purple.light[40], purple.dark[70]],
+ variable: [neutral.light[40], neutral.dark[70]],
+ operator: [neutral.light[40], neutral.dark[70]],
+ constant: [red.light[40], orange.dark[70]],
+ tag: [red.light[40], red.dark[70]],
+ attribute: [yellow.light[40], yellow.dark[70]],
+ property: [teal.light[40], teal.dark[70]],
+ punctuation: [neutral.light[40], neutral.dark[70]],
+ background: [neutral.light[95], neutral.dark[5]],
+ // Translucent diff rows retain each token's contrast while the opaque
+ // markers carry the same Green and Red families as their row tint.
+ added: [withAlpha(green.light[90], '40'), withAlpha(green.dark[80], '33')],
+ removed: [withAlpha(red.light[90], '40'), withAlpha(red.dark[80], '33')],
+ 'added-marker': [green.light[30], green.dark[90]],
+ 'removed-marker': [red.light[30], red.dark[90]],
},
});
@@ -151,145 +152,135 @@ export const stoneTheme = defineTheme({
syntax: stoneSyntax,
tokens: {
- // =========================================================================
- // Colors — warm stone palette
- // Core: #28282A, #84848B, #D8D8DB, #f3f3f5, #FFFFFF
- // =========================================================================
-
- // Core semantic — all neutrals H=291
- // Stone 900 T=16 C=1.4, Stone 500 T=55 C=4, Stone 300 T=86 C=1.6, Stone 100 T=96 C=1
- '--color-accent': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15
- '--color-accent-muted': ['#25252a14', '#f3f3f520'], // light: Stone Neutral T15 · 8% / dark: T96 · 12.5%
- '--color-neutral': ['#25252a0f', '#f3f3f51a'], // light: Stone Neutral T15 · 6% / dark: T96 · 10%
- '--color-background-surface': ['#ffffff', '#1b1b1f'], // dark: Stone Neutral T10
- '--color-background-body': ['#f3f3f5', '#111015'], // dark: Stone Neutral T5
- '--color-overlay': ['#25252a80', '#28282acc'], // light: Stone Neutral T15 · 50% / dark: 80%
- '--color-overlay-hover': ['#25252a0d', '#f3f3f50d'], // light: Stone Neutral T15 · 5% / dark: T96 · 5%
- '--color-overlay-pressed': ['#25252a1a', '#f3f3f51a'], // light: Stone Neutral T15 · 10% / dark: T96 · 10%
- '--color-background-muted': ['#e2e2e8', '#3b3b3f'], // light: Stone Neutral T90
-
- // Text — H=291
- '--color-text-primary': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15
- // T40/T70 keeps normal secondary text above AA on every stone surface,
- // including the muted and tinted fills that components pair it with.
- '--color-text-secondary': ['#5e5e63', '#ababb0'], // Stone Neutral T40 / T70
- '--color-text-disabled': ['#d7d7da', '#5e5e61'], // T86 C=1.6 / T40 C=2
- '--color-text-accent': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15
- '--color-on-dark': '#FFFFFF',
- '--color-on-light': ['#25252a', '#28282a'], // light: Stone Neutral T15
- '--color-on-accent': ['#ffffff', '#25252a'], // dark: Stone Neutral T15
- // Text on top of matching status surface (badge fill, banner content).
- '--color-on-success': ['#374c36', '#d0e9ce'], // Green T30 / T90
- '--color-on-error': ['#58413e', '#f9dcd7'], // Red T30 / T90
- '--color-on-warning': ['#524622', '#f4e1b7'], // Yellow T30 / T90
-
- // Icon — H=291
- '--color-icon-accent': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15
- '--color-icon-primary': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15
- '--color-icon-secondary': ['#83838a', '#9d9da3'], // T55 C=4 / T65 C=3
- '--color-icon-disabled': ['#d7d7da', '#5e5e61'], // T86 C=1.6 / T40 C=2
-
- // Surface variants — H=291
- '--color-background-card': ['#FFFFFF', '#242325'], // T14
- '--color-background-popover': ['#ffffff', '#25252a'], // dark: Stone Neutral T15
- '--color-background-inverted': ['#25252a', '#f3f3f5'], // light: Stone Neutral T15
-
- // Status / Sentiment — T50 from palette for icons/borders (visible color)
- '--color-success': ['#374c36', '#b4cdb2'], // Green T30 / T80
- '--color-success-muted': ['#d0e9ce', '#b4cdb2'], // Green T90 / T80
- '--color-error': ['#58413e', '#dcc0bc'], // Red T30 / T80
- '--color-error-muted': ['#f9dcd7', '#dcc0bc'], // Red T90 / T80
- '--color-warning': ['#524622', '#d7c59c'], // Yellow T30 / T80
- '--color-warning-muted': ['#f4e1b7', '#d7c59c'], // Yellow T90 / T80
-
- // Border — H=291
- '--color-border': ['#e2e2e8', '#f3f3f51a'], // light: Stone Neutral T90 / dark: T96 · 10%
- '--color-border-emphasized': ['#83838a', '#5e5e61'], // T55 C=4 / T40 C=2
-
- // Effects — H=291
- '--color-skeleton': ['#d4d4da', '#5e5e64'], // T85 / T40 from H=291 C=3
- '--color-shadow': ['#25252a1a', '#0000004d'], // light: Stone Neutral T15 · 10% / dark: 30%
- '--color-tint-hover': ['black', 'white'],
+ // Core neutrals
+ '--color-accent': [neutral.light[15], neutral.dark[95]],
+ '--color-accent-muted': [
+ withAlpha(neutral.light[15], '14'),
+ withAlpha(neutral.dark[95], '20'),
+ ],
+ '--color-neutral': [
+ withAlpha(neutral.light[15], '0f'),
+ withAlpha(neutral.dark[95], '1a'),
+ ],
+ '--color-background-surface': [neutral.light[100], neutral.dark[10]],
+ '--color-background-body': [neutral.light[95], neutral.dark[5]],
+ '--color-overlay': [
+ withAlpha(neutral.light[15], '80'),
+ withAlpha(neutral.dark[15], 'cc'),
+ ],
+ '--color-overlay-hover': [
+ withAlpha(neutral.light[15], '0d'),
+ withAlpha(neutral.dark[95], '0d'),
+ ],
+ '--color-overlay-pressed': [
+ withAlpha(neutral.light[15], '1a'),
+ withAlpha(neutral.dark[95], '1a'),
+ ],
+ '--color-background-muted': [neutral.light[90], neutral.dark[25]],
+
+ // Text
+ '--color-text-primary': [neutral.light[15], neutral.dark[95]],
+ // These stops keep normal secondary text readable on Stone's body,
+ // muted, and categorical surfaces.
+ '--color-text-secondary': [neutral.light[40], neutral.dark[70]],
+ '--color-text-disabled': [neutral.light[85], neutral.dark[40]],
+ '--color-text-accent': [neutral.light[15], neutral.dark[95]],
+ '--color-on-dark': neutral.light[100],
+ '--color-on-light': [neutral.light[15], neutral.dark[15]],
+ '--color-on-accent': [neutral.light[100], neutral.dark[15]],
+ '--color-on-success': [green.light[30], green.dark[90]],
+ '--color-on-error': [red.light[30], red.dark[90]],
+ '--color-on-warning': [yellow.light[30], yellow.dark[90]],
+
+ // Icon
+ '--color-icon-accent': [neutral.light[15], neutral.dark[95]],
+ '--color-icon-primary': [neutral.light[15], neutral.dark[95]],
+ '--color-icon-secondary': [neutral.light[55], neutral.dark[65]],
+ '--color-icon-disabled': [neutral.light[85], neutral.dark[40]],
+
+ // Surface variants
+ '--color-background-card': [neutral.light[100], neutral.dark[15]],
+ '--color-background-popover': [neutral.light[100], neutral.dark[20]],
+ '--color-background-inverted': [neutral.light[15], neutral.dark[95]],
+
+ // Status / sentiment
+ '--color-success': [green.light[30], green.dark[80]],
+ '--color-success-muted': [green.light[90], green.dark[80]],
+ '--color-error': [red.light[30], red.dark[80]],
+ '--color-error-muted': [red.light[90], red.dark[80]],
+ '--color-warning': [yellow.light[30], yellow.dark[80]],
+ '--color-warning-muted': [yellow.light[90], yellow.dark[80]],
+
+ // Border
+ '--color-border': [neutral.light[90], withAlpha(neutral.dark[95], '1a')],
+ '--color-border-emphasized': [neutral.light[55], neutral.dark[40]],
+
+ // Effects
+ '--color-skeleton': [neutral.light[85], neutral.dark[40]],
+ '--color-shadow': [
+ withAlpha(neutral.light[15], '1a'),
+ withAlpha(neutral.dark[0], '4d'),
+ ],
+ '--color-tint-hover': [neutral.light[0], neutral.dark[100]],
// Typography override
'--text-supporting-size': '12px',
- // Categorical hues
- // Light: T90 solid bg + T30 text (pastel surface, dark text)
- // Dark: T35 solid bg + T90 text — snaps to canonical palette stops
- // per theming-infra.mdc §7. T90 dark text is the SAME hex as
- // the light-mode bg pastel — clean palette symmetry, ~6–9:1
- // contrast on the T35 surface across all hues (passes AA Body).
- // Borders: light T85 / dark T25 — one step inward from surface in both
- // modes, matching the light-mode T90/T85 spacing.
-
- // Categorical — Blue H=265 C=10
- '--color-background-blue': ['#d7e4f5', '#485362'], // light T90 / dark T35
- '--color-border-blue': ['#c9d6e7', '#313c4a'], // light T85 / dark T25
- '--color-icon-blue': ['#3c4856', '#d7e4f5'], // light T30 / dark T90
- '--color-text-blue': ['#3c4856', '#d7e4f5'],
-
- // Categorical — Cyan H=190 C=10
- '--color-background-cyan': ['#cce8e5', '#3e5755'],
- '--color-border-cyan': ['#bedad7', '#28403e'],
- '--color-icon-cyan': ['#334b49', '#cce8e5'],
- '--color-text-cyan': ['#334b49', '#cce8e5'],
-
- // Categorical — Gray (pure neutral, C=0). Same T35/T25/T90 pattern from
- // the neutral H=291 C=3 ramp.
- '--color-background-gray': ['#e2e2e8', '#525257'], // light: Stone Neutral T90
- '--color-border-gray': ['#d4d4da', '#3b3b3f'], // light: Stone Neutral T85
- '--color-icon-gray': ['#46464b', '#e2e2e8'], // light: Stone Neutral T30
- '--color-text-gray': ['#46464b', '#e2e2e8'], // light: Stone Neutral T30
-
- // Categorical — Green H=142 C=17
- '--color-background-green': ['#d0e9ce', '#425841'],
- '--color-border-green': ['#c2dbc0', '#2b402b'],
- '--color-icon-green': ['#374c36', '#d0e9ce'],
- '--color-text-green': ['#374c36', '#d0e9ce'],
-
- // Categorical — Orange H=70 C=22
- '--color-background-orange': ['#ffdcbb', '#684d32'],
- '--color-border-orange': ['#f1ceae', '#4f361c'],
- '--color-icon-orange': ['#5b4227', '#ffdcbb'],
- '--color-text-orange': ['#5b4227', '#ffdcbb'],
-
- // Categorical — Pink H=340 C=9
- '--color-background-pink': ['#f0dde8', '#5e4e57'],
- '--color-border-pink': ['#e2cfda', '#463740'],
- '--color-icon-pink': ['#52424c', '#f0dde8'],
- '--color-text-pink': ['#52424c', '#f0dde8'],
-
- // Categorical — Purple H=307 C=11
- '--color-background-purple': ['#e8dff3', '#564f60'],
- '--color-border-purple': ['#d9d1e5', '#3f3949'],
- '--color-icon-purple': ['#4b4454', '#e8dff3'],
- '--color-text-purple': ['#4b4454', '#e8dff3'],
-
- // Categorical — Red H=33 C=11
- '--color-background-red': ['#f9dcd7', '#644d49'],
- '--color-border-red': ['#ebcec9', '#4c3633'],
- '--color-icon-red': ['#58413e', '#f9dcd7'],
- '--color-text-red': ['#58413e', '#f9dcd7'],
-
- // Categorical — Teal H=158 C=9
- '--color-background-teal': ['#d4e7dc', '#46564d'],
- '--color-border-teal': ['#c6d9ce', '#303f36'],
- '--color-icon-teal': ['#3b4a41', '#d4e7dc'],
- '--color-text-teal': ['#3b4a41', '#d4e7dc'],
-
- // Categorical — Yellow H=90 C=23
- '--color-background-yellow': ['#f4e1b7', '#5e512d'],
- '--color-border-yellow': ['#e5d3a9', '#463a18'],
- '--color-icon-yellow': ['#524622', '#f4e1b7'],
- '--color-text-yellow': ['#524622', '#f4e1b7'],
-
- // =========================================================================
- // Radius — clean and subtle
- // --radius-none and --radius-full are always fixed and must never be
- // scaled by a theme (see defineTheme's radius config docs) — 0 and
- // 9999px respectively, matching @astryxdesign/core's own defaults.
- // =========================================================================
+ // Categorical
+ // Light mode pairs pastel stop 90 surfaces with stop 30 foregrounds.
+ // Dark mode pairs stop 35 surfaces with stop 90 foregrounds; borders move
+ // one step inward in both modes.
+ '--color-background-blue': [blue.light[90], blue.dark[35]],
+ '--color-border-blue': [blue.light[85], blue.dark[25]],
+ '--color-icon-blue': [blue.light[30], blue.dark[90]],
+ '--color-text-blue': [blue.light[30], blue.dark[90]],
+
+ '--color-background-cyan': [cyan.light[90], cyan.dark[35]],
+ '--color-border-cyan': [cyan.light[85], cyan.dark[25]],
+ '--color-icon-cyan': [cyan.light[30], cyan.dark[90]],
+ '--color-text-cyan': [cyan.light[30], cyan.dark[90]],
+
+ '--color-background-gray': [neutral.light[90], neutral.dark[35]],
+ '--color-border-gray': [neutral.light[85], neutral.dark[25]],
+ '--color-icon-gray': [neutral.light[30], neutral.dark[90]],
+ '--color-text-gray': [neutral.light[30], neutral.dark[90]],
+
+ '--color-background-green': [green.light[90], green.dark[35]],
+ '--color-border-green': [green.light[85], green.dark[25]],
+ '--color-icon-green': [green.light[30], green.dark[90]],
+ '--color-text-green': [green.light[30], green.dark[90]],
+
+ '--color-background-orange': [orange.light[90], orange.dark[35]],
+ '--color-border-orange': [orange.light[85], orange.dark[25]],
+ '--color-icon-orange': [orange.light[30], orange.dark[90]],
+ '--color-text-orange': [orange.light[30], orange.dark[90]],
+
+ '--color-background-pink': [pink.light[90], pink.dark[35]],
+ '--color-border-pink': [pink.light[85], pink.dark[25]],
+ '--color-icon-pink': [pink.light[30], pink.dark[90]],
+ '--color-text-pink': [pink.light[30], pink.dark[90]],
+
+ '--color-background-purple': [purple.light[90], purple.dark[35]],
+ '--color-border-purple': [purple.light[85], purple.dark[25]],
+ '--color-icon-purple': [purple.light[30], purple.dark[90]],
+ '--color-text-purple': [purple.light[30], purple.dark[90]],
+
+ '--color-background-red': [red.light[90], red.dark[35]],
+ '--color-border-red': [red.light[85], red.dark[25]],
+ '--color-icon-red': [red.light[30], red.dark[90]],
+ '--color-text-red': [red.light[30], red.dark[90]],
+
+ '--color-background-teal': [teal.light[90], teal.dark[35]],
+ '--color-border-teal': [teal.light[85], teal.dark[25]],
+ '--color-icon-teal': [teal.light[30], teal.dark[90]],
+ '--color-text-teal': [teal.light[30], teal.dark[90]],
+
+ '--color-background-yellow': [yellow.light[90], yellow.dark[35]],
+ '--color-border-yellow': [yellow.light[85], yellow.dark[25]],
+ '--color-icon-yellow': [yellow.light[30], yellow.dark[90]],
+ '--color-text-yellow': [yellow.light[30], yellow.dark[90]],
+
+ // Radius
'--radius-none': '0px',
'--radius-inner': '0.25rem',
'--radius-element': '0.5rem',
@@ -297,17 +288,15 @@ export const stoneTheme = defineTheme({
'--radius-page': '1.5rem',
'--radius-full': '9999px',
- // =========================================================================
// Shadows
- // =========================================================================
- '--shadow-low': '0 2px 4px #28282A0D, 0 4px 8px #28282A1A',
- '--shadow-med': '0 2px 4px #28282A0D, 0 4px 12px #28282A1A',
- '--shadow-high': '0 4px 6px #28282A1A, 0 12px 24px #28282A26',
- '--shadow-inset-hover': 'inset 0px 0px 0px 2px #28282A30',
- '--shadow-inset-selected': 'inset 0px 0px 0px 2px #28282A50',
- '--shadow-inset-success': 'inset 0px 0px 0px 2px #83838a30',
- '--shadow-inset-warning': 'inset 0px 0px 0px 2px #83838a30',
- '--shadow-inset-error': 'inset 0px 0px 0px 2px #83838a30',
+ '--shadow-low': `0 2px 4px ${withAlpha(neutral.light[15], '0d')}, 0 4px 8px ${withAlpha(neutral.light[15], '1a')}`,
+ '--shadow-med': `0 2px 4px ${withAlpha(neutral.light[15], '0d')}, 0 4px 12px ${withAlpha(neutral.light[15], '1a')}`,
+ '--shadow-high': `0 4px 6px ${withAlpha(neutral.light[15], '1a')}, 0 12px 24px ${withAlpha(neutral.light[15], '26')}`,
+ '--shadow-inset-hover': `inset 0 0 0 2px ${withAlpha(neutral.light[15], '30')}`,
+ '--shadow-inset-selected': `inset 0 0 0 2px ${withAlpha(neutral.light[15], '50')}`,
+ '--shadow-inset-success': `inset 0 0 0 2px ${withAlpha(neutral.light[55], '30')}`,
+ '--shadow-inset-warning': `inset 0 0 0 2px ${withAlpha(neutral.light[55], '30')}`,
+ '--shadow-inset-error': `inset 0 0 0 2px ${withAlpha(neutral.light[55], '30')}`,
},
components: {
@@ -322,7 +311,8 @@ export const stoneTheme = defineTheme({
},
},
- // Semantic variants point at categorical hue tokens — single source of truth.
+ // Badges, banners, and field status messages share the categorical
+ // surfaces and foregrounds so each semantic state has one visual source.
badge: {
'variant:info': {
backgroundColor: 'var(--color-background-blue)',
@@ -346,10 +336,8 @@ export const stoneTheme = defineTheme({
},
},
- // StyleX paints the banner surface from @layer priority4 (above
- // @layer astryx-theme), so a direct backgroundColor override loses the
- // cascade. Redefine the muted token instead so StyleX's var() resolves
- // to the categorical bg in our scope.
+ // Banner surface declarations live above the theme layer, so redirect the
+ // semantic variables here instead of attempting a losing direct fill.
banner: {
'status:info': {
'--color-accent-muted': 'var(--color-background-blue)',
@@ -377,44 +365,38 @@ export const stoneTheme = defineTheme({
},
},
- // Fill: light = T90 (same hex as banner/badge surface — fill reads as
- // the same color family as the matching status surface). Dark = T70.
- // Hexes from the preview Tonal Palettes ramp. accent (default) +
- // indeterminate both route to blue for the in-progress / loading look.
+ // Progress fills use the same family as their matching status surface;
+ // the darker stop in dark mode keeps the channel visible on dark tracks.
'progress-bar-fill': {
'variant:accent': {
- backgroundColor: 'light-dark(#d7e4f5, #a0acbc)', // Blue T90 / T70
+ backgroundColor: lightDark(blue.light[90], blue.dark[70]),
},
'variant:success': {
- backgroundColor: 'light-dark(#d0e9ce, #9ab298)', // Green T90 / T70
+ backgroundColor: lightDark(green.light[90], green.dark[70]),
},
'variant:warning': {
- backgroundColor: 'light-dark(#f4e1b7, #bbaa82)', // Yellow T90 / T70
+ backgroundColor: lightDark(yellow.light[90], yellow.dark[70]),
},
'variant:error': {
- backgroundColor: 'light-dark(#f9dcd7, #c0a5a0)', // Red T90 / T70
+ backgroundColor: lightDark(red.light[90], red.dark[70]),
},
},
- // Track default --color-background-muted reads near-body in stone;
- // redirect to --color-skeleton so the channel stays visible.
+ // The default muted track is too close to Stone's body surface.
'progress-bar-track': {
base: {
backgroundColor: 'var(--color-skeleton)',
},
},
- // Switch off-state track reads --color-background-gray by default.
- // Redefine it inside the switch scope to --color-skeleton, matching
- // the ProgressBar track. The on-state reads --color-accent (unaffected);
- // disabled-off also picks up --color-skeleton for consistency.
+ // Match the Switch off-state track to the visible ProgressBar track.
switch: {
base: {
'--color-background-gray': 'var(--color-skeleton)',
},
},
- // FieldStatus surface matches badge — see badge override above.
+ // FieldStatus surfaces match the corresponding badge and banner family.
'field-status': {
'type:success': {
backgroundColor: 'var(--color-background-green)',
@@ -427,8 +409,7 @@ export const stoneTheme = defineTheme({
},
},
- // Input status borders + icons across all 9 input components share the
- // same softer T60/T70 redirection. See INPUT_STATUS_VARS above.
+ // Every input status border and icon uses INPUT_STATUS_VARS above.
'text-input': INPUT_STATUS_VARS,
'text-area': INPUT_STATUS_VARS,
'number-input': INPUT_STATUS_VARS,
@@ -460,9 +441,11 @@ export const stoneTheme = defineTheme({
});
/**
- * Raw tonal palettes — every color at every tone step (0–100 in 5s).
- * Same hue and chroma used to derive all theme tokens.
- * Use these for custom components or data visualization.
+ * Frozen released compatibility palettes. These values preserve the public
+ * `stonePalettes` numeric stops, `hue`, and `chroma` for existing consumers;
+ * the maintained theme renders selected stops from
+ * `stonePalettes.generated.ts` instead. Components should consume semantic
+ * theme tokens, and charts should use the data-visualization color API.
*/
export const stonePalettes = {
neutral: {
diff --git a/packages/themes/stone/stone.spec.md b/packages/themes/stone/stone.spec.md
new file mode 100644
index 0000000000..60c6150822
--- /dev/null
+++ b/packages/themes/stone/stone.spec.md
@@ -0,0 +1,179 @@
+---
+schema_version: 2
+template_version: 2
+kind: theme
+id: theme:stone
+authority: current
+approved_by: rubyycheung
+approved_at: 2026-10-17
+review_triggers:
+ [tokens, palette-values, component-mappings, contrast, artifacts]
+verified_by:
+ [
+ packages/themes/stone/src/stoneTheme.test.ts,
+ packages/themes/stone/src/stoneColorMapping.test.ts,
+ scripts/check-stone-secondary-text-contrast.test.mjs,
+ ]
+package: '@astryxdesign/theme-stone'
+source_theme: packages/themes/stone/src/stoneTheme.ts
+references:
+ [
+ architecture:theme-authoring-contract,
+ architecture:theme-tokens,
+ architecture:theme-compilation,
+ ]
+---
+
+# Stone theme specification
+
+## Intent and audience
+
+Stone provides a quiet, handcrafted theme built from warm violet-neutral
+surfaces and restrained earthy categorical colors. Status and categorical
+states remain recognizable without becoming brighter than the neutral canvas.
+
+## Inheritance and base
+
+Stone starts from Astryx core defaults and overrides selected typography,
+motion, radius, shadow, semantic color, syntax, icon, and component values. It
+does not extend another published package theme.
+
+## Portable token overrides
+
+The exact maintained values live in `source_theme`. Stone owns its surface
+ladder, content hierarchy, status and categorical selections, color-bearing
+syntax and shadow values, and existing component mappings. Portable token
+vocabulary remains owned by `architecture:theme-tokens`.
+
+## Theme-local role definitions
+
+Stone defines no public theme-local token names. Its package-specific decisions
+are expressed through existing portable tokens and component mapping slots.
+
+## Tonal palette definitions
+
+Stone owns complete private light and dark ramps for neutral, red, orange,
+yellow, green, teal, cyan, blue, purple, and pink. The committed request,
+generated module, and receipt reproduce the accepted `astryx-oklch-v1` result.
+The palette preserves Stone's violet-neutral identity and its exact Orange
+stop-90 and light Yellow stop-90 pastel anchors. Green, Yellow, Teal, and Cyan
+use reviewed re-seeded midpoints rather than the released compatibility-ramp
+midpoints.
+
+Palette generation is explicit maintenance work and never runs during a normal
+theme build. The generated request uses only fields implemented by the recipe.
+
+## Component and state mappings
+
+Stone maps existing semantic and categorical roles to named Stone palette stops.
+Badges, banners, field statuses, progress fills, and input status rims preserve
+their existing meanings while sharing one reviewed color source. Components
+consume semantic tokens rather than the complete palette.
+
+Stone defines no additional component states or data-visualization colors.
+
+## Compatibility and migration
+
+The released `stonePalettes` export remains a flat shared ramp for each family,
+including numeric stops and `hue` and `chroma` metadata. Complete mode-aware
+ramps remain private to authoring, mapping, tests, and review tooling.
+
+Consumers can extend `stoneTheme` and override color, syntax, shadow, and
+component values while preserving the released package contract.
+
+## Accessibility and contrast evidence
+
+Stone-specific tests verify secondary text, the maintained light input status
+rims, and light syntax attributes. Mapping tests verify the selected stops for
+categorical roles; rendered-component evidence covers those categorical states.
+A palette stop alone is not an accessibility claim; contextual component evidence
+remains authoritative.
+Light input success and warning rims use Green and Yellow stop 55, measuring
+3.46:1 and 3.33:1 against the white input surface. Light syntax attributes use
+Yellow stop 40, measuring 5.19:1 on the code background and at least 5.00:1 on
+added and removed diff rows.
+
+## Build and artifact contract
+
+The package and CLI template carry identical palette requests, generated
+candidates, receipts, selected-reference modules, and theme mappings. The
+selected-reference module is deterministically derived from `source_theme` and
+the committed private palette. A non-writing check fails for missing, extra,
+stale, or invalid references.
+
+Normal package builds consume the committed selected references and never
+regenerate palette values.
+
+## Verification map
+
+| Theme contract | Evidence | Representative states | Failure signal |
+| ----------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------- | ---------------------------------------------------------- |
+| Palette identity | Config, generated module, receipt, reproduction test | light and dark; every family | Regeneration changes accepted values or stable provenance. |
+| Role mapping | Stone mapping and theme tests | semantic, categorical, syntax, effects | A maintained role bypasses selected Stone references. |
+| Public compatibility | Flat-ramp compatibility test and package build | numeric stops; `hue`; `chroma` | A released member or shape changes. |
+| Contextual contrast | Stone contrast tests and rendered components | secondary text; input rims; syntax attribute; rendered categorical states | A tested pairing misses its required threshold. |
+| Package/template parity | Byte comparison and build | package and CLI template | Copies diverge. |
+
+## Decision log
+
+### DEC-1 — Stone owns one reproducible mode-aware palette
+
+**Reference:** `theme:stone/DEC-1`
+**Decider:** `rubyycheung`, `2026-10-17`
+
+Stone keeps its warm violet-neutral canvas and restrained earthy categorical
+identity in complete private light and dark ramps. Request, generated result,
+receipt, and visual evidence change together.
+
+Rejected: inheriting another theme's palette or regenerating values during
+normal builds.
+
+### DEC-2 — Existing roles use selected Stone palette references
+
+**Reference:** `theme:stone/DEC-2`
+**Decider:** `rubyycheung`, `2026-10-17`
+
+Stone's semantic, categorical, syntax, and color-bearing effect values use named
+Stone palette stops. Alpha variants derive from the selected stop. Mappings are
+role-aware rather than blind nearest-color substitutions.
+
+Rejected: adding data-visualization overrides or letting components consume the
+complete private palette.
+
+### DEC-3 — The released flat palette stays compatible
+
+**Reference:** `theme:stone/DEC-3`
+**Decider:** `rubyycheung`, `2026-10-17`
+
+`stonePalettes` keeps its released flat family shape, numeric stops, `hue`, and
+`chroma`. Mode-aware ramps remain private authoring data.
+
+Rejected: forcing existing consumers onto a new public palette shape.
+
+### DEC-4 — Runtime references are deterministic and minimal
+
+**Reference:** `theme:stone/DEC-4`
+**Decider:** `rubyycheung`, `2026-10-17`
+
+Stone's selected-reference module contains exactly the family, mode, and stop
+values referenced by the maintained theme. Write mode synchronizes package and
+CLI-template outputs; check mode compares the complete projection without
+writing.
+
+Rejected: bundling the complete private palette or maintaining a manual
+selection manifest.
+
+## Open questions
+
+- **OQ1 — Cross-theme contrast methodology** (`human-design`): Which current
+ design record owns the human visual and accessibility methodology used to
+ judge token and color pairings? No current design record owns this dependency;
+ Stone owns only its theme-specific pairings, exceptions, and measured evidence.
+
+## Content boundary
+
+This record owns Stone's intent, selected token and palette mappings, required
+pairings and states, theme-specific exceptions, measured receipts, known gaps,
+compatibility, artifacts, and evidence. Shared generation mechanics and token
+vocabulary belong to architecture and tooling. Component behavior belongs to
+component or family records. Consumer syntax belongs to consumer documentation.
diff --git a/scripts/check-stone-secondary-text-contrast.test.mjs b/scripts/check-stone-secondary-text-contrast.test.mjs
index 88cb8864b3..34f4f808fd 100644
--- a/scripts/check-stone-secondary-text-contrast.test.mjs
+++ b/scripts/check-stone-secondary-text-contrast.test.mjs
@@ -17,10 +17,8 @@
*/
import {describe, expect, it} from 'vitest';
-import {
- stonePalettes,
- stoneTheme,
-} from '../packages/themes/stone/src/stoneTheme.ts';
+import {palette as stoneModePalettes} from '../packages/themes/stone/src/stonePalettes.generated.ts';
+import {stoneTheme} from '../packages/themes/stone/src/stoneTheme.ts';
import {
compositeOver,
contrastRatio,
@@ -28,8 +26,8 @@ import {
import {parseColor} from '../packages/core/src/utils/color.ts';
const MODES = [
- {name: 'light', index: 0, secondaryTone: 40},
- {name: 'dark', index: 1, secondaryTone: 70},
+ {name: 'light', mode: 'light', index: 0, secondaryTone: 40},
+ {name: 'dark', mode: 'dark', index: 1, secondaryTone: 70},
];
/** WCAG 2.1 AA for normal-size text. */
@@ -72,9 +70,9 @@ function resolveSurface(name, modeIndex) {
describe('Stone secondary text contrast', () => {
it.each(MODES)(
'uses canonical stone contrast tones in $name mode',
- ({index, secondaryTone}) => {
+ ({index, mode, secondaryTone}) => {
expect(resolveToken('--color-text-secondary', index)).toBe(
- stonePalettes.neutral[secondaryTone],
+ stoneModePalettes.neutral[mode][secondaryTone],
);
},
);
diff --git a/scripts/generate-stone-palette-refs.mjs b/scripts/generate-stone-palette-refs.mjs
new file mode 100644
index 0000000000..640c8ec748
--- /dev/null
+++ b/scripts/generate-stone-palette-refs.mjs
@@ -0,0 +1,77 @@
+#!/usr/bin/env node
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+/* global process */
+
+/**
+ * @file Stone-specific entry point for selected palette-reference generation.
+ * @input Stone's theme source and committed full palette.
+ * @output Stone's package palette refs and matching CLI theme template copy.
+ * @position Thin theme wrapper around the shared selected-reference generator.
+ */
+
+import * as path from 'node:path';
+import {fileURLToPath, pathToFileURL} from 'node:url';
+import {
+ countSelectedRefs,
+ createSelectedPaletteRefGenerator,
+} from './generate-selected-palette-refs.mjs';
+
+const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
+
+export const THEME_SOURCE_REL = 'packages/themes/stone/src/stoneTheme.ts';
+export const FULL_PALETTE_REL =
+ 'packages/themes/stone/src/stonePalettes.generated.ts';
+export const SELECTED_REFS_REL =
+ 'packages/themes/stone/src/stonePaletteRefs.generated.ts';
+export const TEMPLATE_REFS_REL =
+ 'packages/cli/assets/templates/themes/stone/stonePaletteRefs.generated.ts';
+
+const generator = createSelectedPaletteRefGenerator({
+ themeDisplayName: 'Stone',
+ paletteRefsIdentifier: 'stonePaletteRefs',
+ themeSourceRel: THEME_SOURCE_REL,
+ fullPaletteRel: FULL_PALETTE_REL,
+ selectedRefsRel: SELECTED_REFS_REL,
+ templateRefsRel: TEMPLATE_REFS_REL,
+ regenerateCommand: 'pnpm generate:stone-palette-refs',
+});
+
+export function generateStonePaletteRefs({root = ROOT, check = false} = {}) {
+ return generator.generateSelectedPaletteRefs({root, check});
+}
+
+function main() {
+ const check = process.argv.includes('--check');
+ const result = generateStonePaletteRefs({check});
+ const count = countSelectedRefs(result.selected);
+
+ if (check && result.problems.length > 0) {
+ process.stderr.write(
+ `\nStone selected palette refs are out of sync:\n` +
+ result.problems
+ .map(
+ problem =>
+ ` - ${path.relative(ROOT, problem.output)} ${problem.reason}`,
+ )
+ .join('\n') +
+ `\nRun: pnpm generate:stone-palette-refs\n\n`,
+ );
+ return 1;
+ }
+
+ if (check) {
+ process.stdout.write(
+ `Stone selected palette refs are in sync (${count} stops).\n`,
+ );
+ } else {
+ for (const output of result.outputs) {
+ process.stdout.write(`Wrote ${path.relative(ROOT, output)}\n`);
+ }
+ process.stdout.write(`Selected ${count} referenced palette stops.\n`);
+ }
+ return 0;
+}
+
+if (import.meta.url === pathToFileURL(process.argv[1] || '').href) {
+ process.exit(main());
+}
diff --git a/scripts/generate-stone-palette-refs.test.mjs b/scripts/generate-stone-palette-refs.test.mjs
new file mode 100644
index 0000000000..34066d2888
--- /dev/null
+++ b/scripts/generate-stone-palette-refs.test.mjs
@@ -0,0 +1,153 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+/**
+ * @file Focused tests for Stone's selected palette-reference wrapper.
+ * @input Synthetic Stone theme references and full-palette literals.
+ * @output Proof that Stone binds the shared generator to both required outputs.
+ * @position Regression coverage for generate-stone-palette-refs.mjs.
+ */
+
+import * as fs from 'node:fs';
+import * as os from 'node:os';
+import * as path from 'node:path';
+import {fileURLToPath} from 'node:url';
+import {describe, expect, it} from 'vitest';
+import {themePaletteGenerate} from '../packages/cli/api/theme/palette/generate/generate.mjs';
+import {assertPaletteReceiptsMatch} from './palette-receipt-test-utils.mjs';
+import {countSelectedRefs} from './generate-selected-palette-refs.mjs';
+import {
+ FULL_PALETTE_REL,
+ SELECTED_REFS_REL,
+ TEMPLATE_REFS_REL,
+ THEME_SOURCE_REL,
+ generateStonePaletteRefs,
+} from './generate-stone-palette-refs.mjs';
+
+const FULL_PALETTE = `export const palette = {
+ blue: {
+ name: 'Blue',
+ light: {25: '#112233', 80: '#445566'},
+ dark: {25: '#778899', 80: '#aabbcc'},
+ },
+ neutral: {
+ name: 'Stone Neutral',
+ light: {100: '#ffffff'},
+ dark: {5: '#111111'},
+ },
+} as const;
+`;
+
+const THEME_SOURCE = `
+const {blue: stoneBlue, neutral} = stonePaletteRefs;
+export const stoneTheme = {
+ first: stoneBlue.dark[80],
+ direct: stonePaletteRefs.blue.light[25],
+ repeated: stoneBlue.dark[80],
+ surface: neutral.light[100],
+};
+`;
+
+describe('Stone selected palette ref generation', () => {
+ it('reproduces the committed full palette and receipt from its config', () => {
+ const root = path.resolve(
+ path.dirname(fileURLToPath(import.meta.url)),
+ '..',
+ );
+ const temp = fs.mkdtempSync(
+ path.join(os.tmpdir(), 'astryx-stone-palette-'),
+ );
+ try {
+ fs.copyFileSync(
+ path.join(root, 'packages/themes/stone/palette.config.json'),
+ path.join(temp, 'palette.config.json'),
+ );
+ themePaletteGenerate(
+ 'palette.config.json',
+ {
+ out: 'stonePalettes.generated.ts',
+ preview: 'stone-palette-preview.html',
+ },
+ {cwd: temp},
+ );
+
+ const generated = fs.readFileSync(
+ path.join(temp, 'stonePalettes.generated.ts'),
+ 'utf8',
+ );
+ const committed = fs
+ .readFileSync(
+ path.join(
+ root,
+ 'packages/themes/stone/src/stonePalettes.generated.ts',
+ ),
+ 'utf8',
+ )
+ .replace(
+ '// Copyright (c) Meta Platforms, Inc. and affiliates.\n\n',
+ '',
+ );
+ expect(generated).toBe(committed);
+ assertPaletteReceiptsMatch(
+ JSON.parse(
+ fs.readFileSync(
+ path.join(temp, 'stonePalettes.generated.receipt.json'),
+ 'utf8',
+ ),
+ ),
+ JSON.parse(
+ fs.readFileSync(
+ path.join(
+ root,
+ 'packages/themes/stone/src/stonePalettes.generated.receipt.json',
+ ),
+ 'utf8',
+ ),
+ ),
+ );
+ } finally {
+ fs.rmSync(temp, {recursive: true, force: true});
+ }
+ });
+
+ it('generates the package artifact and CLI template through the shared path', () => {
+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'astryx-stone-refs-'));
+ try {
+ const themeSource = path.join(root, THEME_SOURCE_REL);
+ const fullPalette = path.join(root, FULL_PALETTE_REL);
+ fs.mkdirSync(path.dirname(themeSource), {recursive: true});
+ fs.writeFileSync(themeSource, THEME_SOURCE);
+ fs.writeFileSync(fullPalette, FULL_PALETTE);
+
+ const generated = generateStonePaletteRefs({root});
+
+ expect(countSelectedRefs(generated.selected)).toBe(3);
+ expect(generated.outputs).toEqual([
+ path.join(root, SELECTED_REFS_REL),
+ path.join(root, TEMPLATE_REFS_REL),
+ ]);
+ expect(generated.content).toContain(
+ "// Generated from the committed full palette for the stops used by Stone's",
+ );
+ expect(generated.content).toContain(
+ '// theme source. Regenerate with `pnpm generate:stone-palette-refs`.',
+ );
+ expect(generated.content).toContain('export const stonePaletteRefs = {');
+ expect(generated.content).toContain("dark: {80: '#aabbcc'}");
+ expect(generated.content).toContain("light: {25: '#112233'}");
+ expect(generated.content).toContain('export default stonePaletteRefs;');
+ for (const output of generated.outputs) {
+ expect(fs.readFileSync(output, 'utf-8')).toBe(generated.content);
+ }
+
+ expect(generateStonePaletteRefs({root, check: true}).problems).toEqual(
+ [],
+ );
+ fs.appendFileSync(path.join(root, TEMPLATE_REFS_REL), '// stale\n');
+ expect(generateStonePaletteRefs({root, check: true}).problems).toEqual([
+ {output: path.join(root, TEMPLATE_REFS_REL), reason: 'differs'},
+ ]);
+ } finally {
+ fs.rmSync(root, {recursive: true, force: true});
+ }
+ });
+});