packages/heml-styles/src/plugins/postcss-element-expander/expanders.js
function replaceElementTagMentions (element, selector) {
  const processor = selectorParser((selectors) => {
    let nodesToReplace = []

    /**
     * looping breaks if we replace dynamically
     * so instead collect an array of nodes to swap and do it at the end
     */
    selectors.walk((node) => {
      if (node.value === element.tag && node.type === 'tag') { nodesToReplace.push(node) }
    })

    nodesToReplace.forEach((node) => node.replaceWith(element.pseudos.root))
  })

  return processor.process(selector).result
}
function replaceElementTagMentions (element, selector) {
  const processor = selectorParser((selectors) => {
    let nodesToReplace = []

    /**
     * looping breaks if we replace dynamically
     * so instead collect an array of nodes to swap and do it at the end
     */
    selectors.walk((node) => {
      if (node.value === element.tag && node.type === 'tag') { nodesToReplace.push(node) }
    })

    nodesToReplace.forEach((node) => node.replaceWith(element.pseudos.root))
  })

  return processor.process(selector).result
}
function replaceElementTagMentions ( element , selector ) { const processor = selectorParser ( ( selectors ) => { let nodesToReplace = [ ] /**
     * looping breaks if we replace dynamically
     * so instead collect an array of nodes to swap and do it at the end
     */ selectors . walk ( ( node ) => { if ( node . value === element . tag && node . type === 'tag' ) { nodesToReplace . push ( node ) } } ) nodesToReplace . forEach ( ( node ) => node . replaceWith ( element . pseudos . root ) ) } ) return processor . process ( selector ) . result }
replace all custom element tag selectors
@param  {Object} element  the element definition
@param  {String} selector the selector
@return {String}          the replaced selector
replace all custom element tag selectors