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

[Layout] Negative margins, or some other way to separate layout and rendered element sizes #176

Open
mikejsavage opened this issue Jan 8, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@mikejsavage
Copy link
Contributor

image

Defining a layout like the above, e.g. you have a row of items and you want the selected item to be slightly bigger than the others, can be much simpler if you have an escape hatch for making elements bigger than their container. In that simple example obviously it doesn't make much difference either way, but you can imagine a more complex UI where the possibility of an item sticking out from its parent container leaks up several levels into code that ideally should not have to care about what happens at the leaves.

In CSS you can use negative margins for this. I expect that having something like a "visual expansion" property that has no impact on the element's layout would also work, although elements inside the expanded element would need to be laid out wrt the expanded size.

@nicbarker
Copy link
Owner

@mikejsavage this is a great idea, and would allow us to lift the .offset property out of the floating config and into some shared config to be used with all elements 🙂

@nicbarker nicbarker added the enhancement New feature or request label Jan 8, 2025
@nicbarker nicbarker changed the title [Feature request] Negative margins, or some other way to separate layout and rendered element sizes [Layout] Negative margins, or some other way to separate layout and rendered element sizes Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants