packages/heml-styles/src/plugins/postcss-element-expander/tagAliasSelectors.js
function appendElementSelector (element, selector) {
  const processor = selectorParser((selectors) => {
    let combinatorNode = null

    /**
     * looping breaks if we insert dynamically
     */
    selectors.each((selector) => {
      const elementNode = selectorParser.tag({ value: element.tag })
      selector.walk((node) => {
        if (node.type === 'combinator') { combinatorNode = node }
      })

      if (combinatorNode) {
        selector.insertAfter(combinatorNode, elementNode)
      } else {
        selector.prepend(elementNode)
      }
    })
  })

  return processor.process(selector).result
}
function appendElementSelector (element, selector) {
  const processor = selectorParser((selectors) => {
    let combinatorNode = null

    /**
     * looping breaks if we insert dynamically
     */
    selectors.each((selector) => {
      const elementNode = selectorParser.tag({ value: element.tag })
      selector.walk((node) => {
        if (node.type === 'combinator') { combinatorNode = node }
      })

      if (combinatorNode) {
        selector.insertAfter(combinatorNode, elementNode)
      } else {
        selector.prepend(elementNode)
      }
    })
  })

  return processor.process(selector).result
}
function appendElementSelector ( element , selector ) { const processor = selectorParser ( ( selectors ) => { let combinatorNode = null /**
     * looping breaks if we insert dynamically
     */ selectors . each ( ( selector ) => { const elementNode = selectorParser . tag ( { value : element . tag } ) selector . walk ( ( node ) => { if ( node . type === 'combinator' ) { combinatorNode = node } } ) if ( combinatorNode ) { selector . insertAfter ( combinatorNode , elementNode ) } else { selector . prepend ( elementNode ) } } ) } ) return processor . process ( selector ) . result }
Add the element tag to the end of the selector
@param  {Object} element  element definition
@param  {String} selector the selector
@return {String}          the modified selector
Add the element tag to the end of the selector