[Murray]@wturrell if I'm understanding correctly, you want this to be dynamic? If so, unfortunately not, as the line wrap points can occur differently at different viewport widths
[Murray]that said, if you're using something like a fixed grid, or your items have a fixed (or at least calculable) width, you can do some fancy tricks with `calc()` and container queries. You'd need your containing element to be, well, a CSS container, but you can then write a bunch of queries that account for different wrap points
[Murray]so if you have 12 items, and sometimes there are two on a line, sometimes 3, 4, 5, etc., and each item is e.g. 10rem max width, you can have a container query that targets the container at 20rem (or more of if there's whitespace between items) and selects all `:nth-child(even)` children, which will select the 2nd, 4th, 6th etc. children, which would be the end of those lines at that width
[Murray]Then for a container of 30rem+, you switch it to `nth-child(3n+1)` , which gets the 3rd, 6th, 9th, 12th items, also now the end items of a row; at container size 40rem+ you move to `:nth-child(4n+1)` ; at 50rem+ `5n+1` etc.
[Murray]that can be a bit brute force, but it will work. Same if you're using CSS Grid, as long as you aren't using an auto-flow layout (in which case, you'd still need to use container queries)
wturrell@[Murray] thanks, that's really useful (and yes, thinking of dynamic with items of unpredictable widths not just simple first/last/nth-child etc.)
doesnm_git forge over twtxt files. Same dev as parley and yarn.social: https://gitxt.dev/ . The cool thing that all your activity stayes on your instance so technically "own" it so i think it's indieweb-relevent
dustinm`, Elleo, AramZS, deathcomestotime and [mikemai2awesom] joined the channel