export const childrenSansPassthrough = (el: Element): Element[] => { return Array.from(el.children) .flatMap((child: Element) => getComputedStyle(child).display === 'contents' ? childrenSansPassthrough(child) : child, ) .filter( (node: Element) => node.nodeName !== 'TEMPLATE' && getComputedStyle(node).display !== 'none', ) }