4 ms·
> The web is a document-based system, with text flowing from top to bottom. This was always the central mistake in the design of CSS. It was solving a problem
by stormbrew 6y ago
> The web is a document-based system, with text flowing from top to bottom.
This was always the central mistake in the design of CSS. It was solving a problem people just didn't really have. I mean, yes, it did both simplify and improve the situation for this sort of document flow kind of thing but we were all using tables for a reason:
Because what people needed was a mechanism to describe structured layout. Inside that, document flow is important, but we spent 20+ years just getting back to the structural power of tables and it's fucking ridiculous.
And it did it all in a way that required the exact constraint solving complexity you're lamenting. But it didn't really have to be that way.
CSS was a disaster and has almost certainly wasted incredible amounts of time and money that could have been better spent if a better solution had come along in time.
- goto11 6y ago> we spent 20+ years just getting back to the structural power of tables Already CSS 2.0 (which is indeed 20 years old) had the power of tables through the "display:table" property. Flexbox and grid gives you additional power.
- stormbrew 6y agoYou could also just keep using <table> tags. Either way, they interact strangely with other aspects of CSS and you have to structure your "document" in a very particular (very likely non-semantic) way in order to use it for layout. Having an escape hatch to break the box model completely so you can do useful things with it is not actually giving you any structural power, it's just admitting the weakness in the model. Fundamentally, what was always needed -- and what flexbox and grid finally started bringing -- was the recognition that structural layout and semantic structure are rarely the same thing, and that you need to be able to describe them separately, usually in separate hierarchies. Still, they do it in a fairly convoluted way that only really feels simple by comparison to what came before.
- goto11 6y ago> Having an escape hatch to break the box model completely so you can do useful things with it is not actually giving you any structural power, it's just admitting the weakness in the model. I don't really get what you are saying here. Are you saying display:table or display:grid breaks the box model? Because I don't agree with that interpretation. But maybe I misunderstand.
- stormbrew 6y agodisplay:table and display:grid are not really the same class of thing? One lets you make things act more like pre-css html, the other is a completely new addition to the box model. "breaks the box model" might be too strong, I'll admit. But table-styled elements don't act quite like other things in the box model even so. It's confusing and messy and anyways you have to contort your document to fit things together in a way that works with it most of the time. On the other hand I'm saying display:grid is good, but took way too long to get here.
- goto11 6y agoI don't see what is confusing or messy about display:table. Of course if you use it for a purpose it is not suited for, it gets messy. But so it is with everything.
- rimliu 6y ago> You could also just keep using <table> tags. No. This often repeated and it is always wrong. I just won't bother anymore to tell why it is wrong, there is no point talking to people who will not listen.