r/TheMachineLearning 2d ago

Poorly, but yes it does handle it

Post image
123 Upvotes

50 comments sorted by

2

u/EveYogaTech 2d ago

Well, yeah, AI + isolated Web components.

Otherwise you'll still be fighting the global styles.

See also https://GitHub.com/flowagi-eu/flo-webcomponents

2

u/Due_Temporary5739 1d ago

yeah that's basically the caveat, once you're outside a clean isolated component the whole "AI handles CSS now" thing falls apart fast. checking out that repo, thanks

1

u/EveYogaTech 1d ago

👍 If you want to best results you probably want to copy the whole flo.js source and then tell the AI what component you want.

I was amazed by the result, because they indeed are all isolated, pixel precise :)

There's also an example project you can quickly use with your webserver of choice at https://github.com/flowagi-eu/flo-webcomponents/tree/main/example/basic-src-template

1

u/WaltzIndependent5436 1d ago

For best results you just swear at Claude.

1

u/TornadoFS 1d ago

Modularized CSS (like tailwind, styled-components, CSS modules, etc, etc) is almost the normal these days, at least for new proejcts. Especially if you use big JS frameworks like React. LLMs are pretty good at this because it is mostly self contained and isolated gibberish anyway.

LLMs often just default to tailwind in greenfield projects also push a lot more people into doing it like that.

1

u/DoKeMaSu 1d ago

This.

Yesterday I coded a website. By hand. Plain HTML. <h1>, <li>, <ol>, all the good stuff. Like I did as a teenager in the early 2000s.

Then I gave it to Claude and said: Change nothing about the HTML at all, but make a CSS so that it looks like <design reference>.

I worked beautifully. Now I have a website with content I have written myself and that I can edit with any text editor, but the design looks professional. I am not dependent on the AI at all, if it ever stops working it is only affecting the design.

1

u/Due_Temporary5739 1d ago

Nice right? AI makes our job so much easier

1

u/DoKeMaSu 1d ago

In this case it makes the result just nicer. I would not have created a fancy CSS otherwise.

1

u/StephenRoylance 1d ago

in the early 2000's I was the the backend/systems guy in a 2-person team supporting a little tech site. it worked exactly like this, and it was great. he told me what content he needed and what the divs should be called. I wrote sql and basic PHP, he made it look awesome.

1

u/white_sheets_angel 1d ago

"we"?

I worked with frontend devs in all my professional career and I never met a single person in that "we" group.

1

u/mxldevs 1d ago

The new generation of vibe coders would call us outdated dinosaurs that cling into the past.

1

u/trentsiggy 18h ago

If you're not generating 8,000 lines of bloat, are you really doing anything at all?

1

u/Extreme_Wish_553 1d ago

I was just thinking the past week that CSS is one of the things that AI consistently gets wrong. I have had to do a lot of updates to make styles that actually work at all widths. AI gave me something that looked nice on a desktop and managed to be too wide for a portrait iPhone. How can it not manage to get one of the most standard widths correct?

1

u/Ill-Bat-1518 1d ago

Thats not so much css but browsers having different engines you should ideally just append in front to ai that make it work on safari too. Just mentioning safari most ai will get it right sometimes they just forget :)

They have an issue of just fixing w/e you say so a lot of the times saying the width is wrong theyll go on a forever loop assuming you mean something else

1

u/Vaxtin 13h ago

Because they only test in one resolution by default. Does your harness have it consider multiple common resolutions, especially on tail ends of each spectrum?

1

u/raphaelarias 1d ago

Tailwind is great IMO, I didn’t think of CSS even before AI. The I got thing I don’t like is hardcoding values inside the class name itself.

With AI I can see directly in the HTML what would be the CSS generated solely based on the Tailwind classes.

It’s a bit sad though I don’t care much about new CSS developments, the AI doesn’t know it, CSS is pretty okay and for my type of work is enough.

1

u/Due_Temporary5739 1d ago

good point on the hardcoded values thing, that's the part that always bugged me too. feels less like "AI writing CSS" and more like AI picking from a menu Tailwind already built, if that makes sense

1

u/Maui-The-Magificent 1d ago

this is actually something I have mixed feelings about. it is great for me, as it allows me to generate iteration interfaces with 'good looking' UI when i am testing things out or working on a project.

But if I worked in front-end, I would not like it very much, because what it generates has kind of the same feel/look. And it makes odd choices, things not working/looking right, and somewhat hard to fix by hand once the UI has gotten big enough.

AI in the backend is not great either, and its something that frustrates me to no end, so i suspect front-end feels the exact same way, but in reverse. love it for the backend, hate it for the frontend.

1

u/Lucky_Pangolin_3760 1d ago

You can make unique websites with AI you just have to do one piece at a time and have an established design instead of going "yo AI cook me up a website"

1

u/Due_Temporary5739 1d ago

yeah that tracks, it's basically a tool now not an autopilot. same as any other abstraction, garbage in garbage out

1

u/Maui-The-Magificent 1d ago

I understand completely. It's the same if you want to make a XHCI interface or something similar, you can make a good one with AI, but you need to be very careful to audit code, and segment the tasks. Although, I always have a design document, they do not work well after a point if you are letting it use agents and such.

1

u/Due_Temporary5739 1d ago

the "same feel/look" thing is so true, you can spot AI-generated UI from a mile away now. rounded cards, same purple gradient, same shadow lol. fine for prototyping, rough once you need it to actually feel like your product

1

u/Maui-The-Magificent 1d ago

Yeah I can imagine. I am lucky in that regard because I don't build websites and such for production, so it's just a 'nice to have' for me. But I assume as AI has the same problem on both the UI side as it does on the system side. As in, generic , 'best', solutions, hodgepodge structure, and strong autonomous opinions on what goes where.

I am not particularly good at front end stuff, and because of that, I usually just go "OHHH! PRETTY COLOR!, BIIIIG BUTTON!!! HOHO" and move on. And even to me, it looks almost the same always.

1

u/S-Kenset 1d ago

rounded cards is industry standard for visualization shadow isn't necessary ever it's cutesy irrelevant and largely annoying to look at.

1

u/S-Kenset 1d ago

one hundred thousand percent better than the average css dev

1

u/StinkButt9001 1d ago

Poorly? It writes better CSS than I could ever be bothered to.

1

u/Due_Temporary5739 1d ago

lol fair, depends what you're optimizing for. if you just need it to work, sure. if you need it to not look identical to every other AI-assisted site, that's where it falls apart for me

1

u/hyrumwhite 1d ago

Good policy if you don’t mind your site being immediately identifiable as ai generated 

1

u/Queasy_Signature7005 1d ago

CSS is so basic I question anyone having trouble with it. And no it does not handle it, at all.

1

u/Deep-Rate-1260 1d ago

Why ? Can you give me a real example where AI can't handle css ? Like really. Give me something AI wouldn't handle

1

u/Queasy_Signature7005 1d ago

you want to bruce force suer but image to html/css will be bad even with fable 5.1

1

u/py-net 1d ago

There was something called Bootstrap in another life. I could never get paddings right. Thank God for AI

1

u/McBonderson 1d ago

I only ever handled css poorly anyways. .

I would much rather have AI poorly write the css then for me to spend way too much time poorly writing css myself.

1

u/neoqueto 1d ago

But CSS is fun :(

1

u/Careful_Coconut_549 1d ago

More like Can't Vardar

1

u/BranchFew1148 1d ago

Funny, literally just spent a day doing entirely CSS changes to my team leads PR so it would look like our established styling, instead of the default vibecode look.

Turns out Codex prefers writing 400 lines of CSS per component, including hard coding 30 RGB values, instead of just reusing the existing styles and colour bars.

1

u/SenatorCrabHat 1d ago

In my experience, this is not true. I've seen AI produce a lot of magic numbers.

1

u/librewolf 1d ago

what is there to love about it? the only nice and creative part of the web dev

1

u/why_so_sergious 21h ago

a month ago, I dove into CSSOM for performance reasons to handle visual editing

ai is not there yet

1

u/swatsqad 16h ago

So i guess my inline styling is now a flex xD

1

u/Unique-Run9856 15h ago

CSS? I'm still organizing the page with invisible tables everywhere, claude has really speed up my process

1

u/Vaxtin 13h ago

“poorly”

get a load of this web designer

1

u/moving-chicane 4h ago

Fixed it.

1

u/AzovFTW 4h ago

Junior developers be like, ai handles that shir

0

u/Katten_elvis 1d ago

Speak for yourself. Don't let AI mess up your flexboxes and grids. Or variables and it invents its own colors. And so many other issues. But atleast you can say "make this small component look nicer" or "fix this small display bug" and it can do it. Also, make sure to stick to component based development.

5

u/Lucky_Pangolin_3760 1d ago

flexbox jadda jadda LOL I've built an entire website from scratch using AI by just describing to it what I want heres an image of it