Live data from Hacker News

Mistakes in the Design of CSS (2013)

wiki.csswg.org

81–90 of 147 posts

Re: Mistakes in the Design of CSS (2013)

#81
post #76

Make flexbox the default layout for everything, and add a flex-snap feature that will snap to the nearest multiple of some given size. I'm not sure we actually would still need grids. I also wonder if you couldn't have a more transparent and parameterizable auto width algorithm based on a lowest cost solver. So you could say "If this element wraps, it's cost 50", meaning you want all the boxes to stay on as few lines…

How would your flex box solution handle a simple two column layout where the first column is a variable size? There isn’t a fixed multiple to “snap” to.

Didn't think of that case!

But if you had a full algebra/constraints/logic programming system, you could set a solver rule where the first column items had width X, with fairly high priority.

And other rules(like fit-content) on that same property, to specify what the width should be.

The solver would figure out what X should be, and everything in the first column would have that width unless something even more important changed it.

You could even give rules a "layer" in addition to the solver cost, and properties would only take rules from the highest active layer, so you could still do overriding, just explicitly instead of with specificity.

To avoid confusion with different CSS files, layer could be a hierarchal tuple, and you could manually specify the layer of an imported file, forcing all its layers to become sub layers of the one you specified, so you could override a file, or merge two files in one layer, etc.

Re: Mistakes in the Design of CSS (2013)

#82

Earlier quoted context omitted.

Kind of hard to see Bootstrap and Tailwind so casually lumped together with regard to how they break semantics, as they are at least an order of magnitude apart in that. Bootstrap will throw in a p-0, but Tailwind is designed to essentially make everything a p-0. And that's an important distinction, as I think the current challenge with CSS for designers (and everyone) is that it now sits between design and developme…

The designer doesn't work semantically. Working with tailwind is like digging the hole for a pool with a spoon instead of a bulldozer. They repeat the same tailwind classes 20,000 times and if the application gets bigger they repeat it 40,000 times and if they have to change the way it looks it is the mother of all cut and paste jobs. There is an unholy convergence of the tools being almost but not quite adequate, th…

> Tailwind would be a lot more appealing to me if it was coupled with some system where I could say "class X inherits from tailwind classes A, B and C" and thus have a layer of abstraction over just writing properties.

I feel the same. Give the component a class and then in the SCSS assign the setting there. But inlining each individual CSS setting? I don't get it. Sure maybe great for a quick prototype / MVP. But as a permanent tool? I don't see it.

Re: Mistakes in the Design of CSS (2013)

#83

The Entire front end web stack looks like a design mistake. Backend looks better only because of the flexibility. You can do anything in the back. But the front you're locked into multi decade old tech and the decade old wrappers written around it.

Sorry I can't hear you over the sound of my fifteen hundred microservice infrastructure configured with Chef, no actually Puppet, no actually Ansible, no actually Terraform, no actually Tofu, no actually Pulumi. Wait, what is Docker Swarm and does anyone use it?

Bro backend is a different set of problems.

Re: Mistakes in the Design of CSS (2013)

#84

Make flexbox the default layout for everything, and add a flex-snap feature that will snap to the nearest multiple of some given size. I'm not sure we actually would still need grids. I also wonder if you couldn't have a more transparent and parameterizable auto width algorithm based on a lowest cost solver. So you could say "If this element wraps, it's cost 50", meaning you want all the boxes to stay on as few lines…

Nothing stops you from adding ` * { display: flex }` to your index.html

Re: Mistakes in the Design of CSS (2013)

#85

Earlier quoted context omitted.

I thought your question was simply rhetoric. I didn't realize how confused you were. To answer: if there's an article about tomato slices and someone goes on a rant about hamburgers (tomato slices being a small part of the whole) it's not clear or "obvious" that they read or understood the article. You haven't answered my question, do you consider server-side-rendered components "frontend?" They are "directly associa…

Depends on the situation. They can be one or the other or both. It's meta, you construct code on the backend for rendering on the front end. There's no clear answer to your question other than the code being constructed is front end exclusively while the code constructing the code is hard to categorize. >I thought your question was simply rhetoric. I didn't realize you were genuinely confused. If the tomato is rotten…

> the code constructing the code is hard to categorize

Agreed, I thought you'd have some insight. IMO you painted with too a broad brush in your OP. Articles that are specific get derailed by overly-broad replies.

This article is a decade old but sadly still relevant. I hope a day will come that it won't be.

> Did you think that I was being completely random

As I already said, I thought it was a non-sequitur.

Stop with the personal obsession, I just want to chat.

Re: Mistakes in the Design of CSS (2013)

#86

Earlier quoted context omitted.

Kind of hard to see Bootstrap and Tailwind so casually lumped together with regard to how they break semantics, as they are at least an order of magnitude apart in that. Bootstrap will throw in a p-0, but Tailwind is designed to essentially make everything a p-0. And that's an important distinction, as I think the current challenge with CSS for designers (and everyone) is that it now sits between design and developme…

The designer doesn't work semantically. Working with tailwind is like digging the hole for a pool with a spoon instead of a bulldozer. They repeat the same tailwind classes 20,000 times and if the application gets bigger they repeat it 40,000 times and if they have to change the way it looks it is the mother of all cut and paste jobs. There is an unholy convergence of the tools being almost but not quite adequate, th…

> Tailwind would be a lot more appealing to me if it was coupled with some system where I could say "class X inherits from tailwind classes A, B and C" and thus have a layer of abstraction over just writing properties.

This mindset is the problem. You don't want or need this abstraction in the CSS, what you want is to encapsulate these styles properties in a reusable "HTML component", and then use that component wherever needed. It then carries those style properties into every instantiation. What use are semantic style classes in this context? Atomic CSS makes perfect sense in this context and makes composable development a breeze by comparison.

Re: Mistakes in the Design of CSS (2013)

#87
It shouldn't have had inheritance by default. It was designed at the height of object-oriented programming, and so it had to have inheritance. This results in blocks of CSS turning off stuff in case some outer CSS turned it on.

It really should have been a constraint system. Layout should be something that says that X is to the right of Y, Y is below Z, A and B have the same height, etc. But people didn't really know how to do those back then. See the 2D sketching system in Autodesk Inventor/Fusion to see this done right. That can do more than boxes (it understands curves) but web layout should probably just be boxes.

Maybe it shouldn't be textual at all. Maybe layout should be designed entirely in graphical tools.

Cannot put text on top of text. Boxes must be disjoint. If you want another layer, OK, but layers should work like windows.

Re: Mistakes in the Design of CSS (2013)

#88
post #67
post #55

Earlier quoted context omitted.

I am a reluctant convert to tailwind. I've been doing HTML since the 90s, before CSS was even really usable for things like page layout. I mean, we didn't even use div in those days - it was table based layouts and spacer gifs. CSS appeals to a programmers mindset. Cascading seems like a good idea. Having classes that are reusable seems like a good idea. Complex selectors seem like a good idea. These are all forms of…

> The myth that you could change an entire site design just by changing the CSS is a complete myth. You should tell that to this site which has been doing exactly that for 20 years: https://csszengarden.com/

> You should tell that to this site which has been doing exactly that for 20 years: https://csszengarden.com/

Easy to do when you don't actually have to update the content or functionality. And even with those advantages, most versions of it look bad.

Re: Mistakes in the Design of CSS (2013)

#89
post #61

Earlier quoted context omitted.

BEM sucks then you die.

I wasn't a huge fan of BEM but it solved a real problem. The fact that sucky BEM was better for large teams than being without it shows how bad CSS design is. There was nothing more annoying than including a component on a page and some aspect of the component was visually broken. Like a margin inflated somewhere or a wrong color. And then time would be wasted trying to figure out what was cascading/inheriting. Worse…

> I felt it flew in the face of the entire premise of CSS and the high-ideal of separating form and content.

I mean, you were right about that one. It's just that the entire premise of CSS is wrong and its ideal doesn't work.

Re: Mistakes in the Design of CSS (2013)

#90

The Entire front end web stack looks like a design mistake. Backend looks better only because of the flexibility. You can do anything in the back. But the front you're locked into multi decade old tech and the decade old wrappers written around it.

Sorry I can't hear you over the sound of my fifteen hundred microservice infrastructure configured with Chef, no actually Puppet, no actually Ansible, no actually Terraform, no actually Tofu, no actually Pulumi. Wait, what is Docker Swarm and does anyone use it?

Thankfully you can opt out of most of those and pick the one that works for you. Sadly there's no alternative to CSS.
Post reply on HN