Live data from Hacker News

Ask HN: Is it just me, or is CSS too damn hard?

news.ycombinator.com

191–200 of 358 posts

Re: Ask HN: Is it just me, or is CSS too damn hard?

#191

Earlier quoted context omitted.

A layout engine and design are two entirely different concepts. CSS has nothing to do with design. It is the tool used to implement the design and there are loads of other layout tools out there that don't have CSS's infuriating quirks. On the flip side, they usually have steep learning curves because they are strict. For a long time, until less than a decade ago, designers knew nothing about CSS. They'd do a design…

> Some (unlucky) programmers entire job was turning PSDs into HTML and CSS. That was my entry into programming many years ago. But I wouldn't call it unlucky - early web devs like me (we didn't really call ourselves programmers back then) had front-row seats at the beginning of a revolution, and it certainly was entertaining to watch and be part of. > CSS has nothing to do with design CSS works the way it does becaus…

> All the web designers I knew back in the early days knew some HTML and CSS and we'd often discuss possibilities and limitations of browsers and standards, and how to work around issues. They didn't just lob PSDs over the partition to the devs - there was an active dialogue and they knew their stuff.

I find this false. PSD-to-code was very common back then. There even still some designers today that only work via images/PSD.

Re: Ask HN: Is it just me, or is CSS too damn hard?

#192

The tipping point for me was memorizing "A complete guide to flexbox" from the site "CSS Tricks" by using flash cards (Anki). The problems with CSS are: - A lot of features have been abused before there were good layout features in CSS. * - Errors are silent and you can repeat rules. - Selector specificty is a major fail in the language IMHO. * - Everything is global. * * An example: floating an image is an excellent…

Multiple asterix are stripped it seems.

Asterisks are used for emphasis here:

  *like this*
  =>
like this

Footnotes we do usually do with a different mark here; some use square brackets [0], others use superscript chars¹, and I've also seen daggers† around.

Re: Ask HN: Is it just me, or is CSS too damn hard?

#193

As a designer who often hands over designs to developers, I find it all too frequent scenarios where developers struggle interpreting design into code. I have NEVER seen a developer who can implement a design exactly per spec in CSS. This is not to say that developers are incompetent with CSS, in fact, it probably says more about CSS than it does about the developer. The fact that CSS has gotten so convoluted is coun…

As both a designer and primarily a developer I can tell you there hasn't been a design I couldn't implement exactly as per spec over several years.

The issue has been more a case of it would be better not to and the design being incomplete (being most frequently static mocks) it hasn't fully captured the interaction, all scenarios or device widths. Designers need to really understand the medium they are working with and meet devs halfway.

Good design is function over form and working within constraints. All too often in the industry the designs are created as though they are for print. This is in large part also due to the fact designers tooling itself was designed for print and we are just now beginning to have better tools for designing interfaces but there is a long long way to go.

Re: Ask HN: Is it just me, or is CSS too damn hard?

#194

The tipping point for me was memorizing "A complete guide to flexbox" from the site "CSS Tricks" by using flash cards (Anki). The problems with CSS are: - A lot of features have been abused before there were good layout features in CSS. * - Errors are silent and you can repeat rules. - Selector specificty is a major fail in the language IMHO. * - Everything is global. * * An example: floating an image is an excellent…

> The tipping point for me was memorizing "A complete guide to flexbox" from the site "CSS Tricks" by using flash cards (Anki).

That page was a godsend. It's one of my most accessed bookmarks :)

Re: Ask HN: Is it just me, or is CSS too damn hard?

#195

The whole set of web technologies is a mess. We‘re still in the stone age of web UI design, similar to the 80‘s era of home computing when everybody built their own UI with basic drawing primitives. It’s going to take a while till decent, cross-platform/device UI libraries make progress and designers discover the value of reusable components that just work and are familiar to users. Until then, we‘re stuck with terri…

> It’s going to take a while till decent, cross-platform/device UI libraries make progress and designers discover the value of reusable components that just work and are familiar to users.

I find it very unlikely that browser vendors will agree to have the same implementation across their own products, vested interests and all.

Re: Ask HN: Is it just me, or is CSS too damn hard?

#196

Earlier quoted context omitted.

I also really enjoy building CSS UIs from scratch, but editing existing stylesheets is a pain point. Band-aid after band-aid. I think keeping UI components tiny and coupling the stylesheets with the component is the best way I've seen (not necessarily styled components, just styles in the same folder as the component.) As the component is removed, its easy to nuke the stylesheet with surgically removing related style…

Why not styled components? It’s what immediately jumped to my mind while reading your comment, until you said otherwise :)

Styled components, CSS-in-JS and CSS modules largely solve the same problem. I think it's just a matter of preference.

Re: Ask HN: Is it just me, or is CSS too damn hard?

#197
post #138
post #134

Earlier quoted context omitted.

Beyond the immediate issues of "what rules do I use to make this thing look this way", the cascade can also make large-scale management and code reuse challenging. It's sort of like object-oriented inheritance, except the definitions and instantiations live in totally different places, and the top-level object properties are defined by browser manufacturers, or possibly end-users. Without some sort of build system, s…

> It's sort of like object-oriented inheritance With the key difference being that there's no rigid structure to it at all, much less a strict-subset hierarchy. It's really more like structural object types, which can be easily composed, than OOP classes. It's set theory, rather than taxonomy. > Without some sort of build system, static analysis is difficult so it's hard to say if a definition is being used or not Th…

"This can be easily solved with good project organization"

"All you have to do is closely mirror your UI components, pages, fragments, whatever, with the relevant CSS files. Then if you add or remove something in the markup, you add or remove it in the corresponding styles."

Super simple. It is what it is and powerful etc, but simple? I have given up. I just use the minimum web tech to get by.

Re: Ask HN: Is it just me, or is CSS too damn hard?

#198

Earlier quoted context omitted.

If anyone doesn’t get the “Buffalo buffalo...” reference here’s the Wikipedia about that bizarre English sentence [1]. [1]: https://en.m.wikipedia.org/wiki/Buffalo_buffalo_Buffalo_buff...

Oh wow. I'd always just assumed it was a US idiom along the lines of yada yada or something. Buffalo buffalo... doesn't work in British English as it is only a noun. Nearest English silliness I can remember hearing is: police police police police.

Don't tell me you can't verb a noun in English English? "police police police police" - please...

Re: Ask HN: Is it just me, or is CSS too damn hard?

#199
post #142

Earlier quoted context omitted.

> Amusingly, tables came back. But they're called "layout tables" now, to avoid embarrassment. I'm not really sure what you're talking about. Tables were bad because they were too rigid and weren't designed for layout purposes; they do still get used when you want to display an actual table. Maybe you meant CSS Grid? > Trying to do 2D layout with 1D constructs (the "float" and "clear" era) was just silly. The float e…

> Your Autodesk comparison belies a fundamental misunderstanding about the nature of the DOM - it is, to its great advantage, a 1D space which flows into a 2D shape. What's the advantage? The screen is 2D space. Layouting is a 2D problem. Images are two-dimensional. It's simpler to start from 2D and make 1D content fit that space than the other way around. > The web is 1D because text is 1D. That made sense in the ve…

Humans can only focus on a single thing at a time. As your focus goes through any content, it necessarily follows a 1D path. HTML, eint Text, is also one-dimensional.

CSS, as said before, transfers this 1D information into the 2D representation on a scree, or a printout. Or it leaves it allone, or rearranges the 1D stream, for a different 1D representation to a screen reader.

This has nothing to do with being a “historical artifact”. It’s a fundamental idea of communication theory. But maybe it helps you to see its value if I just mention that thinking a bit about such theory will make it far easier to you to create designs on the vastly different devices, from smart watches to Times Square screens connected too the internet now.

Re: Ask HN: Is it just me, or is CSS too damn hard?

#200

Earlier quoted context omitted.

> CSS works the way it does because it was created to make the kind of designs that designers wanted possible Well, not originally. Later that became a thing, yes - but all the design that was already there at that point (circa CSS 2) remained, as did the overall approach with cascading styles. A styling language designed for HTML5 today from scratch, accommodating modern use cases, would likely look a lot different.

It would probably be written in JS, maybe something like JSSS [1]. I remember playing with it when it came out and thinking it was very cool. Pity it never went anywhere. If we were going to start from scratch though, we wouldn't do HTML5, we'd use some other format. JSON maybe? 1. https://en.wikipedia.org/wiki/JavaScript_Style_Sheets

Display PostScript? Only kidding, maybe.
Post reply on HN