Re: [csswg-drafts] [css-grid] Removing grid-items from layout calculations in one direction, especially for `auto-fit`

That's more-or-less the layout - the only missing bit is that the `ul` would be `display: grid` with `auto-fit` to allow the tabs to wrap but all be the same width.

The main reason I want to group the tab and the tab content together is so it falls back without CSS grid to an accordion - `heading, content, heading, content` - and even makes sense without CSS. This would simplify working with a frontend component framework where the tab can be a single component, rather than splitting out tab heading and tab content.

>From a purist perspective I feel CSS shouldn't be dictating how we write our markup - and that seems to be the motivation behind `display: contents`.

I think `auto-fit` has the potential to be more useful than `auto-fill` because it adapts to the content, which is great for reusable components, but in cases like this it ends up falling back to behaving like `auto-fill`. My other thought about this was changing how the dropped columns or rows get calculated with `auto-fit`, that it would ignore grid items that span all repeated tracks in the calculations.

-- 
GitHub Notification of comment by pmccloghrylaing
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3271#issuecomment-439285940 using your GitHub account

Received on Friday, 16 November 2018 05:24:34 UTC