Skip to content

feat: support fraction widths like 1/2 and 12/12 - #475

Merged
ysamcode merged 2 commits into
developfrom
feat/width-fraction-values
Jul 28, 2026
Merged

feat: support fraction widths like 1/2 and 12/12#475
ysamcode merged 2 commits into
developfrom
feat/width-fraction-values

Conversation

@ysamcode

@ysamcode ysamcode commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Allow entering Tailwind fraction values (1/1212/12) in the width and other sizing inputs. Fractions map to native Tailwind utilities like w-1/2, and whole fractions like 12/12 convert to w-full since Tailwind no longer ships n/n classes.

Changes

  • Map fraction values in sizing properties to native Tailwind fraction classes (1/2w-1/2, 5/12min-w-5/12) instead of invalid arbitrary classes (w-[1/2])
  • Normalize whole fractions (12/12, 6/6) to the full keyword (w-full)
  • Applies to all sizing measurements: width, height, min/max width, min/max height
  • Document fraction widths in the MCP instructions and design reference so AI agents can use them
  • Add common width fractions (w-1/2, w-1/3, w-2/3, w-1/4, w-3/4) to class autocomplete suggestions

Test plan

  • Type 1/2 in the width input — layer gets w-1/2 and renders at 50% width
  • Type 12/12 in the width input — layer gets w-full and the input reads back 100%
  • Type 5/12 in min/max width or height inputs — native fraction classes are generated
  • Existing values (100%, 320, 50%, fit, auto) still convert as before
  • Check class autocomplete offers w-1/2 and friends

Typing a fraction like 1/2 in the width setting previously produced an
invalid arbitrary class (w-[1/2]). Fractions now map to native Tailwind
utilities (w-1/2, min-w-5/12), and whole fractions like 12/12 normalize
to the full keyword (w-full) since Tailwind no longer ships n/n classes.
@ysamcode ysamcode added the Feature request A new feature request label Jul 28, 2026
@ysamcode ysamcode self-assigned this Jul 28, 2026
@ysamcode ysamcode added the Feature request A new feature request label Jul 28, 2026
MCP instructions and the design reference did not mention fraction
widths, so agents had no way to discover them. Also add common width
fractions to the class autocomplete suggestions.
@ysamcode
ysamcode merged commit fa2a758 into develop Jul 28, 2026
2 of 3 checks passed
@ysamcode
ysamcode deleted the feat/width-fraction-values branch July 28, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature request A new feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant