- From: conteui via GitHub <noreply@w3.org>
- Date: Sun, 17 May 2026 20:41:18 +0000
- To: public-css-archive@w3.org
conteui has just created a new issue for https://github.com/w3c/csswg-drafts:
== Flexbox stretch issue: aspect-ratio width ignored compared to explicit width ==
**Summary:**
Flexbox `stretch` behavior appears to ignore width derived from `aspect-ratio`,
while explicit `width`/`min-width`/`max-width` values `prevent` stretching.
In effect, `stretch` seems to treat aspect-ratio sizing as if the width were `auto`,
rather than respecting the intrinsic width implied by the ratio.
This creates an inconsistency where `aspect-ratio` does not `behave` like
other intrinsic sizing constraints in the cross axis.
**Reproduction:**
```html
<div class="wrapper">
<button>Button</button>
</div>
```
```css
.wrapper {
display: flex;
flex-direction: column;
}
button {
height: 48px;
aspect-ratio: 1;
}
```
**Current behavior:**
The button stretches to fill the entire width of the flex container.
**Expected behavior:**
Since aspect-ratio combined with a definite height produces a predictable width,
it may be expected to behave similarly to explicit width sizing and prevent stretch behavior.
**Workaround:**
```css
align-items: flex-start;
```
or
```css
width: fit-content;
```
**Question:**
Is this intentional Flexbox behavior,
a specification limitation,
or an implementation detail inherited from pre-aspect-ratio sizing rules?
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13937 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Sunday, 17 May 2026 20:41:19 UTC