@flemist/postcss-wrap
v0.0.5
Published
PostCSS plugin to wrap all css with selector or media
Downloads
15
Maintainers
Readme
Usage
import postcssWrap from '@flemist/postcss-wrap'
const input = '.class1{} .class2{}'
const output = await postcss(postcssWrap({
type: 'atrule',
props: {
name: 'media',
params: '(prefers-color-scheme: dark)',
},
})).process(input)
// output: @media (prefers-color-scheme: dark) {.class1{} .class2{}}
import postcssWrap from '@flemist/postcss-wrap'
const input = '.class1{} .class2{}'
const output = await postcss(postcssWrap({
type: 'rule',
props: {
name: 'media',
selectors: ['.app', '.dev'],
},
})).process(input)
// output: .app, .dev {.class1{} .class2{}}