Skip to content

Commit

Permalink
test: added @media at-rules test (#818)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Aug 31, 2021
1 parent f813b4c commit 1527b06
Show file tree
Hide file tree
Showing 31 changed files with 118 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions test/cases/at-media/a.css
@@ -0,0 +1,3 @@
body {
font-size: 24px;
}
3 changes: 3 additions & 0 deletions test/cases/at-media/b.css
@@ -0,0 +1,3 @@
body {
font-size: 32px;
}
3 changes: 3 additions & 0 deletions test/cases/at-media/c.css
@@ -0,0 +1,3 @@
body {
font-size: 64px;
}
3 changes: 3 additions & 0 deletions test/cases/at-media/d.css
@@ -0,0 +1,3 @@
body {
font-size: 128px;
}
3 changes: 3 additions & 0 deletions test/cases/at-media/e.css
@@ -0,0 +1,3 @@
body {
font-size: 256px;
}
40 changes: 40 additions & 0 deletions test/cases/at-media/expected/main.css
@@ -0,0 +1,40 @@
body {
font-size: 24px;
}

@media screen and (orientation: landscape) {
body {
font-size: 32px;
}

}
/*@import url("./c.css") supports(display: flex);*/
/*@import url("./d.css") supports(display: flex) screen and (min-width: 400px);*/
/*@import url("./e.css") supports( display : flex ) screen and ( min-width : 400px ) ;*/
/*@import url("./f.css") supports(not (display: flex));*/
/*@import url("./g.css") SUPPORTS(NOT (DISPLAY: FLEX));*/

div {
color: blue;
}

@media {
div {
color: red;
}
}

@media screen and (min-width: 900px) {
article {
padding: 1rem 3rem;
}
}

@supports (display: flex) {
@media screen and (min-width: 900px) {
article {
display: flex;
}
}
}

3 changes: 3 additions & 0 deletions test/cases/at-media/f.css
@@ -0,0 +1,3 @@
body {
font-size: 512px;
}
3 changes: 3 additions & 0 deletions test/cases/at-media/g.css
@@ -0,0 +1,3 @@
body {
font-size: 1024px;
}
1 change: 1 addition & 0 deletions test/cases/at-media/index.js
@@ -0,0 +1 @@
import "./style.css";
31 changes: 31 additions & 0 deletions test/cases/at-media/style.css
@@ -0,0 +1,31 @@
@import url("./a.css");
@import url("./b.css") screen and (orientation: landscape);
/*@import url("./c.css") supports(display: flex);*/
/*@import url("./d.css") supports(display: flex) screen and (min-width: 400px);*/
/*@import url("./e.css") supports( display : flex ) screen and ( min-width : 400px ) ;*/
/*@import url("./f.css") supports(not (display: flex));*/
/*@import url("./g.css") SUPPORTS(NOT (DISPLAY: FLEX));*/

div {
color: blue;
}

@media {
div {
color: red;
}
}

@media screen and (min-width: 900px) {
article {
padding: 1rem 3rem;
}
}

@supports (display: flex) {
@media screen and (min-width: 900px) {
article {
display: flex;
}
}
}
25 changes: 25 additions & 0 deletions test/cases/at-media/webpack.config.js
@@ -0,0 +1,25 @@
import Self from "../../../src";

module.exports = {
entry: "./index.js",
module: {
rules: [
{
test: /\.css$/,
use: [
{
loader: Self.loader,
},
{
loader: "css-loader",
},
],
},
],
},
plugins: [
new Self({
filename: "[name].css",
}),
],
};
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1527b06

Please sign in to comment.