Skip to content

[css-grid-1] Flex like control over grid items #1344

Closed
@lassediercks

Description

@lassediercks

I'm referring to the grid-column shorthand.


I tried to implement a grid where the children adapt to the size of the container.

At one point I expected a grid item to behave similar to what we know from the the flex-grow property.

Test case: https://codepen.io/lassediercks/pen/XRZbBo

Above 935px the grid looks fine,
Belove 935px I expect the .aside div to flow to the next line


The purpose of this issue is a proposal to add a behaviour similar to flex:

When our container looks like this

.container{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

and a grid-item like this

.item{
   grid-column-flex: 2;
}

We can expect .item to have the width of 2*minmax(250px, 1fr)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions