Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 3d32c2e

Browse files
devversionjelbourn
authored andcommitted
feat(layout): add flex noshrink attribute to prevent shrinking
Fixes #6067 Closes #6100
1 parent c668ba4 commit 3d32c2e

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

docs/app/partials/layout-children.tmpl.html

+4
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ <h3>Additional Flex Values</h3>
146146
<td>flex="grow"</td>
147147
<td>Will grow and shrink as needed. Starts with a size of 100%. Same as <code>flex="100"</code>.</td>
148148
</tr>
149+
<tr>
150+
<td>flex="noshrink"</td>
151+
<td>Will grow as needed, but won't shrink. Starts with a size based on it's <code>width</code> and <code>height</code> values.</td>
152+
</tr>
149153
</table>
150154

151155

src/core/services/layout/layout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
var SUFFIXES = /(-gt)?-(sm|md|lg)/g;
77
var WHITESPACE = /\s+/g;
88

9-
var FLEX_OPTIONS = ['grow', 'initial', 'auto', 'none'];
9+
var FLEX_OPTIONS = ['grow', 'initial', 'auto', 'none', 'noshrink'];
1010
var LAYOUT_OPTIONS = ['row', 'column'];
1111
var ALIGNMENT_MAIN_AXIS= [ "", "start", "center", "end", "stretch", "space-around", "space-between" ];
1212
var ALIGNMENT_CROSS_AXIS= [ "", "start", "center", "end", "stretch" ];

src/core/services/layout/layout.scss

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
.#{$flexName}-initial { flex: 0 1 auto; box-sizing: border-box; }
131131
.#{$flexName}-auto { flex: 1 1 auto; box-sizing: border-box; }
132132
.#{$flexName}-none { flex: 0 0 auto; box-sizing: border-box; }
133+
.#{$flexName}-noshrink { flex: 1 0 auto; box-sizing: border-box; }
133134

134135
// (1-20) * 5 = 0-100%
135136
@for $i from 0 through 20 {

0 commit comments

Comments
 (0)