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

Commit c6fb5a5

Browse files
ThomasBurlesonkara
authored andcommitted
fix(layout): fix use of flex-basis in layout modes (#9572)
Fix use of `flex-basis` when setting the max-width or max-height values. This allows `flex-offset` to work flex items correctly stretched. Fixes #5345. Closes #9572
1 parent 421fed4 commit c6fb5a5

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

docs/content/CSS/typography.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ consistency across your application.
5858
</div>
5959
<md-divider></md-divider>
6060
<ul>
61-
<li layout="column" layout-gt-md="row" layout-align="start center">
61+
<li layout="row" layout-sm="column" layout-xs="column" layout-align="start center">
6262
<span flex="25" class="docs-definition" aria-describedby="headings-selectors">
6363
<code>.md-display-4</code>
6464
</span>
65-
<h5 aria-describedby="headings-output" class="md-display-4 docs-output">Light 112px</h5>
65+
<h5 flex aria-describedby="headings-output" class="md-display-4 docs-output">Light 112px</h5>
6666
</li>
6767
<li layout="row" layout-align="start center">
6868
<span flex="25" class="docs-definition" aria-describedby="headings-selectors">

src/core/style/layout.scss

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@
130130
$value : #{$i * 5 + '%'};
131131

132132
.#{$flexName}-#{$i * 5} {
133-
flex: 1 1 #{$value};
133+
flex: 1 1 100%;
134134
max-width: #{$value};
135135
max-height: 100%;
136136
box-sizing: border-box;
137137
}
138138

139139
.layout-row > .#{$flexName}-#{$i * 5} {
140-
flex: 1 1 #{$value};
140+
flex: 1 1 100%;
141141
max-width: #{$value};
142142
max-height: 100%;
143143
box-sizing: border-box;
@@ -147,7 +147,7 @@
147147
}
148148

149149
.layout-column > .#{$flexName}-#{$i * 5} {
150-
flex: 1 1 #{$value};
150+
flex: 1 1 100%;
151151
max-width: 100%;
152152
max-height: #{$value};
153153
box-sizing: border-box;
@@ -164,7 +164,7 @@
164164
}
165165

166166
.layout#{$name}-row > .#{$flexName}-#{$i * 5} {
167-
flex: 1 1 #{$value};
167+
flex: 1 1 100%;
168168
max-width: #{$value};
169169
max-height: 100%;
170170
box-sizing: border-box;
@@ -174,7 +174,7 @@
174174
}
175175

176176
.layout#{$name}-column > .#{$flexName}-#{$i * 5} {
177-
flex: 1 1 #{$value};
177+
flex: 1 1 100%;
178178
max-width: 100%;
179179
max-height: #{$value};
180180
box-sizing: border-box;
@@ -186,17 +186,17 @@
186186
}
187187

188188
.layout#{$name}-row {
189-
> .#{$flexName}-33 , > .#{$flexName}-33 { flex: 1 1 33.33%; max-width: 33.33%; max-height: 100%; box-sizing: border-box; }
190-
> .#{$flexName}-66 , > .#{$flexName}-66 { flex: 1 1 66.66%; max-width: 66.66%; max-height: 100%; box-sizing: border-box; }
189+
> .#{$flexName}-33 , > .#{$flexName}-33 { flex: 1 1 100%; max-width: 33.33%; max-height: 100%; box-sizing: border-box; }
190+
> .#{$flexName}-66 , > .#{$flexName}-66 { flex: 1 1 100%; max-width: 66.66%; max-height: 100%; box-sizing: border-box; }
191191

192192
// Bug workaround for http://crbug.com/546034 - flex issues on Chrome 48
193193
> .flex { min-width: 0; }
194194

195195
}
196196

197197
.layout#{$name}-column {
198-
> .#{$flexName}-33 , > .#{$flexName}-33 { flex: 1 1 33.33%; max-width: 100%; max-height: 33.33%; box-sizing: border-box; }
199-
> .#{$flexName}-66 , > .#{$flexName}-66 { flex: 1 1 66.66%; max-width: 100%; max-height: 66.66%; box-sizing: border-box; }
198+
> .#{$flexName}-33 , > .#{$flexName}-33 { flex: 1 1 100%; max-width: 100%; max-height: 33.33%; box-sizing: border-box; }
199+
> .#{$flexName}-66 , > .#{$flexName}-66 { flex: 1 1 100%; max-width: 100%; max-height: 66.66%; box-sizing: border-box; }
200200

201201
// Bug workaround for http://crbug.com/546034 - flex issues on Chrome 48
202202
> .flex { min-height: 0; }

0 commit comments

Comments
 (0)