-
-
Notifications
You must be signed in to change notification settings - Fork 25
Description
I am looking for a CSS to JS transpiler tonight and I believe that postcss-js
may be what I am looking for. 👍
I've only dabbled in using PostCSS programmatically a few times, so I do not have much common-knowledge in this domain.
Thus, at first glance, I have found myself stumped as to how I will import this tool when I go to use it in a few minutes.
let css = '@media screen { z-index: 1 }'
let root = postcss.parse(css);
postcssJs.objectify(root) //=> { '@media screen': { zIndex: '1' } }
I am oblivious as to whether I should const postcssJs = require('postcss-js')
or const { postcssJs } = require('postcss-js')
, etc.
Not a big problem, no. I'll figure it out quickly if a default require fails. Or I could even read the source to see what is exported and how it is exported. Nonetheless, it isn't intuitive just from reading the samples. -- Somebody with less tinkering experience than I may be blocked by this.
(I do believe that your documentation on how to use it is adequate!)