Don't lowercase `&class` in SCSS/Less selectors (#2834)

Fixes #2830
master
Simon Lydell 2017-09-15 19:48:04 +02:00 committed by GitHub
parent 5bd8ca472b
commit 23041e2113
4 changed files with 30 additions and 1 deletions

View File

@ -217,7 +217,12 @@ function genericPrint(path, options, print) {
return adjustStrings(n.value, options);
}
case "selector-tag": {
return maybeToLowerCase(n.value);
const parent = path.getParentNode();
const index = parent.nodes.indexOf(n);
const previous = index > 0 ? parent.nodes[index - 1] : null;
return previous && previous.type === "selector-nesting"
? n.value
: maybeToLowerCase(n.value);
}
case "selector-id": {
return concat(["#", n.value]);

View File

@ -50,6 +50,10 @@ a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
prop: val;
}
&Keep & NoKeep {
prop: val;
}
@KeepDetachedRuleset();
@KeepDetachedRuleset ( /* comment */ );
@ -123,6 +127,10 @@ a[href="KeepAttrValue"]:hover::first-letter,
prop: val;
}
&Keep & nokeep {
prop: val;
}
@KeepDetachedRuleset();
@KeepDetachedRuleset();
@ -208,6 +216,10 @@ a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
prop: val;
}
&Keep & NoKeep {
prop: val;
}
BACKGROUND: {
COLOR: RED;
}
@ -284,6 +296,10 @@ a[href="KeepAttrValue"]:hover::first-letter,
prop: val;
}
&Keep & nokeep {
prop: val;
}
background: {
color: RED;
}

View File

@ -47,6 +47,10 @@ a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
prop: val;
}
&Keep & NoKeep {
prop: val;
}
@KeepDetachedRuleset();
@KeepDetachedRuleset ( /* comment */ );

View File

@ -50,6 +50,10 @@ a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
prop: val;
}
&Keep & NoKeep {
prop: val;
}
BACKGROUND: {
COLOR: RED;
}