Don't lowercase CSS custom media names (#2822)

Fixes #2820. While that issue is about `@media (--fooBar)` in
particular, this commit changes to never lowercase stuff starting with
`--` in general, as it seems like those `--customStuff` things can pop
up kind of anywhere.
This commit is contained in:
Simon Lydell authored and GitHub committed 2017-09-14 21:55:11 +02:00
1 parent 219acfe0f8
commit ec4abdfb1e
4 files changed
+25 -2

No files matched your search

+5 -2
View File
@@ -81,7 +81,7 @@ function genericPrint(path, options, print) {
return concat([
n.raws.before.replace(/[\s;]/g, ""),
n.prop.startsWith("--") ? n.prop : maybeToLowerCase(n.prop),
maybeToLowerCase(n.prop),
":",
isValueExtend ? "" : " ",
isComposed
@@ -482,7 +482,10 @@ function printNumber(rawNumber) {
}
function maybeToLowerCase(value) {
return value.includes("$") || value.includes("@") || value.includes("#")
return value.includes("$") ||
value.includes("@") ||
value.includes("#") ||
value.startsWith("--")
? value
: value.toLowerCase();
}
@@ -35,6 +35,9 @@ a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
}
}
@custom-media --KeepCustomMedia screen and (width >= 768px);
@media (--KeepCustomMedia) {}
@KeepDetachedRuleset: /*:*/ {
BACKGROUND: RED;
}
@@ -104,6 +107,10 @@ a[href="KeepAttrValue"]:hover::first-letter,
}
}
@custom-media --KeepCustomMedia screen and (width >= 768px);
@media (--KeepCustomMedia) {
}
@KeepDetachedRuleset: {
background: RED;
}
@@ -184,6 +191,9 @@ a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
}
}
@custom-media --KeepCustomMedia screen and (width >= 768px);
@media (--KeepCustomMedia) {}
@FUNCTION KeepFuncName() {
@RETURN 12;
}
@@ -256,6 +266,10 @@ a[href="KeepAttrValue"]:hover::first-letter,
}
}
@custom-media --KeepCustomMedia screen and (width >= 768px);
@media (--KeepCustomMedia) {
}
@function KeepFuncName() {
@return 12;
}
+3
View File
@@ -32,6 +32,9 @@ a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
}
}
@custom-media --KeepCustomMedia screen and (width >= 768px);
@media (--KeepCustomMedia) {}
@KeepDetachedRuleset: /*:*/ {
BACKGROUND: RED;
}
+3
View File
@@ -33,6 +33,9 @@ a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
}
}
@custom-media --KeepCustomMedia screen and (width >= 768px);
@media (--KeepCustomMedia) {}
@FUNCTION KeepFuncName() {
@RETURN 12;
}