Live data from Hacker News

Incomplete List of Mistakes in the Design of CSS

wiki.csswg.org

61–70 of 154 posts

Re: Incomplete List of Mistakes in the Design of CSS

#61
post #57
post #26

Earlier quoted context omitted.

> CSS defines properties on individual elements, while layout fundamentally needs to define relationships between elements I couldn't agree more! Does anyone know a language/toolkit/something that gets layout right? I remember getting excited by Grid Stylesheets [1] but the project seems dead now... [1] https://github.com/gss/

I do. It's CSS. There is a nifty feature display: grid. And also display: flex.

This is not what I mean. Flex and Grid are simply defining layout in terms properties on an individual element, and what it expects its children to do. Still no way to represent relationships between elements (except the implied relationship between siblings, only indirectly accessible by setting properties on their parent, or setting properties on a child that affect the implicit relationship between it and its parent and or siblings, such as, eg, "margin")

These things at least make certain things that were simply impossible to do before now possible, but they're doing it in a bolted on, unnatural, overcomplicated way.

And still there are things that are only possible by rearranging the HTML to accomodate the implied relationships these layout systems expect.

Re: Incomplete List of Mistakes in the Design of CSS

#63

Earlier quoted context omitted.

>Here's a bunch of global state, some of which is hidden in gigantic minified files, now edit it! Well, there's your problem. I'd recommend reading about things like atomic css, BEM, OMACSS, etc.

That's why I use CSS in JS :D. But we're just putting abstractions/stopgaps over a fundamentally flawed design. Not to mention, since everybody uses a different standard for isolation, CSS in JS is not compatible with BEM is not compatible with SASS, etc.

CSS was originally designed with the idea that you would have one css file for your whole site, and it would be maybe 300 lines max.

We've obviously gone well off the rails. Selector specificity was supposed to be the scoping mechanism. And it works great in the original envisaged usescase: a single person making a single website. it just doesn't scale to large teams, and ancient software projects, with complicated layouts.

Re: Incomplete List of Mistakes in the Design of CSS

#64
post #26

here's my pet peeves: 1. CSS should not have adopted a hyphenated naming scheme for properties, since it makes it difficult to access css properties from javascript or other languages. 2. CSS should never have been used for layout, and nobody should have suggested it should be. CSS defines properties on individual elements, while layout fundamentally needs to define relationships between elements, which requires real…

> CSS defines properties on individual elements, while layout fundamentally needs to define relationships between elements I couldn't agree more! Does anyone know a language/toolkit/something that gets layout right? I remember getting excited by Grid Stylesheets [1] but the project seems dead now... [1] https://github.com/gss/

I’m still missing xaml every time I need to position something on a webpage.

Re: Incomplete List of Mistakes in the Design of CSS

#67
post #2

Some of these seem very nit picky but if we are doing that my pet peeve was that the “color” property should have been named “text-color”

It affects non-text as well, e.g., https://jsbin.com/wodevam/edit?css,output .

Wow. I've been writing CSS for 10+ years. I never knew that.

Re: Incomplete List of Mistakes in the Design of CSS

#68
post #5

(1) it should have been designed around what people actually try to do: three column layouts with headers and footers, aligning content in the middle, pinstriping (this one isn’t as popular anymore), drop shadows, etc. Instead, all of these things required either hacky workarounds, or stepping outside of CSS entirely. The first decade of CSS was “look at all these things you can do that you don’t want to, and you can…

> (1) it should have been designed around what people actually try to do

It was but a lot has changed in the last 20 years.

At the time CSS was first supported in most browsers, the way to create columnar layouts was with a frameset. They even handled fixed position headers and footers.

I can't believe I've been writing CSS for 20 fucking years.

Re: Incomplete List of Mistakes in the Design of CSS

#70

here's my pet peeves: 1. CSS should not have adopted a hyphenated naming scheme for properties, since it makes it difficult to access css properties from javascript or other languages. 2. CSS should never have been used for layout, and nobody should have suggested it should be. CSS defines properties on individual elements, while layout fundamentally needs to define relationships between elements, which requires real…

[deleted]
Post reply on HN