tests(css): postcss popular plugins (#3959)

master
Evilebot Tnawi 2018-02-12 20:12:09 +03:00 committed by GitHub
parent bff7de3ea2
commit c36cb7670a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 197 additions and 1 deletions

View File

@ -342,7 +342,9 @@ function parseNestedCSS(node) {
node.name === "mixin" ||
node.name === "include" ||
node.name === "function" ||
node.name === "return"
node.name === "return" ||
node.name === "define-mixin" ||
node.name === "add-mixin"
) {
// Remove unnecessary spaces in SCSS variable arguments
node.params = node.params.replace(/(\$\S+?)\s+?\.\.\./, "$1...");

View File

@ -0,0 +1,134 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`postcss-mixins.css 1`] = `
a {
@mixin $(theme)-colors;
}
@define-mixin icon $network, $color: blue {
.icon.is-$(network) {
color: $color;
@mixin-content;
}
.icon.is-$(network):hover {
color: white;
background: $color;
}
}
@mixin icon twitter {
background: url(twt.png);
}
@mixin icon youtube, red {
background: url(youtube.png);
}
.search {
@mixin icon search;
}
a {
color: black;
@mixin parent {
@mixin child;
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a {
@mixin $(theme)-colors;
}
@define-mixin icon $network, $color: blue {
.icon.is-$(network) {
color: $color;
@mixin-content;
}
.icon.is-$(network):hover {
color: white;
background: $color;
}
}
@mixin icon twitter {
background: url(twt.png);
}
@mixin icon youtube, red {
background: url(youtube.png);
}
.search {
@mixin icon search;
}
a {
color: black;
@mixin parent {
@mixin child;
}
}
`;
exports[`postcss-nested.css 1`] = `
.phone {
&_title {
width: 500px;
@media (max-width: 500px) {
width: auto;
}
body.is_dark & {
color: white;
}
}
img {
display: block;
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.phone {
&_title {
width: 500px;
@media (max-width: 500px) {
width: auto;
}
body.is_dark & {
color: white;
}
}
img {
display: block;
}
}
`;
exports[`postcss-nested-props.css 1`] = `
.funky {
font: {
family: fantasy;
size: 30em;
weight: bold;
}
}
.funky {
font: 20px/24px fantasy {
weight: bold;
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.funky {
font: {
family: fantasy;
size: 30em;
weight: bold;
}
}
.funky {
font: 20px/24px fantasy {
weight: bold;
}
}
`;

View File

@ -0,0 +1 @@
run_spec(__dirname, ["css"]);

View File

@ -0,0 +1,32 @@
a {
@mixin $(theme)-colors;
}
@define-mixin icon $network, $color: blue {
.icon.is-$(network) {
color: $color;
@mixin-content;
}
.icon.is-$(network):hover {
color: white;
background: $color;
}
}
@mixin icon twitter {
background: url(twt.png);
}
@mixin icon youtube, red {
background: url(youtube.png);
}
.search {
@mixin icon search;
}
a {
color: black;
@mixin parent {
@mixin child;
}
}

View File

@ -0,0 +1,13 @@
.funky {
font: {
family: fantasy;
size: 30em;
weight: bold;
}
}
.funky {
font: 20px/24px fantasy {
weight: bold;
}
}

View File

@ -0,0 +1,14 @@
.phone {
&_title {
width: 500px;
@media (max-width: 500px) {
width: auto;
}
body.is_dark & {
color: white;
}
}
img {
display: block;
}
}