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

Commit

Permalink
fix(layout): improve responsive switches from layout column to row
Browse files Browse the repository at this point in the history
Change class definition order in flex-properties-for-name mixin.

Closes #6528. Closes #7327.
  • Loading branch information
andrey.goncharov authored and ThomasBurleson committed Jul 14, 2016
1 parent fba4f9c commit 93e2488
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 8 deletions.
31 changes: 27 additions & 4 deletions src/core/services/layout/layout-attributes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,37 @@ $layout-breakpoint-lg: 1920px !default;
box-sizing: border-box;
}

[layout="row"] > [#{$flexName}="#{$i * 5}"],
[layout="row"] > [#{$flexName}="#{$i * 5}"] {
flex: 1 1 #{$value};
max-width: #{$value};
max-height: 100%;
box-sizing: border-box;
}

[layout="column"] > [#{$flexName}="#{$i * 5}"] {
flex: 1 1 #{$value};
max-width: 100%;
max-height: #{$value};
box-sizing: border-box;
}

[layout="row"] {
> [#{$flexName}="33"] , > [#{$flexName}="33"] { flex: 1 1 33.33%; max-width: 33.33%; max-height: 100%; box-sizing: border-box; }
> [#{$flexName}="66"] , > [#{$flexName}="66"] { flex: 1 1 66.66%; max-width: 66.66%; max-height: 100%; box-sizing: border-box; }
}

[layout="column"] {
> [#{$flexName}="33"] , > [#{$flexName}="33"] { flex: 1 1 33.33%; max-width: 100%; max-height: 33.33%; box-sizing: border-box; }
> [#{$flexName}="66"] , > [#{$flexName}="66"] { flex: 1 1 66.66%; max-width: 100%; max-height: 66.66%; box-sizing: border-box; }
}

[layout#{$name}="row"] > [#{$flexName}="#{$i * 5}"] {
flex: 1 1 #{$value};
max-width: #{$value};
max-height: 100%;
box-sizing: border-box;
}

[layout="column"] > [#{$flexName}="#{$i * 5}"],
[layout#{$name}="column"] > [#{$flexName}="#{$i * 5}"] {
flex: 1 1 #{$value};
max-width: 100%;
Expand All @@ -169,11 +191,12 @@ $layout-breakpoint-lg: 1920px !default;
}
}

[layout="row"], [layout#{$name}="row"] {
[layout#{$name}="row"] {
> [#{$flexName}="33"] , > [#{$flexName}="33"] { flex: 1 1 33.33%; max-width: 33.33%; max-height: 100%; box-sizing: border-box; }
> [#{$flexName}="66"] , > [#{$flexName}="66"] { flex: 1 1 66.66%; max-width: 66.66%; max-height: 100%; box-sizing: border-box; }
}
[layout="column"], [layout#{$name}="column"] {

[layout#{$name}="column"] {
> [#{$flexName}="33"] , > [#{$flexName}="33"] { flex: 1 1 33.33%; max-width: 100%; max-height: 33.33%; box-sizing: border-box; }
> [#{$flexName}="66"] , > [#{$flexName}="66"] { flex: 1 1 66.66%; max-width: 100%; max-height: 66.66%; box-sizing: border-box; }
}
Expand Down
34 changes: 30 additions & 4 deletions src/core/style/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,33 @@
box-sizing: border-box;
}

.layout-row > .#{$flexName}-#{$i * 5},
.layout-row > .#{$flexName}-#{$i * 5} {
flex: 1 1 #{$value};
max-width: #{$value};
max-height: 100%;
box-sizing: border-box;

// Bug workaround for http://crbug.com/546034 - flex issues on Chrome 48
@if $i == 0 { min-width: 0; }
}

.layout-column > .#{$flexName}-#{$i * 5} {
flex: 1 1 #{$value};
max-width: 100%;
max-height: #{$value};
box-sizing: border-box;
}

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

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

.layout#{$name}-row > .#{$flexName}-#{$i * 5} {
flex: 1 1 #{$value};
max-width: #{$value};
Expand All @@ -147,7 +173,6 @@
@if $i == 0 { min-width: 0; }
}

.layout-column > .#{$flexName}-#{$i * 5},
.layout#{$name}-column > .#{$flexName}-#{$i * 5} {
flex: 1 1 #{$value};
max-width: 100%;
Expand All @@ -160,15 +185,16 @@

}

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

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

}
.layout-column, .layout#{$name}-column {

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

Expand Down

0 comments on commit 93e2488

Please sign in to comment.