All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.util.parseObjectStyles.js Maven / Gradle / Ivy

There is a newer version: 3.4.15
Show newest version
import postcss from 'postcss'
import postcssNested from 'postcss-nested'
import postcssJs from 'postcss-js'

export default function parseObjectStyles(styles) {
  if (!Array.isArray(styles)) {
    return parseObjectStyles([styles])
  }

  return styles.flatMap((style) => {
    return postcss([
      postcssNested({
        bubble: ['screen'],
      }),
    ]).process(style, {
      parser: postcssJs,
    }).root.nodes
  })
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy