selector {
//property: value;
}
This sets the property named "//property" to "value". Close enough. (Expressed otherwise: it’s approximately a comment until the next semicolon, barring quoted strings and parentheses.) //selector {
property: value;
}
This is an invalid selector, and so the entire rule is ignored. (Expressed otherwise: it’s approximately a comment until the next opening curly brace’s matching closing curly brace.) /*
// blah
*/
Edit: I mistakenly parsed this as using a dummy selector to hold the comment property, not just putting it inside real selectors.Further because I write a lot of JavaScript too I sometimes make the mistake of putting a // -comment into my CSS which breaks things. And when things break in CSS you usually don't get a clear error-message about it.
It is always difficult to switch between two languages. I would prefer something like JavaScript stylesheets, if that was possible.
{
"//": "lets us consume uncompiled protobufs (see issue #123)",
"extern": "protobuf.js"
}My impression is this form might actually be the original way of expressing network paths, what with UNC in Windows (\\server\share\file etc.) and POSIX carving out an exception specifically for two slashes at the beginning of a pathname (that is, foo//bar is the same as foo/bar and ///foo/bar is the same as /foo/bar, but //foo/bar may or may not be the same as /foo/bar).
[1] https://datatracker.ietf.org/doc/html/rfc3986#section-4.2