babel-plugin-csjs-postcss
babel-plugin-csjs-postcss copied to clipboard
Apply postcss transforms for tagged template css
Atom will enable the syntax highlighting for css if the tagged template is named css
(instead of csjs
).
I know this is kind of out of the scope of this repo, but it's such a minor change that it doesn't seem necessary to keep a separate project just for that.
Cool! I think making the tag name configurable seems like a good idea (as opposed to being hardcoded to csjs
)
Could you update your PR so it can be passed in via config (like plugins are) as opposed to hardcoding css
?
Perhaps something like:
{
"plugins": [["csjs-postcss", {
"tagName": "css"
}]]
}
And a test case for this would be nice to have as well!
Hi! Thanks so much for the transform. And csjs
. I added the option, but also renamed the transform, since I’m using it without csjs
(with this https://github.com/arturi/template-css) and I think it could be useful for any other package doing css in template strings. What do you think: https://github.com/arturi/babel-plugin-template-strings-postcss? Should I publish a separate version, or should I add tests and send a PR? Are you interested in making the transform not csjs-specific, letting it run free?
@arturi Yeah, I see no reason for this to be CSJS-specific. Happy to merge in a PR!