8000 [css-grid-1][css-sizing-3] aspect-ratio-only boxes should be able to size to grid container · Issue #4228 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[css-grid-1][css-sizing-3] aspect-ratio-only boxes should be able to size to grid container #4228

@fantasai

Description

@fantasai

If we put an image which has only an aspect ratio into an auto-row/auto-column grid cell in a fixed-size grid...

  • We try to find the range of size for the auto tracks by finding the min/max contributions of its items.
  • The grid item, being an image with no size, has a min-content contribution of zero. According to css-sizing-3, it takes its max-content size from the available space (if that is definite) or else falls back to 300px.
  • The available space to a grid item when finding its max-content contribution is undefined. :(

(We don't run into this problem for non-replaced elements, because their min/max-content contributions don't refer to the available space in the inline dimension, and for orthogonal flows we do define the available space.)

The available logical width we provide to an item with an aspect ratio and no size should either be the “available grid space” (the size of the grid container if definite), or it should be infinity. (Infinity in this case will resolve to an image width of 300px/ICB size depending on issue #4218.) In the case where the grid container's size is definite, do we want to use it instead?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0