You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@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
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
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.
The text was updated successfully, but these errors were encountered: