HTML Diff
0 added 0 removed
Original 2026-01-01
Modified 2026-03-09
1 <p>The mechanism that is used to calculate the sizes of items when there is not enough space in the container is described as follows:</p>
1 <p>The mechanism that is used to calculate the sizes of items when there is not enough space in the container is described as follows:</p>
2 <p><b>Step 1</b>Calculate the negative space (NS) in the flex container:</p>
2 <p><b>Step 1</b>Calculate the negative space (NS) in the flex container:</p>
3 NS = The container width - Total basic sizes of the items<p><b>Step 2.</b>Find the total product of the basic sizes (TPBS) of items and use it as their shrinkage factors.</p>
3 NS = The container width - Total basic sizes of the items<p><b>Step 2.</b>Find the total product of the basic sizes (TPBS) of items and use it as their shrinkage factors.</p>
4 TBPS = (Basic size1 * flex-shrink1) + (Basic size2 * flex-shrink2) + … + (Basic sizen * flex-shrinkn)<p><b>Step 3.</b>For each item we calculate the “normative shrinkage factor” (NSF). To obtain this, we multiply the item base size by its shrinkage factor and then divide by the TBPS:</p>
4 TBPS = (Basic size1 * flex-shrink1) + (Basic size2 * flex-shrink2) + … + (Basic sizen * flex-shrinkn)<p><b>Step 3.</b>For each item we calculate the “normative shrinkage factor” (NSF). To obtain this, we multiply the item base size by its shrinkage factor and then divide by the TBPS:</p>
5 NSF = (Basic size * flex-shrink) / TBPS<p><b>Step 4.</b>Shrink the item basic size by the part of the NS that is proportional to the item NSF. We obtain the NS for the calculation from the module, that is, by discarding the minus:</p>
5 NSF = (Basic size * flex-shrink) / TBPS<p><b>Step 4.</b>Shrink the item basic size by the part of the NS that is proportional to the item NSF. We obtain the NS for the calculation from the module, that is, by discarding the minus:</p>
6 Total size = Basic size - (NSF * NS)<p>It turns out that the proportion of negative space that the item “absorbs” depends on two factors:</p>
6 Total size = Basic size - (NSF * NS)<p>It turns out that the proportion of negative space that the item “absorbs” depends on two factors:</p>
7 <ul><li>The ratio of the item shrinkage factor to the factors for the other items,</li>
7 <ul><li>The ratio of the item shrinkage factor to the factors for the other items,</li>
8 <li>The ratio of the item basic size to the basic sizes of the other items.</li>
8 <li>The ratio of the item basic size to the basic sizes of the other items.</li>
9 </ul><p>That is why normalizations are present in the formulas. Now try once again to choose the shrinkage factors.</p>
9 </ul><p>That is why normalizations are present in the formulas. Now try once again to choose the shrinkage factors.</p>