Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[flex] Sizing images with intrisic aspect-ratio: ¿harmonize with grids? #1112

@FremyCompany

Description

@FremyCompany

In #523 (comment), @mrego mentioned that the change we proposed to Grid to enable images to shrink while maintaining their aspect ratio, but no to fill maintaining their aspect ratio created a potential difference between flex and grid.

Since I had absolutely no idea what flex was doing in that case, I wrote a few test cases and -- surprise! -- we are not interoperable :) The good news is that this means maybe we can try to match what we do in grid, but the bad news is that this means some of us have bugs to fix...

Here are the two test cases:

I had a quick discussion with @fantasai and she seemed to believe Edge is behaving the per-spec in this case. It would be a good idea to think about what we are doing here and maybe try to match this behavior in grid for the /normal/ alignment as much as it makes sense.

Now that we have both "stretch" to force-stretch and "width:contain" to force-fit, I think it would make sense to try to get the default behaviors of grid and flex match where possible.

The difference is that grids do not have a preferred axis like flex does, but maybe we could change grid to behave as-if in these cases (the preferred axis being deduced from the writing mode)? Or is there a way to make flexbox functioning more like what we said to do for grids in another way that would make more sense?

Thoughts?

cc @gregwhitworth @tabatkins @dbaron

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions