Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

top()/bottom()/left()/right() lacks multiplier on offset amount #81

Open
winstondu opened this issue Aug 28, 2019 · 1 comment
Open

Comments

@winstondu
Copy link

CSS has the ability to allow proportional margin and padding:
https://webplatform.github.io/docs/guides/the_css_layout_model/#Proportional-margins-and-padding-in-the-W3C-box-model

I was wondering if it is possible to implement a similar concept with edges. For example, if I wanted my top margin of a subview to its superview to be 20% of the superview height (i.e. subview.top = superview.top + 0.2*superview.height), how would I accomplish that?

Currently, using the multiplierparameters in width()/height() and centerX()/centerY() works, but there has to be support for the alternate form.

@roberthein
Copy link
Owner

Interesting idea @winstondu! Thanks! How would you expect the api to look like? And would you be able to setup a PR for this?

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

No branches or pull requests

2 participants