-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path_block-grid.scss
108 lines (100 loc) · 2.3 KB
/
_block-grid.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// Block Grid
$block-grid-flex-direction: row !default;
$block-grid-justify-content: space-between !default;
$block-grid-align-items: flex-start !default;
$block-grid-flex-wrap: wrap !default;
@mixin block-grid {
display: flex;
width: 100%;
flex-direction: $block-grid-flex-direction;
justify-content: $block-grid-justify-content;
align-items: $block-grid-align-items;
flex-wrap: $block-grid-flex-wrap;
}
// Block Grid Alignment Classes
.block-grid {
&--justify-content-center {
justify-content: center;
}
&--justify-content-start {
justify-content: flex-start;
}
&--justify-content-space-around {
justify-content: space-around;
}
&--justify-content-end {
justify-content: flex-end;
}
}
@for $i from 1 through $max-block-grid {
$width: 100% / $i;
.block-grid-#{$i} {
@include block-grid();
.col {
flex-basis: $width;
}
}
}
// IE 10/11 Work Around
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
@for $i from 1 through $max-block-grid {
$width: 100% / $i;
.block-grid-#{$i} {
@include block-grid();
.col {
width: $width;
flex-basis: auto;
}
}
}
}
// Medium Breakpoint
@media screen and (max-width: $medium-breakpoint) {
@for $i from 1 through $max-block-grid {
$width: 100% / $i;
.md-block-grid-#{$i} {
@include block-grid();
.col {
flex-basis: $width;
}
}
}
// IE 10/11 Work Around
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
@for $i from 1 through $max-block-grid {
$width: 100% / $i;
.md-block-grid-#{$i} {
@include block-grid();
.col {
width: $width;
flex-basis: auto;
}
}
}
}
}
// Small Breakpoint
@media screen and (max-width: $small-breakpoint) {
@for $i from 1 through $max-block-grid {
$width: 100% / $i;
.sm-block-grid-#{$i} {
@include block-grid();
.col {
flex-basis: $width;
}
}
}
// IE 10/11 Work Around
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
@for $i from 1 through $max-block-grid {
$width: 100% / $i;
.sm-block-grid-#{$i} {
@include block-grid();
.col {
width: $width;
flex-basis: auto;
}
}
}
}
}