Hacker News new | ask | show | jobs
by skydhash 23 days ago
CSS is for styling documents, not for creating applications interface (which has a whole sets of constraints). It's like trying to use typographic design rules to create a car dashboard. CSS is great, just not fit for that particular job. There's an handful of properties that are the same (padding, margin, border, background color,...), but one common thing with native toolkits is that they have specific widgets for layouts.
1 comments

It is for styling documents, but nobody (except for maybe designers trying desperately cling to a job) wants every document to have a bespoke style. I want to use a style created by experts that is consistently shared with every other document across the whole of the internet. CSS is fine as a low-level primitive for those experts, but it is not the mechanism the rest of us should be using. However, there is nothing in-between, at least not unless you lean heavily into Javascript, but, again, if you are going to use a programming environment then CSS is pointless anyway. There are much better ways to draw to screens when you have a programming language at your disposal.
People do want bespoke style (think booklets) and there’s a load of templates (and frameworks) on the internet if you want a standard set of components. The web as a platform was built for documents, and when we try to twist it to do applications, the crack appears. It’s just the wrong tool for the job.

Javascript is used for the Gnome shell and it’s doing a fine job there. And if you paired javascript to something like Tk (as in Tcl/Tk), I guess it would be fine too. The web primitives are just horrible for desktop uses.

> (think booklets)

That's what PDF is for. CSS is for documents, but namely documents for screens, and on screens you want consistency with all the things on that same screen.

> there’s a load of templates (and frameworks) on the internet if you want a standard set of components.

But not a great way to use them. You can make anything work when you have low-level primitives, so it is not a case that it cannot be done, but that's missing the forest for the trees. You can also program a computer by flipping toggle switches, yet we developed better tools (e.g. programming languages) because sometimes its nice to have more comfortable abstractions.