3
3
// * BASE Contao Framework
4
4
// * erdmann-freunde.de/nutshell/
5
5
// *
6
- // * Lizenziert unter MIT OPEN SOURCE
6
+ // * Lizenziert unter MIT OPEN SOURCE
7
7
// *
8
8
9
9
//
@@ -30,14 +30,14 @@ $grid__columns: 12 !default;
30
30
grid-template-columns : repeat (var (--grid__columns ), 1fr );
31
31
grid-column-gap : var (--grid__gutter );
32
32
grid-auto-columns : 1fr ;
33
-
33
+
34
34
@supports not (display : grid ) {
35
35
display : flex ;
36
36
flex-wrap : wrap ;
37
37
margin-left : calc (-1 * var (--grid__gutter ) / 2 );
38
38
margin-right : calc (-1 * var (--grid__gutter ) / 2 );
39
39
}
40
-
40
+
41
41
.ie & {
42
42
display : flex ;
43
43
flex-wrap : wrap ;
@@ -49,83 +49,97 @@ $grid__columns: 12 !default;
49
49
// column default floating
50
50
%column-floating {
51
51
grid-column : 1 / -1 ;
52
-
52
+
53
53
@supports not (display : grid ) {
54
54
padding-left : var (--grid__gutter--half );
55
55
padding-right : var (--grid__gutter--half );
56
56
}
57
-
57
+
58
58
.ie & {
59
59
padding-left : var (--grid__gutter--half );
60
60
padding-right : var (--grid__gutter--half );
61
61
}
62
62
}
63
63
64
+ @for $i from 1 through $grid__columns { // [3][4]
65
+ .col-#{$i } { // [2][3]
66
+ grid-column : span $i / span $i ;
67
+
68
+ @supports not (display : grid ) {
69
+ width : percentage ($i / $grid__columns );
70
+ }
71
+
72
+ .ie & {
73
+ width : percentage ($i / $grid__columns );
74
+ }
75
+ }
76
+ }
77
+
64
78
// [1] length($breakpoints) - go through length of available viewports (xs, sm, md, lg, xl == 5)
65
79
// [2] $current - actual viewport (e.g. "xs")
66
80
// [3] $i - counter, returns the actual grid-column
67
81
// [4] var(--grid__columns) - go through available columns (e.g. 1 --> 12)
68
82
69
83
// [5] override clear- class for the next viewport by default
70
- // this means, you can add a clear-xs class to an element, but the clear will only affect the current viewport.
84
+ // this means, you can add a clear-xs class to an element, but the clear will only affect the current viewport.
71
85
@for $size from 1 through length ($breakpoints ) { // [1]
72
86
$x : nth ($breakpoints , $size ); // [2]
73
87
$current : nth ($x , 1 ); // [2]
74
-
88
+
75
89
// column creation
76
90
@for $i from 1 through $grid__columns { // [3][4]
77
91
.col-#{$current } -#{$i } { // [2][3]
78
92
@extend %column-floating ;
79
93
}
80
94
}
81
-
95
+
82
96
// width creation for every col- class
83
97
@include media-query (screen- #{$current } ) { // [2]
84
98
85
- @for $i from 1 through $grid__columns { // [3][4]
86
- .col-#{$current } -#{$i } { // [2][3]
87
- grid-column : span $i / span $i ;
88
-
89
- @supports not (display : grid ) {
99
+ @for $i from 1 through $grid__columns { // [3][4]
100
+ .col-#{$current } -#{$i } { // [2][3]
101
+ grid-column : span $i / span $i ;
102
+
103
+ @supports not (display : grid ) {
90
104
width : percentage ($i / $grid__columns );
91
105
}
92
-
106
+
93
107
.ie & {
94
108
width : percentage ($i / $grid__columns );
95
109
}
96
- }
97
- }
110
+ }
111
+ }
98
112
}
99
-
113
+
100
114
// height creation for every row-span- class
101
115
@include media-query (screen- #{$current } ) { // [2]
102
116
103
- @for $i from 1 through $grid__columns { // [3][4]
104
- .row-span-#{$current } -#{$i } { // [2][3]
105
- grid-row : span $i / span $i ;
106
- }
107
- }
117
+ @for $i from 1 through $grid__columns { // [3][4]
118
+ .row-span-#{$current } -#{$i } { // [2][3]
119
+ grid-row : span $i / span $i ;
120
+ }
121
+ }
108
122
}
109
-
123
+
110
124
// .col-start and .row-start creation
111
125
@include media-query (screen- #{$current } ) { // [2]
112
-
113
- @for $i from 1 through $grid__columns { // [3]
114
- .col-start-#{$current } -#{$i } { // [2][3]
115
- grid-column-start : $i ;
116
- }
117
- .row-start-#{$current } -#{$i } { // [2][3]
118
- grid-row-start : $i ;
119
- }
120
- }
126
+
127
+ @for $i from 1 through $grid__columns { // [3]
128
+ .col-start-#{$current } -#{$i } { // [2][3]
129
+ grid-column-start : $i ;
130
+ }
131
+ .row-start-#{$current } -#{$i } { // [2][3]
132
+ grid-row-start : $i ;
133
+ }
134
+ }
121
135
}
122
-
136
+
123
137
// pull-left & -right creation
124
138
@include media-query (screen- #{$current } ) { // [2]
125
139
.pull-right-#{$current } { // [2]
126
140
grid-column-end : -1 ;
127
141
}
128
-
142
+
129
143
.pull-left-#{$current } { // [2]
130
144
grid-row-start : 1 ;
131
145
grid-column-end : inherit ;
@@ -214,10 +228,10 @@ $grid__columns: 12 !default;
214
228
// row-span-1-12
215
229
@for $i from 1 through $grid__columns { // [1]
216
230
.row-start-#{$i } { // [2][3]
217
- grid-row-start : $i ;
231
+ grid-row-start : $i ;
218
232
}
219
-
233
+
220
234
.row-span-#{$i } { // [2][3]
221
- grid-row : span $i / span $i ;
235
+ grid-row : span $i / span $i ;
222
236
}
223
237
}
0 commit comments