Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1675

Nested flexbox shrink algorithm

$
0
0

This post about `flex-shrink` of nested flexboxes says:

Flexbox shrink calculations happen independently at each flex container level

I'd like to understand the algorithm. Do these calculations start at inner or outer flexboxes? During shrink calculations for an element, what size is assumed for the parent or child whose shrink calculations didn't happen yet? Where does the spec/documentation/tutorials explain this?

Here's some code from that thread in case it helps:

.a {  width: 700px; /* flex-basis doesn't work */}.b {  min-width: fit-content;}.c {  flex: 1 1 700px;}.flex {  display: flex;}div {  min-width: 0;  outline: 1px solid black;}
<div class="outer flex"><div class="inner flex"><div class="a"> a </div><div class="b"> bbbbbbbbbbbbbbbbbbbb </div></div><div class="c"> c </div></div>

Viewing all articles
Browse latest Browse all 1675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>