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

Commit

Permalink
feat(layout): add flex fixed attribute to prevent shrinking
Browse files Browse the repository at this point in the history
Fixes #6067
  • Loading branch information
devversion committed Dec 5, 2015
1 parent f6e97a0 commit 459b742
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/app/partials/layout-children.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ <h3>Additional Flex Values</h3>
<td>flex="grow"</td>
<td>Will grow and shrink as needed. Starts with a size of 100%. Same as <code>flex="100"</code>.</td>
</tr>
<tr>
<td>flex="fixed"</td>
<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>
</tr>
</table>


Expand Down
2 changes: 1 addition & 1 deletion src/core/services/layout/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
var SUFFIXES = /(-gt)?-(sm|md|lg)/g;
var WHITESPACE = /\s+/g;

var FLEX_OPTIONS = ['grow', 'initial', 'auto', 'none'];
var FLEX_OPTIONS = ['grow', 'initial', 'auto', 'none', 'fixed'];
var LAYOUT_OPTIONS = ['row', 'column'];
var ALIGNMENT_MAIN_AXIS= [ "", "start", "center", "end", "stretch", "space-around", "space-between" ];
var ALIGNMENT_CROSS_AXIS= [ "", "start", "center", "end", "stretch" ];
Expand Down
1 change: 1 addition & 0 deletions src/core/services/layout/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
.#{$flexName}-initial { flex: 0 1 auto; box-sizing: border-box; }
.#{$flexName}-auto { flex: 1 1 auto; box-sizing: border-box; }
.#{$flexName}-none { flex: 0 0 auto; box-sizing: border-box; }
.#{$flexName}-fixed { flex: 1 0 auto; box-sizing: border-box; }

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

0 comments on commit 459b742

Please sign in to comment.