PostCSS Inject - inject css file into each other
npm install postcss-inject
js
postcss([
require('postcss-inject')({
cssFilePath: 'path/to/file/'
})
]);`variables.css:
`css
:root {
--primary-color: green;
--scondary-color: blue;
}
`input.css:
`css
a {
color: var(--primary-color);
}a:hover {
color: var(--secondary-color);
}
`output.css:
`css
:root {
--primary-color: green;
--scondary-color: blue;
}a {
color: var(--primary-color);
}
a:hover {
color: var(--secondary-color);
}
`Options
| Name | Description |
|:----------------------------------|:---------------|
| injectTo | Use `fileStart` to inject at the begining of file |
| cssPlainText | Plain CSS for example `/ My CSS File /` |
| cssFilePath` | Path to css file |