W3C home > Mailing lists > Public > www-style@w3.org > February 2016

RE: [css-grid] grid shorthand and grid-auto-rows/cols

From: François REMY <francois.remy.dev@outlook.com>
Date: Sun, 28 Feb 2016 15:50:20 -0800
Message-ID: <DUB408-EAS27846B233B464A1ACE4B021A5B90@phx.gbl>
To: "'fantasai'" <fantasai.lists@inkedblade.net>, <www-style@w3.org>
> > What if we just specified that when the last item of a "grid-template-
> <track>"
> > list is "repeat(auto-fit, ...)" containing one track it also sets
> > "grid-auto-<track>s" to that track size?
> That's way more magical!
> ~fantasai

Interesting, it doesn't to me. It is just about extending the scope of validity of a declaration. Consider this flexbox-like grid usage:

    .ribbon-tab {
        grid-template-rows: 30px auto;
        grid-template-columns: (start) repeat(auto-fill, 200px) (end);
        width: 1024px;
    .ribbon-tab > .caption {
        grid-row: 1;
        grid-column: start / end;
    .ribbon-tab > .ribbon-item {
        /* auto-positioned inside the second/third/nth rows of the ribbon, as needed. */

This produces the following layout

    ITEM1======== ITEM2======== ITEM3======== ITEM4========
    ITEM5======== ITEM6========

Now, consider what happens if we want to allow to display all items horizontally in one row by not specifying the max-width of the ribbon, like this:

    ITEM1======== ITEM2======== ITEM3======== ITEM4======== ITEM5======== ITEM6========

My proposal is that this should be the same as just removing "width:1024px" in the previous set of css rules.
Received on Sunday, 28 February 2016 23:50:49 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:00 UTC