Live data from Hacker News

Incomplete List of Mistakes in the Design of CSS

wiki.csswg.org

21–30 of 154 posts

Re: Incomplete List of Mistakes in the Design of CSS

#22
post #7

Earlier quoted context omitted.

> three column layouts with headers and footers I was appalled when I saw what was needed to make this use case, used by 1/2 he web pages in existence.

originally CSS had no layout facilities. (as it should be, see other comment). Layout was hacked in to css by abusing the "float" property into doing things it was never meant to be doing.

> Layout was hacked in to css by abusing the "float" property into doing things it was never meant to be doing.

So if CSS wasn’t supposed to do layout, despite that being what people needed, and if you weren’t supposed to use tables for layouts despite that being what worked... then what on earth were you supposed to be using for layout? I don’t recall any other serious options out there.

Re: Incomplete List of Mistakes in the Design of CSS

#23

Earlier quoted context omitted.

pointer-events: none; is actually pretty useful in many cases when you temporarily need to disable interactions, like drag/drop

It's useful as long as every browser supports it. When it doesn't, and you want to polyfill, the polyfill needs to download all linked CSS files a second time, implement a CSS parser to find the pointer-events properties, and after all that, patch in not entirely identical behaviour with javascript. But then, this is behavior . what's it doing in a language that's supposed to be strictly about style/presentation? Why…

Would be nice to have that polyfill at the webpack build level instead of the browser. Generate css files specifically for older browsers.

Re: Incomplete List of Mistakes in the Design of CSS

#25
> background-position and border-spacing (all 2-axis properties) should take vertical first, to match with the 4-direction properties like margin.

Is there some reason why margin/padding is top, right, bottom, left instead of left, top, right, bottom or left, right, top, bottom or both of which would seem more common in other APIs

Re: Incomplete List of Mistakes in the Design of CSS

#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/

Re: Incomplete List of Mistakes in the Design of CSS

#27

> background-position and border-spacing (all 2-axis properties) should take vertical first, to match with the 4-direction properties like margin. Is there some reason why margin/padding is top, right, bottom, left instead of left, top, right, bottom or left, right, top, bottom or both of which would seem more common in other APIs

My guess is that it works the same way a clock does. Purely a guess though.

Re: Incomplete List of Mistakes in the Design of CSS

#28

Earlier quoted context omitted.

pointer-events: none; is actually pretty useful in many cases when you temporarily need to disable interactions, like drag/drop

It's useful as long as every browser supports it. When it doesn't, and you want to polyfill, the polyfill needs to download all linked CSS files a second time, implement a CSS parser to find the pointer-events properties, and after all that, patch in not entirely identical behaviour with javascript. But then, this is behavior . what's it doing in a language that's supposed to be strictly about style/presentation? Why…

> It's useful as long as every browser supports it.

sure, but the same can be said of every web api and other open standard with multiple implementations.

https://caniuse.com/#feat=pointer-events

> But then, this is behavior.

there's not always a clean separation. what about opacity:0 and visibility: hidden? this affects intractability despite being presentation, right?

Re: Incomplete List of Mistakes in the Design of CSS

#29

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…

1. hyphenated for css, camelCase for javascript, underscores for API (i.e. php or ruby). Makes it easy to differentiate what's what.

Re: Incomplete List of Mistakes in the Design of CSS

#30
Wow I just started making websites of my own recently and have encountered so many things that are immensely infuriating about how the language is interpreted that I've been thinking about starting a list myself.

They seem to favor implied behavior rather than explicitly defined behavior which is incredibly annoying. For example, space between inline-block elements that is not accounted for by margins. The fact that margin-top and margin-bottom percentages are computed based on the width of the parent element, not the height. The fact that certain properties like max-height are oftentimes not respected if they use a %, even if the height can be precisely calculated. The fact that I have to add body { margin: 0; } to everything. I'm sure there have been more but just what I can think of off the top of my head.

Oh, and COLLAPSING MARGINS.... WHAT THE HELL

Post reply on HN