forked from pepelsbey/playground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grid.css
50 lines (43 loc) · 1.16 KB
/
grid.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
/* Grid */
.grid::before {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
content: '';
pointer-events: none;
--grid-color: rgb(255 0 0 / 0.2);
--grid-sides: 16px;
--grid-gutter: 16px;
--grid-columns: 4;
--grid-column-width: calc(
(100% - var(--grid-gutter) * var(--grid-columns)) / var(--grid-columns)
);
border: solid transparent;
border-width: 0 calc(
var(--grid-sides) - var(--grid-gutter) / 2
);
background-image: repeating-linear-gradient(
to right,
transparent 0,
transparent calc(var(--grid-gutter) / 2),
var(--grid-color) calc(var(--grid-gutter) / 2),
var(--grid-color) calc(var(--grid-column-width) + var(--grid-gutter) / 2),
transparent calc(var(--grid-column-width) + var(--grid-gutter) / 2),
transparent calc(var(--grid-column-width) + var(--grid-gutter))
);
background-repeat: no-repeat;
}
@media (min-width: 736px) {
.grid::before {
--grid-sides: 24px;
--grid-columns: 8;
}
}
@media (min-width: 1008px) {
.grid::before {
--grid-sides: 32px;
--grid-columns: 12;
}
}