hugoWebsite/node_modules/tailwindcss/src/util/parseObjectStyles.js

20 lines
429 B
JavaScript
Raw Normal View History

2022-10-29 00:20:35 +02:00
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
})
}