New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't lowercase element names and attribute names in selectors #3317
Conversation
.Keep (@Keep) WHEN (lightness(@Keep) >= Keep12PX) AND (@Keep > @Keep12E5) {} | ||
.Keep (@Keep) when (lightness(@Keep) >= 12PX) and (@Keep > 0) {} | ||
.Keep (@Keep) when (lightness(@Keep) != '12PX') and (@Keep != "12PX") {} | ||
.Keep (@Keep) when (lightness(@Keep) >= Keep12PX) and (@Keep > @Keep12E5) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand, Less only accepts when
and and
lowercase.
@@ -292,17 +300,17 @@ a[href="KeepAttrValue"]:hover::first-letter, | |||
} | |||
|
|||
@keyframes KeepAnimationName { | |||
from { | |||
FROM { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from
and to
could technically be lowercased in @keyframes
, but I don’t think it is worth the trouble.
@@ -89,15 +91,17 @@ $KeepScssVar: val; | |||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |||
// Convention in this test file: | |||
// - The case should be preserved for things prefixed with "Keep". | |||
// - The case should always be preserved for function names and property keywords. | |||
// - The case should always be preserved for element names and attribute names | |||
// in selectors, as well as function names and property keywords. | |||
// - Other things should mostly be lowercase. | |||
// - The \`/*:*/\` comments are just to bust the \`isLikelySCSS\` check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this PR, but can we use parser: "less"
instead of the comments now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t know.
https://www.w3.org/TR/css3-selectors/#casesens > All Selectors syntax is case-insensitive within the ASCII range (i.e. > [a-z] and [A-Z] are equivalent), except for parts that are not under the > control of Selectors. The case sensitivity of document language element > names, attribute names, and attribute values in selectors depends on the > document language. For example, in HTML, element names are > case-insensitive, but in XML, they are case-sensitive. Fixes prettier#3304.
prop: val; | ||
} | ||
|
||
#{$KeepInterpolationVar}, | ||
#{$Keep + 15px}, | ||
#{$Keep + 15PX}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I didn't see this one when looking through the diff before. Need to lowercase that "PX".
Good to merge? |
https://www.w3.org/TR/css3-selectors/#casesens
Fixes #3304.