Skip to content

feat: support dynamic scale values - #10

Draft
e-simpson wants to merge 1 commit into
mgcrea:mainfrom
e-simpson:codex/scale-values
Draft

feat: support dynamic scale values#10
e-simpson wants to merge 1 commit into
mgcrea:mainfrom
e-simpson:codex/scale-values

Conversation

@e-simpson

@e-simpson e-simpson commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • support arbitrary numeric scale-*, scale-x-*, and scale-y-* utilities as Tailwind-style percentages
  • support negative numeric scale utilities
  • support percentage arbitrary values such as scale-[80%]
  • preserve Tailwind's raw multiplier semantics for arbitrary numbers such as scale-[1.25]

Why

The parser used a fixed scale map, so valid numeric utilities such as scale-80 were silently ignored. Arbitrary percentages were also rejected even though React Native scale transforms can represent them as numeric multipliers.

Numeric utility names now convert from percentages (80 to 0.8) while bracketed numbers retain the existing documented raw-multiplier contract. For an 80% scale, scale-80 is the canonical form; bracket syntax remains available for genuinely custom values.

Impact

Callers can use any numeric scale utility without extending a hard-coded map, including axis-specific and negative variants. Existing presets and arbitrary numeric values remain backward compatible.

Validation

  • bun run vitest --run src/parser/transforms.test.ts (68 tests)
  • bun run check
  • bun run lint
  • bun run format:check
  • bun run build (via the Bun dependency refresh prepare script)

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.

1 participant