Fork me on GitHub
#css
<
2022-07-28
>
steveb8n22:07:26

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?

steveb8n22:07:48

@U0VQ4N5EE very similar to your question. did you find anything?

steveb8n22:07:17

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

Aron03:07:14

I haven't finished it, but the suggestion to use ANTLR4 sounds promising https://github.com/antlr/grammars-v4/tree/master/scss

👍 1
plexus22:08:10

I've experimented a tiny bit with this http://cssparser.sourceforge.net/

steveb8n22:08:19

looks pretty simple, thanks for the reference. I ended up just doing string replace with an xpath-like concept that did the job

Aron09:08:45

Yeah, for css that might be good. My original problem was scss 😞

Aron09:08:04

But, on the other hand, I resigned at that job, so don't have to fix the CSS anymore 😄