(root)
| 11 | * resolve inside the shadow island instead of the host document. */ |
| 12 | let _queryRoot = (typeof document !== 'undefined') ? document : null; |
| 13 | export function setQueryRoot(root) { _queryRoot = root || _queryRoot; } |
| 14 | /** querySelector shorthand scoped to the active query root (or an explicit root). */ |
| 15 | export const $ = (sel, root) => (root || _queryRoot).querySelector(sel); |
| 16 | export const $$ = (sel, root) => [...(root || _queryRoot).querySelectorAll(sel)]; |