babel-plugin-csjs-postcss icon indicating copy to clipboard operation
babel-plugin-csjs-postcss copied to clipboard

Apply postcss transforms for tagged template css

Open felipeccastro opened this issue 7 years ago • 3 comments

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.

felipeccastro avatar Oct 15 '16 21:10 felipeccastro

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!

rtsao avatar Oct 15 '16 21:10 rtsao

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 avatar Mar 17 '17 16:03 arturi

@arturi Yeah, I see no reason for this to be CSJS-specific. Happy to merge in a PR!

rtsao avatar Mar 17 '17 17:03 rtsao