w3c / w3c/csswg-drafts

[css-grid-2] Aspect ratio and the row axis

Open
#12,964 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css-grid-2 Needs Testcase (WPT)
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

In the following test case:

<p>Test passes if there is a filled green square.</p>
<div style="display: inline-grid; background: green; aspect-ratio: 1/1; min-height: 60px; grid-template-rows: repeat(auto-fill, 50px);"></div>

All browsers appear to render a 60x60 green square, as opposed to 100x100. In order to hit the min-height, though, you'd expect to produce 2 50px rows.

Image

In the column direction, however, this works as expected, and 2 50px columns are produced, resulting in a 100x100 square:

<p>Test passes if there is a filled green square.</p>
<div style="display: inline-grid; background: green; aspect-ratio: 1/1; min-height: 60px; grid-template-columns: repeat(auto-fill, 50px);"></div>
Image

Is this expected to only work in the column direction? (Same question applies for masonry)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the two inline-grid examples from the issue and compare the row-axis and column-axis results. Read the CSS Grid 2 aspect-ratio and masonry context, then determine whether the discrepancy is expected; done means documenting or resolving the specification behavior for the row axis.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html
Domain
frontend, web-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.