Skip to content

fix: resolve token references in rounded and spacing sections#26

Merged
davideast merged 1 commit into
google-labs-code:mainfrom
tejas100:fix/resolve-rounded-spacing-token-refs
Apr 22, 2026
Merged

fix: resolve token references in rounded and spacing sections#26
davideast merged 1 commit into
google-labs-code:mainfrom
tejas100:fix/resolve-rounded-spacing-token-refs

Conversation

@tejas100

Copy link
Copy Markdown
Contributor

Summary

Fixes #25

Token references in rounded and spacing sections were never resolved
into their respective Maps. Only the colors section had a Phase 2
resolution pass. This meant any valid token reference like {rounded.sm}
or {spacing.base} was silently dropped from the Tailwind export with no
error or warning emitted.

Root Cause

In model/handler.ts, Phase 1 stores unresolved references in symbolTable
only — they are never added to the rounded or spacing Maps. Unlike
colors, there was no Phase 2 pass to resolve them.

Fix

Added Phase 2 resolution passes for rounded and spacing, mirroring
the existing pattern used for colors.

Tests

Added 7 new test cases to model/handler.test.ts covering:

  • Direct token reference resolution in rounded
  • Chained token reference resolution in rounded
  • Direct token reference resolution in spacing
  • Chained token reference resolution in spacing
  • Symbol table correctness after resolution
  • End-to-end propagation into component resolution

All 201 tests pass.

@google-cla

google-cla Bot commented Apr 22, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@davideast

Copy link
Copy Markdown
Collaborator

Thank you so much @tejas100!

@davideast davideast merged commit 8ecd464 into google-labs-code:main Apr 22, 2026
3 checks passed
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.

bug: token references in rounded and spacing are silently dropped from Tailwind export

2 participants