Add space around ~ combinator (#1774)

master
Christopher Chedeau 2017-05-27 13:20:32 -07:00 committed by GitHub
parent 54497a0865
commit adb26e20ad
6 changed files with 16 additions and 3 deletions

View File

@ -2612,7 +2612,7 @@ function genericPrintNoParens(path, options, print, args) {
]);
}
case "selector-combinator": {
if (n.value === "+" || n.value === ">") {
if (n.value === "+" || n.value === ">" || n.value === "~") {
return concat([" ", n.value, " "]);
}
return n.value;

View File

@ -0,0 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`combinator.css 1`] = `
-Option/root .public/section ~ .public/section:before {
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Option/root .public/section ~ .public/section:before {
}
`;

View File

@ -0,0 +1,2 @@
-Option/root .public/section ~ .public/section:before {
}

View File

@ -0,0 +1 @@
run_spec(__dirname, { parser: "postcss" });

View File

@ -2,7 +2,7 @@
exports[`custom-properties.css 1`] = `
:root{--mainColor:#123456}
a{color:var ( --mainColor ) ; }
a{color:var( --mainColor ) ; }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:root {
--mainColor: #123456;

View File

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`var-notation.css 1`] = `
.foo {margin:var ( --n-gutterSize) 0 var ( --gutterSize ) var( --n-gutterSize );
.foo {margin:var( --n-gutterSize) 0 var( --gutterSize ) var( --n-gutterSize );
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.foo {