-
Notifications
You must be signed in to change notification settings - Fork 4
/
tb-grid.scss
49 lines (41 loc) · 921 Bytes
/
tb-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
// solve css min problem ...
@function css-function( $function, $values... ) {
@return $function
+ unquote( '(' )
+ $values
+ unquote( ')' ) ;
}
@function css-min( $values... ) {
@return css-function(min, $values);
}
// end solve css min problem ...
$tb-grid-breakpoints: (
xs: 0,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px,
xxl: 1400px
);
.tb-grid {
display: grid;
grid-template-columns: repeat(12, 1fr);
@for $i from 1 through 50 {
&.tb-grid-gap-#{$i} {
row-gap: #{$i}px;
column-gap: #{css-min(#{$i}px, 8%)};
}
}
> * {
grid-column-start: span 12;
}
@each $breakpoint-name, $breakpoint-value in $tb-grid-breakpoints {
@media (min-width: #{$breakpoint-value}) {
@for $i from 1 through 12 {
.tb-grid-#{$breakpoint-name}-#{$i} {
grid-column-start: span #{$i};
}
}
}
}
}