1) CSS is for implementing designs; being able to use it doesn't require design sense for things like colors 2) I'm fascinated by the fact that so many of my fellow programmers - often the smartest ones - have so much trouble with CSS. I'm not sure exactly what the reason for that is, though I did write an article hoping to address it in some capacity: https://css-tricks.com/css-is-awesome/ I think part of the proble…
CSS itself isn't a bad idea but less, scss etc. showed that it was lacking some features you desperately want and in the meantime just styling the web with "a little CSS" is not enough anymore. You have a shitload of display sizes to support on the other hand and strange behaving browsers which aren't truly standardized on the other. That makes adjusting your CSS to all of these a pain in the ass even if you like fid…
Ask HN: Is it just me, or is CSS too damn hard?
281–290 of 358 posts
Re: Ask HN: Is it just me, or is CSS too damn hard?
#2821) CSS is for implementing designs; being able to use it doesn't require design sense for things like colors 2) I'm fascinated by the fact that so many of my fellow programmers - often the smartest ones - have so much trouble with CSS. I'm not sure exactly what the reason for that is, though I did write an article hoping to address it in some capacity: https://css-tricks.com/css-is-awesome/ I think part of the proble…
> I'm fascinated by the fact that so many of my fellow programmers - often the smartest ones - have so much trouble with CSS. I'm not sure exactly what the reason for that is I will demonstrate why. First, think of all the tools that you use that require a text interface. That may include a programming language (python, ruby, javascript, etc), a command line shell (bash, fish), a database client (mysql, psql), a conf…
Many of the worst parts of CSS, and even JavaScript for that matter, come from the need for backwards-compatibility. There are literally websites from the 90s that still render and function perfectly fine in a modern browser. That's an amazing property of the web, and I'd say it's worth the tradeoff of living with a few questionable decisions of the past. Plus, we continue to rapidly build new features on top of those backward-compatible ones, so it's not like we're truly held back by them. Modern CSS and JavaScript are barely recognizable from the 90s versions, but they still contain those as a subset.
Re: Ask HN: Is it just me, or is CSS too damn hard?
#283Coming from that background, HTML (the document structure) and CSS (the style sheet) are relatively intuitive. I can see how they were influenced by tools like InDesign. However, browser quirks are very frustrating. I try to avoid situations where I need to deal with them, or if I do I try to find CSS written by others that guides the way.
I think it’s probably unfortunate that screen layout techniques, where screens are variable size and interactive, were so heavily influenced by print layout, where pages are of fixed size. On the other hand, maybe HTML + CSS was too influenced by Microsoft Word style desktop publishing where layout and content are in a single document and not influenced enough by InDesign style publishing were layout, content, and structure are each distinct. But relatively few people are ever exposed to professional print layout tools like InDesign.
Having recently gotten into parametric CAD and constraint based design, I’m hoping to see more of that approach make its way into both print and screen design.
Re: Ask HN: Is it just me, or is CSS too damn hard?
#284Re: Ask HN: Is it just me, or is CSS too damn hard?
#285Earlier quoted context omitted.
In all fairness that's probably a good thing. God forbid if emails today were like the rest of the web, hijacking the scrollbar, constant popups to register, like and subscribe. I like my emails like I like my actual mail; text and maybe the odd image.
I've got to disagree. Your preference for text emails doesn't mean those who do want rich-text or HTML should have to put up with crappy rendering that requires specialist developers. I don't understand why HTML payloads can't just be loaded in a (streamlined) browser pane?
Re: Ask HN: Is it just me, or is CSS too damn hard?
#286Earlier quoted context omitted.
> 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…
> What's the advantage? The same content reflows to different 2D spaces
Re: Ask HN: Is it just me, or is CSS too damn hard?
#287Each tag is a box that can contain other boxes. Learn about the box model to understand the properties of a box.
How do you display the boxes inside another box? Learn about the display property.
How do you position the box inside another one? Learn about the position property.
Re: Ask HN: Is it just me, or is CSS too damn hard?
#288Earlier quoted context omitted.
Good comment. CSS is actually pretty simple, as long as you start with the smallest elements and work up. It becomes a nightmare if you try and address everything individually. It’s not really a programming language, but a series of guidelines. I’ve seen this simplicity actually throw developers as they’re used to something much more complex and systematic. Preprocessors like SASS are great, but I wonder if they’re d…
I don't think sass/less complicate this, they just bring in some familiar and useful elements. How much further could css have gone on its own had it supported variables and functions from the get-go?
(If you are old enough, you may have come across one of those WordPress templates in which they crammed PHP $variables inside inlined CSS. #goodolddays)
Re: Ask HN: Is it just me, or is CSS too damn hard?
#289When I first was going through CSS to learn it I thought it was the worst thing in the world - manly because many people had copied CSS without knowing what how to really achieve - or inheriting disparate css blocks which add to the confusion.
Once understood and starting from scratch, you can make it a lot more logical and flexible without much of a mess. My big tip - learn to break down style parts into separate classes and then combine the classes as needed!
Re: Ask HN: Is it just me, or is CSS too damn hard?
#290Earlier quoted context omitted.
I've got to disagree. Your preference for text emails doesn't mean those who do want rich-text or HTML should have to put up with crappy rendering that requires specialist developers. I don't understand why HTML payloads can't just be loaded in a (streamlined) browser pane?
They are; it just tends to be a really crappy browser pane that isn't based on (and therefore kept up to date with) any major browser, so writing the HTML and CSS is like being transported back to 2004
https://templates.mailchimp.com/resources/email-client-css-s...