Files
test-repo/tests/css_case/case.scss
T
Simon Lydell 56951a71b4 Don't lowercase element names and attribute names in selectors (#3317)
* Don't lowercase element names and attribute names in selectors

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 #3304.

* Fix number normalization in selector interpolation
2017-11-27 13:28:03 +01:00

90 lines
1.8 KiB
SCSS

// Convention in this test file:
// - The case should be preserved for things prefixed with "Keep".
// - 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.
@IMPORT Keep;
HTML#KeepId.KeepClass,
a[HREF=KeepAttrValue]:HOVER::FIRST-letter,
svg[viewBox] linearGradient,
:Not(:NTH-child(2N+1)) {
COLOR: #AAbbCC;
BACKGROUND-image: URL("KeepString");
Margin: 5PX .2E10Em;
--Keep-custom-Prop: red;
background: Var(--Keep-custom-Prop);
animation-name: KeepAnimationName;
important: something !IMPORTANT;
}
@keyframes KeepAnimationName {
FROM {
prop: val;
}
#{$KeepInterpolationVar},
#{$Keep + 15PX + Keep15PX + '15PX' + "15PX"},
#{$Keep + $Keep15PX} {
prop: val;
}
TO {
prop: val;
}
}
@custom-media --KeepCustomMedia screen and (width >= 768px);
@media (--KeepCustomMedia) {}
@FUNCTION KeepFuncName() {
@RETURN 12;
}
%KeepPlaceholderSelector {
prop: val;
}
$KeepTopLevelVar: val;
@KeepLessVar: val;
@MIXIN KeepMixinName($Keep: 15IN, $Keep: $Keep15IN, $Keep: Keep-1E-2Em) {
$KeepVar: KeepFuncName();
#{$KeepInterpolationVar}: val;
#{$Keep + 15PX}: val;
#{$Keep + $Keep15PX}: val;
@KeepLessVar: val;
@extend %KeepPlaceholderSelector;
#{$Keep}[#{$Keep}][#{Keep}^=#{Keep-1A}]:#{$Keep} {
prop: val;
}
&Keep & Element {
prop: val;
}
BACKGROUND: {
COLOR: RED;
}
BACKGROUND: Keep 15PX Keep15PX {
COLOR: RED;
}
#{$Keep + 15PX + Keep15PX + '15PX' + "15PX"}: {
COLOR: RED;
}
}
@Mixin Keep($Keep: $Keep15IN, $Keep: Keepå1E1) {}
@MEDIA (MIN-WIDTH: 700PX) {
@include Keep;
@include Keep(.12e+01cH);
@include Keep($Keep12E01cH);
}
@MEDIA (#{$Keep}: #{$Keep}) {}