Hi, in a browser you can use the & selector to write a query relative to the node in question:
let temp0 = document.querySelector(".someClass");
temp0.querySelectorAll("& > ul > li"); // matches only direct descendants of the .someClass node
... but it seems like css-select does not support this:
let machineSection = select(root, "li:has(> #idx2D70)");
// ...
let manufacturerSections = selectAll(machineSection, "& > ul > li"); // throws error, see below
// ...
Error: Empty sub-selector
at finalizeSubselector (/home/sven/projects/seekseek/config-v2/node_modules/.pnpm/css-what@7.0.0/node_modules/css-what/dist/commonjs/parse.js:216:19)
at parseSelector (/home/sven/projects/seekseek/config-v2/node_modules/.pnpm/css-what@7.0.0/node_modules/css-what/dist/commonjs/parse.js:487:5)
at parse (/home/sven/projects/seekseek/config-v2/node_modules/.pnpm/css-what@7.0.0/node_modules/css-what/dist/commonjs/parse.js:130:22)
at _compileUnsafe (/home/sven/projects/seekseek/config-v2/node_modules/.pnpm/css-select@6.0.0/node_modules/css-select/dist/commonjs/index.js:85:78)
at Object.select (/home/sven/projects/seekseek/config-v2/node_modules/.pnpm/css-select@6.0.0/node_modules/css-select/dist/commonjs/index.js:97:21)
...
With the nesting selector having baseline availability now, do you intend to support this in css-select as well?
Hi, in a browser you can use the
&selector to write a query relative to the node in question:... but it seems like
css-selectdoes not support this:With the nesting selector having baseline availability now, do you intend to support this in
css-selectas well?