less.js
less.js copied to clipboard
Line comments aren't stripped from @supports selector(...)
Is this a bug or is this an expected behavior?
Demo (Less 3.11.3): https://jsbin.com/hewizek/6/edit?html,js,console
Input:
@supports selector(
:focus-visible // *"a"
) {
a {
color: red;
}
}
Output:
@supports selector(
:focus-visible // *"a") {
a {
color: red;
}
}
Expected:
@supports selector(:focus-visible) {
a {
color: red;
}
}
It's expected behavior, although of course not ideal. The @supports tag and some other at-rules that are not explicitly parsed basically allow anything in the at-rule prelude, and just look for matching blocks (like parentheses).
This is being re-worked in a smarter parser for Less v5, but there is no timeline currently for that release.