Live data from Hacker News

Incomplete List of Mistakes in the Design of CSS

wiki.csswg.org

81–90 of 154 posts

Re: Incomplete List of Mistakes in the Design of CSS

#81
post #24

It would be nice if it was possible for devs to create their own CSS-like DSL and get the browser to use that instead of CSS.

I started to work with HTML and CSS recently, so I'm still learning. To me it seems that CSS preprocessors are the closest thing to what you descibed, although the output is still CSS.

Re: Incomplete List of Mistakes in the Design of CSS

#82
post #22

Earlier quoted context omitted.

> 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.

In the beginning... the web was never envisioned to be what it is today. The notion that anybody would want to do layout like publishing software didn't cross anyone's mind. Originally the web didn't even have images! It was just text and links. It was just a way to pass text documents around easily. Of course, then the designers came along and said "I want it to look like this" and webmasters (as we were called back…

It wasn't that the web pioneers did not consider layout important. They came from a background where layout was "external". The important thing was the content. Style was something that was added and/or defined by someone else. Such as with LaTeX.

The first web pages I wrote had no style information at all. And the first browsers I used allowed (and expected) you to define the default colours and fonts for pages to your own taste.

I am still a fan of minimal styling. It would save me a lot of time to write "style = article" on my pages and be done with it... but most people want their pages to look unique and exactly as they think it should.

Re: Incomplete List of Mistakes in the Design of CSS

#83
post #72

Earlier quoted context omitted.

It never worked well in the original envisaged usecase. CSS 1 didn’t work properly with tables which meant I used to have to inline style attributes for tables as well as set a CAS file. It’s always been garbage for centering things, in the early days that meant using the tag. Then you have all the different browser extensions (o-, mo-, etc) the inconsistent preferences for font-face, etc. CSS was a great idea but it…

> wouldn’t it be nice to have browsers run byte code so you could have a choice of languages rather than having compile everything down to JavaScript? How are those two situations different? You're compiling one language to another language. Does it matter if one of them is called "bytecode"?

The Javascript equivalent of byte code would be web assembly and that is still a long way from being ready for primetime.

Re: Incomplete List of Mistakes in the Design of CSS

#84
post #72

Earlier quoted context omitted.

It never worked well in the original envisaged usecase. CSS 1 didn’t work properly with tables which meant I used to have to inline style attributes for tables as well as set a CAS file. It’s always been garbage for centering things, in the early days that meant using the tag. Then you have all the different browser extensions (o-, mo-, etc) the inconsistent preferences for font-face, etc. CSS was a great idea but it…

>I would honestly welcome a ground up complete reimplementation of the web if browser vendors all decided to work together on one. Was that the sound of a pig flying by, or the sound of hell freezing over? Any time specs can be interpreted, there will always be these differences in browsers. Maybe we could not call them specs, and just call them suggestions?

Ostensibly I do agree with you however that is the reason I phrased it "browser vendors working together" rather than "a new spec being written".

However, as you said, the chances of that happening are remote. Even putting personal agendas aside (eg Google wanting to control content via AMP), the web in it's current form is "good enough" that there's no real drive to reinvent the wheel for something with such deep market penetration already.

Re: Incomplete List of Mistakes in the Design of CSS

#85
The principal mistake of CSS IMHO is that it invented new syntax for what should've gone into HTML attributes (like SGML LINK and FOSI did). This then led to inconsistent ways of manipulating display properties (CSSOM etc.) and also to the identity crisis of HTML (postulating "semantic" HtML when markup is as syntactic as it gets).

Re: Incomplete List of Mistakes in the Design of CSS

#86

Earlier quoted context omitted.

The thing i hate about CSS is how unstructured it can be. You just sorta list whatever you want and it's suddenly a style sheet. No headers, no footers, no must includes.... DO I use quotes around this value? Do I not? Does white space matter? It's the most intimidating language I've ever used just because it feels so open and uncontrolled and nonsensical... I always thought CSS was some leftover abomination from the…

LESS is more how CSS should look like for styling. It's amazing we don't have embedding of rules yet. parent { child { } } is just so much more development friendly than parent { } parent child { }

I believe the why is that as soon as you have any invalid syntax everything else is ignored. I forget the level of scope, I think it's until the next complete rule?

Re: Incomplete List of Mistakes in the Design of CSS

#87
post #73

Earlier quoted context omitted.

> CSS is inspired by the style sheets of yore Which is in my opinion the reason why it sucks for most of its current use cases. Layout of a paper document and layout of a web page are very different. The web "page" often isn't even a page but rather a GUI for a computer program.

From the beginning, CSS tutorials said just what you said, that the web is not the printed page and that you should not strive for pixel-perfect layout.

Which is exactly what anyone that I've talked to that gets paid to write CSS in any aspect is expected to do with it; pixel-perfect layouts.

Re: Incomplete List of Mistakes in the Design of CSS

#88
post #72

Earlier quoted context omitted.

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…

It never worked well in the original envisaged usecase. CSS 1 didn’t work properly with tables which meant I used to have to inline style attributes for tables as well as set a CAS file. It’s always been garbage for centering things, in the early days that meant using the tag. Then you have all the different browser extensions (o-, mo-, etc) the inconsistent preferences for font-face, etc. CSS was a great idea but it…

Learn CSS Layout the pedantic way at:

http://book.mixu.net/css/

can help with the trial and error bit. It impossible to get an intuitive feel for nearly 400 keywords IMHO.

Re: Incomplete List of Mistakes in the Design of CSS

#89
post #74

Earlier quoted context omitted.

Traditionally, font is just the shape of the characters (size, weight, italics). Other things (alignment, underline, wrap, color). This is because "fonts" were originally physical typesetting blocks. Some designers go further and say font refers only to the files and file formats; other things are the "typeface".

I believe the traditional usage is something like this: Helvetica is a typeface, Helvetica Bold Italic is a font.

Almost: Helvetica is a typeface family, Helvetica Bold Italic is a typeface, Helvetica Bold Italic 10pt is a font (or rather, the font is a case full of bits of metal with Helvetica Bold Italic 10pt)

Re: Incomplete List of Mistakes in the Design of CSS

#90

Earlier quoted context omitted.

Yep yep. CSS in JS removes some of the pain points but still, fundamentally, CSS cannot communicate with JS in a universal, elegant way. Honestly, CSS in general is awful. How did we only just get decent centering with flexbox? How is flexbox still inconsistent across browsers? (Try setting a child of a flexbox container to 100% height.) The days of needing separate constructs because of bandwidth are over. We need s…

The thing i hate about CSS is how unstructured it can be. You just sorta list whatever you want and it's suddenly a style sheet. No headers, no footers, no must includes.... DO I use quotes around this value? Do I not? Does white space matter? It's the most intimidating language I've ever used just because it feels so open and uncontrolled and nonsensical... I always thought CSS was some leftover abomination from the…

with PostCSS and the postcss-nested you can nest loads of stuff like mediaqueries, which makes it bearable IMHO.
Post reply on HN