Skip to content

Percentage support#983

Open
dwrth wants to merge 3 commits into
bokuweb:masterfrom
dwrth:percentage-support
Open

Percentage support#983
dwrth wants to merge 3 commits into
bokuweb:masterfrom
dwrth:percentage-support

Conversation

@dwrth

@dwrth dwrth commented Mar 10, 2026

Copy link
Copy Markdown

Proposed solution

Fixes #651 by adding support for percentages.

Tradeoffs

No known ones

Testing Done

Works nicely, also added a new storybook section for this

@bokuweb

bokuweb commented Mar 11, 2026

Copy link
Copy Markdown
Owner

@dwrth

Thanks for your great work.

I think your approach is more rigorous and preferable, but since size is defined with the following interface and writing '50%' is interpreted as a percentage, it may make sense to align the policy with that.

Specifically, how about defining it like position?: { x: (number | string), y: (number | string) };, so that, just like size, writing 50% would enable percentage-based values? That would also keep the design consistent with size.

@dwrth

dwrth commented Mar 11, 2026

Copy link
Copy Markdown
Author

@bokuweb I like that idea, makes it much more intuitive when it's aligned like that! Changes have been added

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.

Positions in percentages

2 participants