It's not just you. I'd recommend using a CSS framework. Have you checked out Bootstrap [0]? I was very much the same way (focused on backend). CSS is just a means to an end for me, in that I just wanted something that doesn't look like total garbage, so I used Bootstrap for the frontend bits. Allows you to quickly get up and running using the examples without learning too much CSS [1]. Just find something that looks…
Don't use bootstrap for anything beyond personal project prototypes. It ends up being a complete nightmare for maintenance. Coupling of DOM with presentation and state is the number one thing we should be avoiding in modern JS apps.
Ask HN: Is it just me, or is CSS too damn hard?
21–30 of 358 posts
Re: Ask HN: Is it just me, or is CSS too damn hard?
#22This is actually pretty simple, once you understand how "block" elements work. Block elements will always try to fill up the "available width" i.e., they stretch side ways. The sum of margin + its width must match the total width.
Inline elements will fill up its parent block like text.
So, a simple example - suppose you set a div's width to 100px, and margin to auto, then you will a 100px wide box centered.
I see people get confused when they try to have a block that has an unspecified width and hope CSS just figures out.
Re: Ask HN: Is it just me, or is CSS too damn hard?
#23To keep my sanity, I try to avoid touching it as much as I can (I use Semantic-UI which gets me most elements with little effort), and when I have to, I try to stick to the more recent, reasonable parts. Flexbox for example is understandable and predictable.
Re: Ask HN: Is it just me, or is CSS too damn hard?
#24I think there is a spectrum Of skills with programming at one extreme and visual design at the other. Even within “front end” you tend to have JS experts and CSS/design/UX experts. Some people can do both. When you consider UX, accessibility, progressive enhancement, cross browser and cross device support - there’s plenty to know. And unlike programming, it doesn’t all flow logically. Some stuff is subjective, other…
Re: Ask HN: Is it just me, or is CSS too damn hard?
#25The thing with CSS is it's not a programming language. Progamming skills and CSS skills are almost completely orthogonal. It is simply a domain of practical knowledge that takes years and years of dealing with all the idiosyncracies, cross browser issues, and silly warts of historical legacy that come with it to master. That being said, it is without a doubt the most powerful and simplest layout tool in existence. Th…
One being that practically all software nowadays are webapps and there's no choice. For those that aren't webapps and whose GUI toolkit use CSS or something like CSS, it's probably to try to pull people that already have experience with webapps.
Re: Ask HN: Is it just me, or is CSS too damn hard?
#26Earlier quoted context omitted.
Don't use bootstrap for anything beyond personal project prototypes. It ends up being a complete nightmare for maintenance. Coupling of DOM with presentation and state is the number one thing we should be avoiding in modern JS apps.
Interesting, I'll have to read about that. This has totally not been my experience.
Re: Ask HN: Is it just me, or is CSS too damn hard?
#27I 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 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 styles and not breaking something else.
Re: Ask HN: Is it just me, or is CSS too damn hard?
#28Re: Ask HN: Is it just me, or is CSS too damn hard?
#29No one takes CSS seriously. For most, CSS comes as an after thought. Build every part of the application then suddenly "Oh Right! CSS!" Slap bootstrap or other popular framework then don't think about it.
Yes, CSS is not a programming language like others but it is just as complex. It requires studying, practice and long exposure to become versed in it.
Note: you can google your way into using a couple jquery functions, but you can't become a competent JavaScript developer like that. The same goes for CSS.