Q: I have a stylesheet from a designer and I need to change some values in it. I’m hoping to use something like Enlive for CSS i.e. parse and transform raw CSS. Does something like this exist?
Yeah, for css that might be good. My original problem was scss 😞
But, on the other hand, I resigned at that job, so don't have to fix the CSS anymore 😄
@ashnur very similar to your question. did you find anything?
Worst case I’ll use string match/replace but it would be nice to load the css as data. even better would be css -> garden i.e. round-trip Garden css
I haven't finished it, but the suggestion to use ANTLR4 sounds promising https://github.com/antlr/grammars-v4/tree/master/scss
I've experimented a tiny bit with this http://cssparser.sourceforge.net/
See https://github.com/lambdaisland/ornament/blob/main/repl_sessions/cssparser.clj
looks pretty simple, thanks for the reference. I ended up just doing string replace with an xpath-like concept that did the job