fix(css): don't eat selector namespace (#3956)
parent
1ca4e2b90a
commit
ec4f4eb6d3
|
@ -309,7 +309,12 @@ function genericPrint(path, options, print) {
|
|||
return adjustStrings(node.value, options);
|
||||
}
|
||||
case "selector-tag": {
|
||||
return adjustNumbers(node.value);
|
||||
return concat([
|
||||
node.namespace
|
||||
? concat([node.namespace === true ? "" : node.namespace.trim(), "|"])
|
||||
: "",
|
||||
adjustNumbers(node.value)
|
||||
]);
|
||||
}
|
||||
case "selector-id": {
|
||||
return concat(["#", node.value]);
|
||||
|
@ -358,7 +363,12 @@ function genericPrint(path, options, print) {
|
|||
return concat([leading, value]);
|
||||
}
|
||||
case "selector-universal": {
|
||||
return node.value;
|
||||
return concat([
|
||||
node.namespace
|
||||
? concat([node.namespace === true ? "" : node.namespace.trim(), "|"])
|
||||
: "",
|
||||
adjustNumbers(node.value)
|
||||
]);
|
||||
}
|
||||
case "selector-selector": {
|
||||
return group(indent(concat(path.map(print, "nodes"))));
|
||||
|
|
|
@ -295,6 +295,23 @@ exports[`selectors.css 1`] = `
|
|||
>>> .child-one {}
|
||||
>>> .child-two {}
|
||||
}
|
||||
|
||||
/* This matches all XHTML <a> elements, as XHTML is the default unprefixed namespace */
|
||||
a {}
|
||||
|
||||
/* This matches all SVG <a> elements */
|
||||
svg|a {}
|
||||
|
||||
/* This matches both XHTML and SVG <a> elements */
|
||||
*|a {}
|
||||
|
||||
|B {}
|
||||
|
||||
ns|* {}
|
||||
|
||||
*|* {}
|
||||
|
||||
|* {}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.a,
|
||||
.b,
|
||||
|
@ -660,4 +677,28 @@ exports[`selectors.css 1`] = `
|
|||
}
|
||||
}
|
||||
|
||||
/* This matches all XHTML <a> elements, as XHTML is the default unprefixed namespace */
|
||||
a {
|
||||
}
|
||||
|
||||
/* This matches all SVG <a> elements */
|
||||
svg|a {
|
||||
}
|
||||
|
||||
/* This matches both XHTML and SVG <a> elements */
|
||||
*|a {
|
||||
}
|
||||
|
||||
|B {
|
||||
}
|
||||
|
||||
ns|* {
|
||||
}
|
||||
|
||||
*|* {
|
||||
}
|
||||
|
||||
|* {
|
||||
}
|
||||
|
||||
`;
|
||||
|
|
|
@ -292,3 +292,20 @@
|
|||
>>> .child-one {}
|
||||
>>> .child-two {}
|
||||
}
|
||||
|
||||
/* This matches all XHTML <a> elements, as XHTML is the default unprefixed namespace */
|
||||
a {}
|
||||
|
||||
/* This matches all SVG <a> elements */
|
||||
svg|a {}
|
||||
|
||||
/* This matches both XHTML and SVG <a> elements */
|
||||
*|a {}
|
||||
|
||||
|B {}
|
||||
|
||||
ns|* {}
|
||||
|
||||
*|* {}
|
||||
|
||||
|* {}
|
||||
|
|
Loading…
Reference in New Issue