modules/Transformer.js
/**
 * Nests pseudo selectors into their reference selector
 * @param {Object} styles - an object with styles
 */
Nests pseudo selectors into their reference selector
@param {Object} styles - an object with styles
Nests pseudo selectors into their reference selector @param { Object } styles - an object with styles
function nestPseudoClasses(styles) {
  Object.keys(styles).forEach(selector => {
    if (selector.indexOf(':') > -1) {
      const [ sel, ...pseudo ] = selector.split(':')
      if (!styles[sel]) {
        styles[sel] = { }
      }
      setDotProp(styles[sel], ':' + pseudo.join('.:'), styles[selector])
      delete styles[selector]
    }
  })
  return styles
}
function nestPseudoClasses ( styles ) { Object . keys ( styles ) . forEach ( selector => { if ( selector . indexOf ( ':' ) > - 1 ) { const [ sel , ... pseudo ] = selector . split ( ':' ) if ( ! styles [ sel ] ) { styles [ sel ] = { } } setDotProp ( styles [ sel ] , ':' + pseudo . join ( '.:' ) , styles [ selector ] ) delete styles [ selector ] } } ) return styles }
Nests pseudo selectors into their reference selector
 @param {Object} styles - an object with styles
Nests pseudo selectors into their reference selector @param { Object } styles - an object with styles
// add selector if not already existing // add pseudo to selector object