Skip to content

Commit 8c024a6

Browse files
committed
Implement grid
1 parent 6ffadd4 commit 8c024a6

File tree

6 files changed

+449
-29
lines changed

6 files changed

+449
-29
lines changed

assets/objects/_grid.css

+10-14
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,22 @@
88
padding: 0 var(--gap);
99
}
1010

11-
.o-grid__item--1of2 {
12-
flex: 0 0 50%;
11+
@media (--xs) {
12+
@mixin grid xs;
1313
}
1414

15-
.o-grid__item--1of4 {
16-
flex: 0 0 25%;
15+
@media (--sm) {
16+
@mixin grid sm;
1717
}
1818

19-
.o-grid__item--1of3 {
20-
flex: 0 0 calc(100% / 3);
19+
@media (--md) {
20+
@mixin grid md;
2121
}
2222

23-
.o-grid__item--2of3 {
24-
flex: 0 0 66.66667%;
23+
@media (--lg) {
24+
@mixin grid lg;
2525
}
2626

27-
.o-grid__item--1of5 {
28-
flex: 0 0 20%;
29-
}
30-
31-
.o-grid__item--1of6 {
32-
flex: 0 0 calc(100% / 6);
27+
@media (--xl) {
28+
@mixin grid xl;
3329
}

assets/tools/_mixins.css

+12-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
margin: auto;
88
}
99

10-
@define-mixin breakpoint-helpers $bp {
11-
.hidden-$(bp) {
10+
@define-mixin breakpoint-helpers $breakpoint {
11+
.hidden-$(breakpoint) {
1212
display: none !important;
1313
}
1414

1515
@each $display in var(--displays) {
16-
.visible-$(bp)-$(display) {
16+
.visible-$(breakpoint)-$(display) {
1717
display: $(display) !important;
1818
}
1919
}
@@ -23,6 +23,15 @@
2323
display: $value !important;
2424
}
2525

26+
@define-mixin grid $breakpoint {
27+
@for $i from 1 to 12 {
28+
.$(breakpoint)-$i {
29+
max-width: calc($i / 12 * 100%);
30+
flex: 0 0 calc($i / 12 * 100%);
31+
}
32+
}
33+
}
34+
2635
@define-extend display-none {
2736
display: none !important;
2837
}

0 commit comments

Comments
 (0)