Skip to content

fix(linter): keep YAML numeric lineHeight as a unitless multiplier - #174

Closed
juliosuas wants to merge 2 commits into
google-labs-code:mainfrom
juliosuas:fix/numeric-lineheight-dtcg
Closed

fix(linter): keep YAML numeric lineHeight as a unitless multiplier#174
juliosuas wants to merge 2 commits into
google-labs-code:mainfrom
juliosuas:fix/numeric-lineheight-dtcg

Conversation

@juliosuas

Copy link
Copy Markdown
Contributor

Fixes #172.

What changed

YAML parses unquoted lineHeight: 1.6 as a number. The typography model only accepted string dimensions, so that value was silently dropped and export --format dtcg omitted lineHeight even though it was in the source.

Treat a finite numeric lineHeight as a unitless multiplier (the DTCG meaning). Bare numbers on fontSize / letterSpacing still error because those properties require an explicit unit.

This does not invent a letterSpacing default. DESIGN.md has no source value for that required DTCG field; emitting 0 would be a separate design choice.

Verification

  • bun test src/linter/model/handler.test.ts src/linter/dtcg/handler.test.ts src/linter/dtcg/conformance.test.ts — 62 passed, 1 skipped, 0 failed.

AI assistance

Cursor Grok Bot assisted with investigation, the regression test, and drafting this PR. I reviewed the change and ran the tests above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dtcg export omits required typography properties, so output fails the schema it declares

1 participant