-
I'm trying to process CSS supplied as json, eg. const cssSyntax = {backgroundImage: 'url(./image.png)', color: 'yellow'};
const result = await postcss(plugins).process(cssSyntax); This doesn't work as-is, does anyone know how I could do this? |
Beta Was this translation helpful? Give feedback.
Answered by
ai
Jul 20, 2021
Replies: 1 comment 1 reply
-
You need to use this parser https://github.com/postcss/postcss-js/ But your CSS must have selector, not just property list. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Juice10
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to use this parser https://github.com/postcss/postcss-js/
But your CSS must have selector, not just property list.