-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcss-grid-utility.css
61 lines (60 loc) · 1.14 KB
/
css-grid-utility.css
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
:root {
--grid-gap: 2rem; // Control grid gap here
}
.grids {
display: grid;
grid-gap: var(--grid-gap);
}
.grids.col-1 {
grid-template-columns: repeat(1, 1fr);
}
.grids.col-2 {
grid-template-columns: repeat(2, 1fr);
}
.grids.col-3 {
grid-template-columns: repeat(3, 1fr);
}
@media (min-width: 576px) {
.grids.sm-1 {
grid-template-columns: repeat(1, 1fr);
}
.grids.sm-2 {
grid-template-columns: repeat(2, 1fr);
}
.grids.sm-3 {
grid-template-columns: repeat(3, 1fr);
}
}
@media (min-width: 768px) {
.grids.md-1 {
grid-template-columns: repeat(1, 1fr);
}
.grids.md-2 {
grid-template-columns: repeat(2, 1fr);
}
.grids.md-3 {
grid-template-columns: repeat(3, 1fr);
}
}
@media (min-width: 992px) {
.grids.lg-1 {
grid-template-columns: repeat(1, 1fr);
}
.grids.lg-2 {
grid-template-columns: repeat(2, 1fr);
}
.grids.lg-3 {
grid-template-columns: repeat(3, 1fr);
}
}
@media (min-width: 1200px) {
.grids.xl-1 {
grid-template-columns: repeat(1, 1fr);
}
.grids.xl-2 {
grid-template-columns: repeat(2, 1fr);
}
.grids.xl-3 {
grid-template-columns: repeat(3, 1fr);
}
}