← Back to context

Comment by pmdr

3 days ago

If there's anything AI coding is good at, it's writing react components and tailwind css.

I am not 100% sure about that - I usually find AI written CSS to be slightly visually flawed and almost always logically flawed.

The way you write websites that actually work imo, is you understand how your chosen CSS layout engine works roughly, and try to avoid switching between layout modes - traditional to flexbox to grid to flexbox again down the tree can drive the most brillant devs utterly mad .

But seriously, after a certain complexity threshold, it becomes impossible to tell what's going on and why.

And if you don't think about it in advance, it's very easy to reach that threshold, especially if you don't get to write the whole page from scratch, but have to build on the work of others.

AI (and many frontend devs) do write-only CSS - they add classes until the code they write looks right.

But code like that tends to fall apart under multiple resolutions, browsers, screen sizes, devices etc.

I am not a frontend dev, and came pretty late to the frontend party. That said I felt that anything that obscures the raw CSS makes it much harder to deliver UI that works right, as it peppers hidden side effects across your code.

That's why I wasn't too keen on CSS frameworks like Tailwind - I found that when writing frontend code the writing part takes up the minority of the time, it's producing a well thought out layout flow is what is actually the biggest sink of time and effort.

That said, I'm not a frontend dev, and I'm to too good at CSS - but not horrible either - so I defer to the judgement of others who are pros at this, its just my opinion and experience.

  • > I usually find AI written CSS to be slightly visually flawed and almost always logically flawed.

    Funny, this also qualifies most of the _human_ written CSS I've seen. !important all the things!

If you want a bunch of tailwind class slop, then yes. Otherwise, A lot of context engineering is needed if you want it to write modular tailwind components properly for large projects where consistency is important.

  • > Otherwise, A lot of context engineering is needed if you want

    I am not seeing that. I have a few AI-assisted projects using tailwind and scrolling through it now 99% of it looks... completely modern and professional. I had previously asked it to "completely refactor, a rewrite if needed, all the tailwind/css/app styles. ensure visual and code consistency across pages".

    Modern coding tools add tons of their own content, but none of the above was "a lot of context engineering".

  • Absolutely, but the AI era seems to have lowered the bar for what's considered passable code. Slop works for most projects.

    • And design too. I shouldn’t be able to tell Claude designed your site/app, but it is too often the case. Good taste still remains an advantage thankfully.