feat(pipeline): add InDesign style and design-token mapper#100
Merged
PAMulligan merged 1 commit intoJun 20, 2026
Merged
Conversation
Map the InDesign IR to an Aurelius design-token set and emit it in four formats, the next stage of the InDesign-to-React pipeline (#65, part of #62). - Cluster paragraph styles into a heading/body/caption typography scale, preserving InDesign names; align font-size, line-height, letter-spacing tokens - Build an sRGB color palette from swatches, de-duped within a configurable tolerance; warn on CMYK/Lab colors outside the sRGB gamut - Quantize paragraph spacing and indents to a configurable grid (default 4px) - Resolve fonts to web stacks via config/font-map.json with fallback warnings - Emit tokens.ts, tokens.css, tailwind.preset.ts, and a Style Dictionary design-tokens.json; expose them via aurelius-indesign --emit-tokens - 41 new tests (93 total): CMYK->sRGB, clustering, Tailwind merge, and a tokens.ts type-check under tsc Refs #65, #62 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the Style and design-token mapper — sub-issue #65 of the InDesign-to-React epic (#62). It maps the IDML IR (from #63) to a coherent Aurelius design-token set and emits it in four formats, so generated components reference a real design system instead of inline magic numbers.
New token subsystem in
packages/pipeline/src/tokens/, plus a gamut-awareconvertColorin the IDML color module and a--emit-tokensCLI flow.What the mapper does
config/font-map.json; unmapped families fall back to a generic stack and emit a warning listed in the generator report.Emitted artifacts
tokens.ts— typed, self-contained (as const)tokens.css—:rootcustom propertiestailwind.preset.ts— Tailwind v3+ preset exposing every token undertheme.extenddesign-tokens.json— Style Dictionary compatibleAcceptance criteria (#65)
tokens.tstype-checks undertsc --noEmit(verified via the TS compiler API) and validates against the publishedDesignTokensSchemaTesting
pnpm --filter @aurelius/pipeline typecheck/test/build✅ — 93 tests (41 new)eslint .(0 errors) andprettier --check .✅check-doc-counts✅; no dependency/lockfile changes.idml, withconfig/font-map.jsonresolving correctly fromdist/, out-of-gamut Lab flagged, and font fallbacks reportedNotes
tokens.tsis self-contained by default (portable into any TS project); the library can also emit asatisfies DesignTokensform.Closes #65
Part of #62
🤖 Generated with Claude Code