lib/hacks/grid-utils.js
function changeDuplicateAreaSelectors (ruleSelectors, templateSelectors) {
  ruleSelectors = ruleSelectors.map(selector => {
    let selectorBySpace = list.space(selector)
    let selectorByComma = list.comma(selector)

    if (selectorBySpace.length > selectorByComma.length) {
      selector = selectorBySpace.slice(-1).join('')
    }
    return selector
  })

  return ruleSelectors.map(ruleSelector => {
    let newSelector = templateSelectors.map((tplSelector, index) => {
      let space = index === 0 ? '' : ' '
      return `${ space }${ tplSelector } > ${ ruleSelector }`
    })

    return newSelector
  })
}
function changeDuplicateAreaSelectors (ruleSelectors, templateSelectors) {
  ruleSelectors = ruleSelectors.map(selector => {
    let selectorBySpace = list.space(selector)
    let selectorByComma = list.comma(selector)

    if (selectorBySpace.length > selectorByComma.length) {
      selector = selectorBySpace.slice(-1).join('')
    }
    return selector
  })

  return ruleSelectors.map(ruleSelector => {
    let newSelector = templateSelectors.map((tplSelector, index) => {
      let space = index === 0 ? '' : ' '
      return `${ space }${ tplSelector } > ${ ruleSelector }`
    })

    return newSelector
  })
}
function changeDuplicateAreaSelectors ( ruleSelectors , templateSelectors ) { ruleSelectors = ruleSelectors . map ( selector => { let selectorBySpace = list . space ( selector ) let selectorByComma = list . comma ( selector ) if ( selectorBySpace . length > selectorByComma . length ) { selector = selectorBySpace . slice ( - 1 ) . join ( '' ) } return selector } ) return ruleSelectors . map ( ruleSelector => { let newSelector = templateSelectors . map ( ( tplSelector , index ) => { let space = index === 0 ? '' : ' ' return ` ${ space } ${ tplSelector } ${ ruleSelector } ` } ) return newSelector } ) }
change selectors for rules with duplicate grid-areas.
@param  {Array<Rule>} rules
@param  {Array<String>} templateSelectors
@return {Array<Rule>} rules with changed selectors
change selectors for rules with duplicate grid - areas .