CSS is almost a failure as technology. None of it's promises has been realized. The idea with CSS was that we would be able to separate content from presentation. Remember CSS Zen garden? Yet that has never been the case and div tags were always needed to be able to display something simple. Another promise was that content would be displayed easily on different mediums, desktop, mobile even print.. yet it's impossib…
Ask HN: Is it just me, or is CSS too damn hard?
261–270 of 358 posts
Re: Ask HN: Is it just me, or is CSS too damn hard?
#262My frustrations w/ CSS stemmed from not having respect for the complexity of the problem that CSS solved. I went into it w/ the same attitude of "hey, just center this thing", and didn't really get anywhere. These days I have accepted that CSS is a tool for pros, which I am not.
> hey, just center this thing Step 1: On your container div... display:flex; justify-content:center; align-items:center; Step 2: There is no step 2.
Re: Ask HN: Is it just me, or is CSS too damn hard?
#263Earlier quoted context omitted.
CSS is not a real constraint language. If it really were a constraint language, it would be better. There's no constraint solver. Just a bunch of rules applied sequentially. I'd like to have a real constraint system, like the one in Autodesk Inventor sketch mode. You select two things and apply a constraint - parallel, tangent, horizontal, collinear, etc - and the constraint system enforces those constraints. The lay…
> 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…
Re: Ask HN: Is it just me, or is CSS too damn hard?
#264Re: Ask HN: Is it just me, or is CSS too damn hard?
#265Earlier quoted context omitted.
I must be missing something, because isn't 3 images side by side just: ? But you're right, the web isn't a UI platform. It's designed for to produce things that are like Microsoft Word documents. Web-apps are like using MSWord's scripting and text layout to produce a MSWord-app. Yeah, one can do it, but it's like cutting a steak with a spoon.
You are somewhat correct. I just tested with the tiny HN logo (upper left of this page), and a div with 3 imgs makes them appear side-by-side. The issue I had previously was that the three images were quite wide, and while I wanted them to still go next to each other (with a horizontal scrollbar in the browser), the browser moved images into a new row if they would overflow past the right edge. I haven't used JavaFX…
Re: Ask HN: Is it just me, or is CSS too damn hard?
#2661) 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…
CSS is a badly specified mix of a unidirectional constraint system, a typographical system, a compositor and a declarative transition/animation system.
While there is by now a CSS: The Ok Parts, there are no good parts because they hang off the bad parts.
Re: Ask HN: Is it just me, or is CSS too damn hard?
#2671) 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…
Re: Ask HN: Is it just me, or is CSS too damn hard?
#268I actually prefer coding CSS from scratch. Color schemes and making things look nice IS hard, for my previous and current projects I had to get feedback from friends, family, end users, graphic designers, etc. UX is hard, it's a different field than programming, but there is a method, research, and science behind it. Here's a good resource for UX: https://goodui.org And here is one for color theory: https://uxplanet.…
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…
I feel the same. I fiddled with css on personal projects just fine, but in my job, diving into years of accumulated, imbricated classes is a nightmare and even though I try, 80% of the time I end up passing the problem to the design team.
Re: Ask HN: Is it just me, or is CSS too damn hard?
#2691) 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…
> The browser has lots of default, complex behaviors that drive layout, and […] CSS is more about […] guiding that automatic engine
I think for most people who struggle with layout, what they really need to learn is what process the browser uses to lay out content, so that they can then turn their mind to how to guide it. Instead, I've seen hardly any CSS tutorials / documentation that start with a description of the layout algorithm and what hooks it provides via CSS; they all start from the meaning of individual CSS declarations, which are never the full picture.
I think there's really room for teaching layout from the other end (the following is the browser's algorithm, and here's what can influence it), for people who think procedurally.
Re: Ask HN: Is it just me, or is CSS too damn hard?
#270I think that in that sense CSS still irks me a bit, I still do a lot of things that just feeeel like a hack, but from what I search and google around it seems like that's the only way to do it? but I also think it's kinda fun, I like reading the MDN web docs from time to time and they do seem to explain things very thoroughly, I've had a lot of moments where things started to click after reading it.