I think most of the complaints against CSS is because don't understand the problems CSS is trying to solve. It is not just a question of putting text and colors on a screen. You can do that with Postscript or PDF or SVG or several other comparatively simple technologies. CSS is trying to tackle a much harder problem: - Layout and typography which can be readable on various devices with wildly different dimensions, as…
Why is CSS the way it is?
141–150 of 173 posts
Re: Why is CSS the way it is?
#142Earlier quoted context omitted.
My point is that there's nothing in CSS that's exceedingly difficult to understand once you sit down to learn it - it's that you're often sitting down to learn things that are entirely idiosyncratic to CSS and act as impediments to creating anything beautiful. I could abandon CSS and use SVG to create prettier things pretty quickly, because although SVG has some gnarly parts, programmatically manipulated it makes muc…
> Then I'm dealing with the interaction of specific elements and document flow and everything is liable to fall apart the second some mismatch between my mental model of layouts and CSS's actual model occurs Here lies the problem. If you fix your mental model, then your layout won't fall apart. It's the same as in any other language. Haskell doesn't match my mental model, but it's not the programming language's fault…
Re: Why is CSS the way it is?
#143Earlier quoted context omitted.
You can't work out the logical consequences of seemingly obvious properties. That is unlike 95% of most programming I do in any programming language I've ever used. Since I have zero interest in learning unintuitive interfaces to GUI design, I have zero interesting in excusing CSS. It is not difficult to learn, it is not difficult to understand in terms of conceptual understanding, it is downright tedious to learn th…
> it is not difficult to understand in terms of conceptual understanding So what is your point? What you lack is motivation to make things pretty so it's not CSS's fault :)
Re: Why is CSS the way it is?
#144Earlier quoted context omitted.
Heck, I would have been happy to have had flexbox day one. I think flexbox covers 'most' folks layout needs fairly easily, and you can learn it fairly easily and get a lot out of even basic flexbox knowledge. Tables for layout were horrific. We talk about div spam these days but at least they're all just divs and divs follow divs rules. Unlike divs table, tr, td are all different and don't follow the same rules. And…
I often use grids when flex would do just to take advantage of the grid gap features. Once the more general gap feature lands in most browsers I’ll probably start using flex more again.
Grid is absurdly more powerful for full-page layout than flexbox (which is amazing for individual columns or rows). Especially once we start getting subgrid. The common comparison is 1 dimensional (flex) vs 2 dimensional (grid) layout.
Re: Why is CSS the way it is?
#145The biggest issue with CSS I think for many is the emergent complexity from the interaction of different properties. Especially those inherited through the cascade. Much of this emergent complexity is not always consistent cross-browser. Additionally, there are often many ways to accomplish the same result but fully understanding the implications of certain approaches over others is also a headache at times. Speaking…
The biggest issue with CSS I think for many is.. ..that they haven't looked at it for years and assume it's still as hard to use as it was when it was new. In any discussion about CSS someone will eventually post that "vertical and horizontal centring is really hard, and that's why CSS is terrible"[1], and all it shows is that their skills are out of date. [1] Seriously, it's as easy as "display: grid; place-items: c…
Re: Why is CSS the way it is?
#146This is a somewhat superficial history that only briefly touches on origins, and doesn't discuss the fundamental idea behind CSS, from which everything else is, directly or otherwise, a consequence. Two decades ago I was overjoyed to discover that Scheme was finally going to have a useful application beyond illustrating SICP and writing koans to amuse myself, because DSSSL was on the cusp of evolving into the last do…
Wow, I'd absolutely love to hear more about this if you've got something to share ... To win a sizable portion of HNers, it suffices to say that DSSSL was the Scheme-based styling and transformation language of SGML (implemented by Jade/OpenJade). I can only imagine where we'd be now if DSSSL had won over CSS and similar FOSI-like ad-hoc styling languages (or even SGML's own LINK process declarations that however was…
Or if Brendan Eich had prevailed when he wanted to embed Scheme in Netscape instead of Javascript.
Re: Why is CSS the way it is?
#147IMHO this article inadvertently shows why people hated CSS at the start. He spends a lot of time talking about color space conversions that few developers care about and Unicode filtering that even fewer people know about but glosses over basic layout by mentioning how floats allow for better inline images. It’s like the designers didn’t even think about layout because that problem was already solved with HTML tables…
".But the problem was that when CSS came out there it came with the mantra of thou shalt not use tables for layout, but CSS was only specified enough to wrap text around an image, so designers had to torture inline-blocks and floats to try to achieve even basic layout tasks. This ended up bringing out a lot of edge case incompatibilities and fights with the layout engine." This does not match my recollections of CSS…
Secondly, the later 'thou shalt not use tables' edict from the sort of people who actually joined the relevant W3C committees came after a few years of ubiquitous table use due to the limitations of CSS, but more importantly several years before Flexbox and Grid were even draft specs [other unsuccessful drafts existed]. People used tables because CSS wasn't good at the sort of layout they wanted to achieve, and in response W3C members... told them that tables were evil to screenreaders and they should suck it up and use hacks for at least the next decade
Arguably floats weren't well designed anyway (floating an image inside a box was all kinds of trouble except in IE which disregarded the spec's insistence it was supposed to overhang the bottom) but there was already a case for a proper grid and even that's comparatively minor compared with the 13 year gap before the draft spec for the next gen layout syntax.
Re: Why is CSS the way it is?
#148https://package.elm-lang.org/packages/rtfeldman/elm-css/late...
https://github.com/reasonml-labs/bs-css
Or even a typed alternative to/subset of CSS:
https://package.elm-lang.org/packages/mdgriffith/elm-ui/late...
Re: Why is CSS the way it is?
#149Earlier quoted context omitted.
> The "cascade" was, for sure, a mistake. Aren't global styles only possible because of the cascade and the child elements inheriting from parent elements? Without cascade, wouldn't you have to re-declare your font size and font family, and line-height, etc. on every element of your markup?
The cascade is not inheritance. The cascade is deciding the order to apply rules/stylesheets in, and which rule applies here: html: Blah css: a { color: red; } div a { color: blue; } Where the font color ends up being blue because `div a` is more specific than `a`.
Re: Why is CSS the way it is?
#150Earlier quoted context omitted.
there's canvas, you can already write apps that target it both in unity and Godot, the latter spring a wealth of languages
Question: how do these engines address accessibility issues for, say, a holiday booking site that uses the canvas element for its entire UI?
https://godotforums.org/discussion/21963/early-access-of-god...