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

Commit e0078d7

Browse files
Splaktarmmalerba
authored andcommitted
fix(layout): some flex directives don't work when on a child of layout="column" or layout="row" (#11247)
* fix(layout): add missing media query overrides The current implementation's CSS rules did not properly override other rules when using @media sizes. * Add SCSS rules for flex-0 to flex-100 * Add SCSS rules for flex-33 and flex-66 Fixes #9546 * style(layout): clean up whitespace and comments
1 parent cf71d90 commit e0078d7

File tree

5 files changed

+46
-32
lines changed

5 files changed

+46
-32
lines changed

src/core/services/layout/layout-attributes.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/*
2-
*
32
* Responsive attributes
43
*
54
* References:
@@ -8,7 +7,6 @@
87
* 3) https://css-tricks.com/snippets/css/a-guide-to-flexbox/
98
* 4) https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items
109
* 5) http://godban.com.ua/projects/flexgrid
11-
*
1210
*/
1311

1412
// Layout

src/core/services/layout/layout.scss

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
/*
22
* Since Layout API uses ng-cloak to hide the dom elements while layouts are adjusted
3-
*
43
*/
54
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
65
display: none !important;
76
}
87

98
/*
10-
*
119
* Responsive attributes
1210
*
1311
* References:
@@ -16,10 +14,7 @@
1614
* 3) https://css-tricks.com/snippets/css/a-guide-to-flexbox/
1715
* 4) https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items
1816
* 5) http://godban.com.ua/projects/flexgrid
19-
*
20-
*
2117
*/
22-
2318
@-moz-document url-prefix() {
2419
.layout-fill {
2520
margin: 0;
@@ -29,18 +24,12 @@
2924
}
3025
}
3126

32-
3327
/*
3428
* Apply Mixins to create Layout/Flexbox styles
35-
*
3629
*/
37-
38-
3930
@include layouts_for_breakpoint();
4031
@include layout-padding-margin();
4132

42-
43-
4433
/**
4534
* `hide-gt-sm show-gt-lg` should hide from 600px to 1200px
4635
* `show-md hide-gt-sm` should show from 0px to 960px and hide at >960px
@@ -53,10 +42,8 @@
5342
* $layout-breakpoint-md: 1280px !default;
5443
* $layout-breakpoint-lg: 1920px !default;
5544
*/
56-
57-
5845
@media (max-width: $layout-breakpoint-xs - 1) {
59-
// Xtra-SMALL SCREEN
46+
// Xtra-SMALL SCREEN
6047
.hide-xs, .hide {
6148
&:not(.show-xs):not(.show) {
6249
display: none;

src/core/style/layout.scss

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/*
2-
*
32
* Responsive attributes
43
*
54
* References:
@@ -8,10 +7,7 @@
87
* 3) https://css-tricks.com/snippets/css/a-guide-to-flexbox/
98
* 4) https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items
109
* 5) http://godban.com.ua/projects/flexgrid
11-
*
12-
*
1310
*/
14-
1511
@mixin flex-order-for-name($sizes:null) {
1612
@if $sizes == null {
1713
$sizes : '';
@@ -142,7 +138,7 @@
142138
max-height: 100%;
143139
box-sizing: border-box;
144140

145-
// Bug workaround for http://crbug.com/546034 - flex issues on Chrome 48
141+
// Required by Chrome M48+ due to http://crbug.com/546034
146142
@if $i == 0 { min-width: 0; }
147143
}
148144

@@ -159,7 +155,7 @@
159155
max-height: 100%;
160156
box-sizing: border-box;
161157

162-
// Bug workaround for http://crbug.com/546034 - flex issues on Chrome 48
158+
// Required by Chrome M48+ due to http://crbug.com/546034
163159
@if $i == 0 { min-width: 0; }
164160
}
165161

@@ -169,9 +165,31 @@
169165
max-height: #{$value};
170166
box-sizing: border-box;
171167

172-
// Bug workaround for http://crbug.com/546034 - flex issues on Chrome 48
168+
// Required by Chrome M48+ due to http://crbug.com/546034
173169
@if $i == 0 { min-height: 0; }
174170
}
171+
172+
@if ($name != '') {
173+
.layout#{$name}-row > .flex-#{$i * 5} {
174+
flex: 1 1 100%;
175+
max-width: #{$value};
176+
max-height: 100%;
177+
box-sizing: border-box;
178+
179+
// Required by Chrome M48+ due to http://crbug.com/546034
180+
@if $i == 0 { min-width: 0; }
181+
}
182+
183+
.layout#{$name}-column > .flex-#{$i * 5} {
184+
flex: 1 1 100%;
185+
max-width: 100%;
186+
max-height: #{$value};
187+
box-sizing: border-box;
188+
189+
// Required by Chrome M48+ due to http://crbug.com/546034
190+
@if $i == 0 { min-height: 0; }
191+
}
192+
}
175193
}
176194

177195
.layout-row {
@@ -188,19 +206,35 @@
188206
> .#{$flexName}-33 { flex: 1 1 100%; max-width: 33.33%; max-height: 100%; box-sizing: border-box; }
189207
> .#{$flexName}-66 { flex: 1 1 100%; max-width: 66.66%; max-height: 100%; box-sizing: border-box; }
190208

191-
// Bug workaround for http://crbug.com/546034 - flex issues on Chrome 48
209+
// Required by Chrome M48+ due to http://crbug.com/546034
192210
> .flex { min-width: 0; }
193-
194211
}
195212

196213
.layout#{$name}-column {
197214
> .#{$flexName}-33 { flex: 1 1 100%; max-width: 100%; max-height: 33.33%; box-sizing: border-box; }
198215
> .#{$flexName}-66 { flex: 1 1 100%; max-width: 100%; max-height: 66.66%; box-sizing: border-box; }
199216

200-
// Bug workaround for http://crbug.com/546034 - flex issues on Chrome 48
217+
// Required by Chrome M48+ due to http://crbug.com/546034
201218
> .flex { min-height: 0; }
202219
}
203220

221+
@if ($name != '') {
222+
.layout#{$name}-row {
223+
> .flex-33 { flex: 1 1 100%; max-width: 33.33%; max-height: 100%; box-sizing: border-box; }
224+
> .flex-66 { flex: 1 1 100%; max-width: 66.66%; max-height: 100%; box-sizing: border-box; }
225+
226+
// Required by Chrome M48+ due to http://crbug.com/546034
227+
> .flex { min-width: 0; }
228+
}
229+
230+
.layout#{$name}-column {
231+
> .flex-33 { flex: 1 1 100%; max-width: 100%; max-height: 33.33%; box-sizing: border-box; }
232+
> .flex-66 { flex: 1 1 100%; max-width: 100%; max-height: 66.66%; box-sizing: border-box; }
233+
234+
// Required by Chrome M48+ due to http://crbug.com/546034
235+
> .flex { min-height: 0; }
236+
}
237+
}
204238
}
205239

206240
@mixin layout-align-for-name($suffix: null) {

src/core/style/structure.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ input {
171171
top: 0;
172172
bottom: 0;
173173
z-index: $z-index-scroll-mask-bar;
174-
box-shadow: inset 0px 0px 1px rgba(0, 0, 0, 0.3)
174+
box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.3)
175175
}
176176
}
177177

src/core/style/typography.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ html, body {
1818
-moz-osx-font-smoothing: grayscale; // [4]
1919
}
2020

21-
md-select, md-card, md-list, md-toolbar,
22-
ul, ol, p, h1, h2, h3, h4, h5, h6 {
23-
//text-rendering: optimizeLegibility;
24-
}
25-
2621
/************
2722
* Headings
2823
************/

0 commit comments

Comments
 (0)