Skip to content

Commit eb2c4b0

Browse files
committed
Replace sass media query mixins with custom media queries
1 parent 92c9fc5 commit eb2c4b0

23 files changed

Lines changed: 65 additions & 108 deletions

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@
7272
"browserslist": [
7373
"defaults"
7474
],
75+
"@parcel/transformer-css": {
76+
"drafts": {
77+
"customMedia": true
78+
}
79+
},
7580
"parcel-namer-custom": {
7681
"scss/.*": "css/[name].css"
7782
},

scss/_avatar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
float: right;
77
border: 1px solid rgb(var(--color-black));
88

9-
@include screen1 {
9+
@media (--min-width1) {
1010
margin-right: 3vw;
1111
margin-left: 3vw;
1212
}

scss/_body.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body {
77
font-weight: 400;
88
line-height: var(--line-height0);
99

10-
@include screen1 {
10+
@media (--min-width1) {
1111
max-width: 1400px;
1212
padding-inline: var(--space2);
1313
}

scss/_breadcrumb.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
&:not(:nth-last-of-type(2)) {
2020
display: none;
2121

22-
@include screen1 {
22+
@media (--min-width1) {
2323
display: inline-flex;
2424
}
2525

@@ -37,15 +37,15 @@
3737
mask: url('data-url:../icons/angle-left-light.svg') center / contain;
3838
}
3939

40-
@include screen1 {
40+
@media (--min-width1) {
4141

4242
&::before {
4343
content: none;
4444
}
4545
}
4646
}
4747

48-
@include screen1 {
48+
@media (--min-width1) {
4949

5050
&:not(:last-child) {
5151

scss/_breakpoints.scss

Lines changed: 0 additions & 9 deletions
This file was deleted.

scss/_categories.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
.c-categories {
66
@include u-reset-list-styles;
77

8-
@include screen1 {
8+
@media (--min-width1) {
99
column-gap: var(--space3);
1010
column-count: 2;
1111
}
1212

13-
@include screen2 {
13+
@media (--min-width2) {
1414
column-count: auto;
1515
}
1616

scss/_checkbox.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
p { // WP Contact Form 7 generated
77
margin: 0;
88

9-
@include screen1 {
9+
@media (--min-width1) {
1010
column-count: 2;
1111
}
1212

scss/_footer.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@
5656

5757
> ul {
5858

59-
@include screen1 {
59+
@media (--min-width1) {
6060
column-gap: var(--space2);
6161
column-count: 4;
6262
}
6363

64-
@include screen2 {
64+
@media (--min-width2) {
6565
display: flex;
6666
column-count: auto;
6767
}
@@ -70,7 +70,7 @@
7070
break-inside: avoid;
7171
page-break-inside: avoid; // Firefox
7272

73-
@include screen2 {
73+
@media (--min-width2) {
7474
width: 100%;
7575

7676
&:not(:last-child) {

scss/_halfboxes.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
margin-top: var(--space3);
55
margin-bottom: var(--space3);
66

7-
@include screen1 {
7+
@media (--min-width1) {
88
display: flex;
99

1010
> * {

scss/_header.scss

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $header-logo-height: 50px;
1212
/ 1fr auto;
1313
margin-top: var(--space1);
1414

15-
@include screen2 {
15+
@media (--min-width2) {
1616
grid-template:
1717
'header-logo header-util-nav'
1818
'header-logo header-search'
@@ -32,7 +32,7 @@ $header-logo-height: 50px;
3232
grid-area: header-logo;
3333
margin-bottom: var(--space2);
3434

35-
@include screen2 {
35+
@media (--min-width2) {
3636
// stack over spanned grid-column in .c-header__search:
3737
z-index: 2;
3838
}
@@ -41,7 +41,7 @@ $header-logo-height: 50px;
4141
display: block;
4242
height: $header-logo-height;
4343

44-
@include screen2 {
44+
@media (--min-width2) {
4545
height: 4.4rem;
4646
}
4747

@@ -52,7 +52,7 @@ $header-logo-height: 50px;
5252
.c-header__controls {
5353
grid-area: header-controls;
5454

55-
@include screen2 {
55+
@media (--min-width2) {
5656
display: none;
5757
}
5858
}
@@ -76,11 +76,11 @@ $header-logo-height: 50px;
7676
transform: translateX(0);
7777
}
7878

79-
@include screen1 {
79+
@media (--min-width1) {
8080
padding-left: var(--space2);
8181
}
8282

83-
@include screen2 {
83+
@media (--min-width2) {
8484
position: static;
8585
grid-column: 1 / 3;
8686
align-items: center;
@@ -92,7 +92,7 @@ $header-logo-height: 50px;
9292
.c-search {
9393
flex: 1 0 auto;
9494

95-
@include screen2 {
95+
@media (--min-width2) {
9696
flex: 0 1 auto;
9797
width: 18rem;
9898
}
@@ -104,7 +104,7 @@ $header-logo-height: 50px;
104104
.c-header__close-search {
105105
margin-left: var(--space1);
106106

107-
@include screen2 {
107+
@media (--min-width2) {
108108
display: none;
109109
}
110110
}
@@ -129,7 +129,7 @@ $header-logo-height: 50px;
129129
.c-header__utility-nav {
130130
grid-area: header-util-nav;
131131

132-
@include screen2 {
132+
@media (--min-width2) {
133133
margin-top: 0;
134134
}
135135

0 commit comments

Comments
 (0)