Repository navigation
Expand file tree
/
Copy pathgrid.less
More file actions
84 lines (84 loc) · 2.23 KB
/
Copy pathgrid.less
File metadata and controls
84 lines (84 loc) · 2.23 KB
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
/* === Grid === */
.row {
overflow: hidden;
margin-left: -4%;
> [class*="col-"], > [class*="tablet-"] {
box-sizing: border-box;
float: left;
}
&.no-gutter {
margin-left: 0;
}
}
@cols: 5, 10, 15, 20, 25, 100/3, 40, 50, 60, 100*(2/3), 75, 80, 85, 90, 95, 100;
.row {
.-(@i: length(@cols)) when (@i > 0) {
@divider: e(extract(@cols, @i));
@className: `Math.floor(@{divider})`;
@n: `100/parseFloat(@{divider})`;
@n-1: @n - 1;
@gutter: `4.0`;
@d: `(100-@{gutter}*@{n})/@{n}`;
.col-@{className} {
width: ~"@{d}%";
margin-left: ~"@{gutter}%";
}
&.no-gutter {
@d: `100/@{n}`;
.col-@{className} {
width: ~"@{d}%";
margin: 0;
}
}
.-((@i - 1));
} .-;
}
@media all and (min-width:768px) {
.row {
margin-left: -2%;
}
.row {
.-(@i: length(@cols)) when (@i > 0) {
@divider: e(extract(@cols, @i));
@className: `Math.floor(@{divider})`;
@n: `100/parseFloat(@{divider})`;
@n-1: @n - 1;
@gutter: `2.0`;
@d: `(100-@{gutter}*@{n})/@{n}`;
.col-@{className} {
width: ~"@{d}%";
margin-left: ~"@{gutter}%";
}
&.no-gutter {
@d: `100/@{n}`;
.col-@{className} {
width: ~"@{d}%";
margin: 0;
}
}
.-((@i - 1));
} .-;
}
.row {
.-(@i: length(@cols)) when (@i > 0) {
@divider: e(extract(@cols, @i));
@className: `Math.floor(@{divider})`;
@n: `100/parseFloat(@{divider})`;
@n-1: @n - 1;
@gutter: `2.0`;
@d: `(100-@{gutter}*@{n})/@{n}`;
.tablet-@{className} {
width: ~"@{d}%";
margin-left: ~"@{gutter}%";
}
&.no-gutter {
@d: `100/@{n}`;
.tablet-@{className} {
width: ~"@{d}%";
margin: 0;
}
}
.-((@i - 1));
} .-;
}
}