[css-flexbox] [css-sizing-4] Interaction of flexbox minimum height and aspect-ratio minimum height

Open
#6,069 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by reading the min-size-auto section of CSS Flexbox and the aspect-ratio-minimum section of CSS Sizing 4, then inspect css-sizing/aspect-ratio/flex-aspect-ratio-026.html in web-platform-tests. Determine whether the two minimum-size constraints combine or whether Flexbox overrides the aspect-ratio constraint. Done means the specification interpretation is resolved and the referenced test reflects it.

Written by the indexing model from the issue text.

Description

Closed Accepted by CSSWG Resolution Commenter Response Pending css-sizing-4

https://drafts.csswg.org/css-flexbox/#min-size-auto
https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum

If an item has an aspect ratio and is a flex item, both specs impose a minimum size on a flex item. Consider:

<div style="display: flex; flex-direction: column; width: 100px;">
  <div style="aspect-ratio: 1/1">
    <div style="height: 500px;"></div>
  </div>
</div>

In this case, the flex item has two constraints:

  • Flexbox's automatic minimum size gives it a minimum height of 100px (the transferred size), because it uses the minimum of the content-based size and transferred size.
  • aspect-ratio's minimum size gives it a min-height of 500px

What should the used minimum size be? max(100px, 500px)? Or should the flexbox one "override" the aspect-ratio one?

https://github.com/web-platform-tests/wpt/blob/master/css/css-sizing/aspect-ratio/flex-aspect-ratio-026.html relies on the latter interpretation.

Dominant language
Bikeshed
Stars
4.9k
Forks
816
Avg merge
2d 18h
Merged PRs (30d)
24

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.

More from w3c/csswg-drafts

All issues in w3c/csswg-drafts

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.