Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Last week stripped out all CSS from a fairly substantial project and replaced with Tailwind equivs, it got all but a few cases right

That was gemini-cli, I could see some mistakes on trial run so created a GEMINI.md with system prompt and project description (about 50 lines) which clarified some tricky source layout situations

Second run it was fine, ran for about an hour or so -- I had attempted to do it manually a while back but it started to look like it would take a week or two



Thanks for the insight. I have seen similar uses at work, where people do a bit of an enhanced codemod to migrate code from using one deprecated thing (library, function, syntax) to another. And while a codemod has to be more exactly programmed. AI gives you the ability to cover spots in the code that may not 1 to 1 fit with what the pattern you had in mind.

EDIT: I haven't used Tailwind much but would something like this do what you're saying, or not really? https://www.loopple.com/tools/css-to-tailwind-converter


For the trivial cases that's fine (just using LLM does same)

But this particular project is not like a standard site and the CSS is in small fragments across 100s files and uses constants for some things like color values in places too

In that Loopple example you can see the conversion uses the Tailwind arbitrary value notation, the -[], so background-color:#afa8af gets converted to bg-[#afa8af], but I wanted nearest pure tailwind class bg-zinc-400, the agent seems to work out color distance fine so does all that in one-shot too


That's good to know it is better at translating the code from using one style to another! It is one of the gold use cases for AI agent coding at the moment. I've seen that at work as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: