2 ms·
I don't hate CSS. In fact I love the fact that I can make a website and with relatively little work it runs everywhere, including mobile. Though I do have to ch
by socalgal2 10mo ago
I don't hate CSS. In fact I love the fact that I can make a website and with relatively little work it runs everywhere, including mobile. Though I do have to check.
That said, I'm not a pro. I asked ChatGPT for some layout primitives which it gave me and I then I probed for things that stood out as strange to me and it gave me lots of background and why things are as they are as well as why they can't automatic.
One that stood out was this:
Me: No native UI framework in existence has the equivalent of min-width: 0. Somehow they all get by with just layout primitives
ChatGPT: native UI toolkits do not expose anything equivalent to min-width: auto (intrinsic min-content) as a default constraint. They get away with pure layout primitives because they made a fundamentally different architectural choice than CSS.
This isn’t accidental, and it explains exactly why CSS feels broken here.
The core difference (one sentence)
Native UI frameworks treat content as flexible by default; CSS treats content as authoritative by default.
Everything else follows from that.
What native UI frameworks assume (and CSS does not): Across Cocoa, UIKit, WinUI, Android, Qt, etc., the default assumptions are:
1. Text is allowed to truncate
2. Containers decide layout
3. Content adapts to constraints
4. Overflow is normal
5. Intrinsic size is a preference, not a hard constraint
In other words: Layout constraints dominate content.
What CSS assumes instead: CSS’s default assumption is the opposite:
1.Text must remain readable
2. Content dictates minimum size
3. Overflow is an error
5. Intrinsic size is a hard constraint
In other words: Content dominates layout.
That single inversion is why min-width: auto exists — and why no native toolkit needs it.
After that I asked it could it give me CSS primitives that work like native layout. It did, and it came with all of the issues brought up.