-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage with postcss-cli? #23
Comments
@RyanZim I think we need special support for What do you think? |
@ai Sorry, I'm not real familiar with postcss-js; I'm not getting why you would want to use this with the CLI. Would this be to require a CSS-in-JS file and convert it to CSS? |
@RyanZim yeap. Input file is: module.exports = {
a: {
color: 'red'
}
} On a {
color: red
} |
OK, I see your point; what about when someone wants to convert CSS to JS?
I'm not saying we should support this, just saying I can see someone asking for this sometime. |
Good question. It will be cool to support it, but I am not sure, that users will use it :D. So up to you:
|
I don't really want to support the stringifier that way; if postcss-js exposed a Either way, I'd be willing to special-case |
@RyanZim sure. could you create a issue to track process? |
Parserpostcss style.js -p postcss-js if (path.extname(file) === '.js') {
return Promise.resolve(require('file'))
.then((content) => css(content))
} Stringifierpostcss style.css -t postcss-js -o style.js
postcss style.css -t postcss-js --ext .js if (path.extname(output) === '.js' || argv.ext === '.js') {
fs.outputFile(options.to, `module.exports = ${JSON.stringify(result.css, 2)}`)
} |
@RyanZim changes are small =^_^= |
As per the title how can one use postcss-js with postcss-cli? Can you pass options for plugins before postcss-js?
The text was updated successfully, but these errors were encountered: