-
Notifications
You must be signed in to change notification settings - Fork 43
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
Support auto track definitions #7
Comments
Which type of track would you pick, though? The relatively heavy IntrinsicContentTrack? Or a FlexibleTrackSizeTrack(1)? Not sure if we can come up with an intuitive default. |
No defaults! We let the user decide. https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows
Agreed that a crash is a little harsh. Let me think about it. |
I think this should actually be quite straightforward to implement. All you'd need to do is resize to fit the item your placement grid instead of throwing an error. I have an implementation of this for my CSS Grid implementation here. As you can see, it's quite short and straightforward. And mine is actually quite a bit more complex than I think you'd need as it needs to support negative indexes (adding negative implicit tracks is a massive pain as it means the origin of grid moves!) For performance reasons I also have some logic to estimate the required size ahead of time (by scanning through the grid placements and spans of every item and finding the min/max - you'd only need the max). The logic for that is here. This doesn't completely guarantee no resizes as auto-placement can still generate more tracks but it helps in the "explicitly placed out of bounds" case. |
Auto tracks are generated automatically when the placement algorithm places an item outside the range of the templated tracks. This could be useful in some cases.
The text was updated successfully, but these errors were encountered: