3 ms·
> Colon-separated attributes I admit that this section threw me a little bit for a loop. I mean, I can't assume the author doesn't know this, but this article
by chrisoverzero 4y ago
> Colon-separated attributes
I admit that this section threw me a little bit for a loop. I mean, I can't assume the author doesn't know this, but this article and the repo give no indication that these are being used properly as rebindable prefixes mapping to namespace declarations. They're not just names-with-colons-in.
In fact, CSS already has syntax for namespaces[0]:
@namespace prefix url(XML-namespace-URL);
/* or */
@namespace prefix "XML-namespace-URL";
/* which is then referenced as */
prefix|element { }
…so I imagine it would have been a smaller innovation to continue to use the pipe as the delimiter.
@namespace url(http://www.w3.org/2000/svg);
@namespace xlink url(http://www.w3.org/1999/xlink);
use {
xlink|href: #circle;
}
(But rebindable prefixes have turned out to be bad on the open web[1], so maybe not.)
[0]: https://developer.mozilla.org/en-US/docs/Web/CSS/@namespace https://developer.mozilla.org/en-US/docs/Web/CSS/@namespace
[1]: https://wiki.whatwg.org/wiki/Change_Proposal_for_ISSUE-120#Why_arbitrary_prefix_mechanisms_are_bad https://wiki.whatwg.org/wiki/Change_Proposal_for_ISSUE-120#W...