|
|
|
|
|
by abathur
48 days ago
|
|
I feel like we need a name for css-the-syntax (and maybe -the-semantics) as separate from css-the-body-of-rules/functions/units/etc-defined-by-csswg. There's juice in it, but it's hard to talk about and survey other uses without just searching GH for code using css parsers and just see what kind of shenanigans people are up to. I've been playing around with a weird thing that's kinda like a template engine, but driven by a mix of a lightweight node-based markup language, css selectors for expressing what goes into the template, and a css-alike for controlling exactly how all of these parts come together. |
|
https://www.w3.org/TR/selectors-3/
and this is what the DOM spec references, too (albeit at level 4):
https://dom.spec.whatwg.org/#selectors
So the common name "CSS selector" is already correct, or simply "selector"?
"DOM selector" would be nicer maybe and not contain "CSS", but also I'm not even sure if it's better, because selectors in static CSS or selectors used with different DOM engine (XML parser, PHP DOM API, whatever) and static markup outside of JS engine means we're talking about a diferent DOM than the one exposed to JS.
Also, some special selectors are directly tied to browser rendering and navigation, such as :hover or ::target-text.
So yes, maybe a minimal subset of the query syntax could benefit from a name that's not tied to the browser and CSS.