-
Notifications
You must be signed in to change notification settings - Fork 0
/
sq-grid.scss
40 lines (35 loc) · 1.07 KB
/
sq-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
/*!
* SQ-UI (https://github.com/SQ-UI/sq-grid)
* Copyright 2018 Plamena Radneva
* Copyright 2018 SQ-UI
* Licensed under MIT (https://github.com/SQ-UI/sq-grid/blob/master/LICENSE)
*/
@import 'mixins';
$columns: 12;
$columnGap: 10px;
$rowGap: 20px;
.sq-grid {
//if the browser supports either css grid or flexbox
@supports (display: grid) or (display: flex) {
&.css-grid {
@include css-grid($columns, $columnGap, $rowGap);
&.auto-col-width {
@include css-grid('auto', $columnGap, $rowGap);
}
}
&.css-flexbox {
//by default, the flexbox grid consist of 12 columns
@include flexbox-grid($columns, $columnGap, $rowGap);
//if the user adds an "auto-col-width" class
//then the columns will have dynamic width
//determined by the browser
&.auto-col-width {
@include flexbox-grid('auto', $columnGap, $rowGap);
}
}
}
//if the user is unfortunate and still lives in the 90's
@supports not ((display: grid) and (display: flex)) {
@include float-grid($columns, $columnGap, $rowGap);
}
}