Skip to content

Commit

Permalink
fix media query joins (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Aug 1, 2023
1 parent 81a7701 commit 96b2696
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/join-media.js
Expand Up @@ -20,6 +20,8 @@ module.exports = function joinMedia(parentMedia, childMedia) {
} else {
media.push(`${parentItem} and ${childItem}`)
}
} else {
media.push(parentItem)
}
})
})
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/imports/media-query-screen.css
@@ -0,0 +1 @@
@import "foo.css" screen;
1 change: 1 addition & 0 deletions test/fixtures/media-join.css
@@ -1,3 +1,4 @@
@import "media-join-nested.css" one-1;
@import "media-join-nested.css" or-left-1, or-right-1;
@import "media-join-nested.css" and-left-1 and and-right-1;
@import "media-query-screen.css" screen;
4 changes: 4 additions & 0 deletions test/fixtures/media-join.expected.css
Expand Up @@ -15,3 +15,7 @@
@media and-left-1 and and-right-1 and or-left-2, and-left-1 and and-right-1 and or-right-2 {}

@media and-left-1 and and-right-1 and and-left-2 and and-right-2 {}

@media screen {
foo{}
}

0 comments on commit 96b2696

Please sign in to comment.