π Hello! Thanks for publishing this useful package π
I'm the author of another CSS plugin for rollup, rollup-plugin-lit-css
, which is a simple plugin for importing css files into javascript as lit-element
css tagged template literals.
I'd like for my users to have the option to pass their CSS through postcss before loading into JS, and have the postcss rollup plugin output a string of CSS without adding js syntax.
import style from './styles.css'
console.log(style)
main {
background: red;
&.nested { background: blue; }
}
import postcss from 'rollup-plugin-postcss'
import litcss from 'rollup-plugin-lit-css'
export default {
input: 'app.js',
output: {
format: 'es',
file: 'bundle.js',
},
plugins: [
postcss({
output: 'css',
inject: false,
plugins: [
require('postcss-preset-env')({stage: 0})
]
}),
litcss(),
],
}
import { css } from 'lit-element';
var style = css`main {
background: red
}
main.nested { background: blue; }
`;
console.log(style);
import { css } from 'lit-element';
var style = css`var css = "main {\n background: red\n}\nmain.nested { background: blue; }\n";
export default css;`;
console.log(style);
If this option is already available, I wasn't able to find it in the docs or the source. From a brief tour of the source, it looks like the plugin always exports JS.
Thanks again for publishing this.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too