Live data from Hacker News

Is there too much CSS now?

css-tricks.com

41–50 of 125 posts

Re: Is there too much CSS now?

#41
post #39

Being a backend web developer, for the longest time I felt I could get by using CSS frameworks but now it's so bloody complicated even with the framework. While I'm glad that CSS is more expressive and hacks are becoming a thing of the past I feel that it is a discipline that I can no longer half ass.

[deleted]

Re: Is there too much CSS now?

#42
No, it's amazing what you can accomplish with CSS now! You used to have to listen for user events with Javascript (later jQuery, around 2006) to add/remove CSS classes. There was no :hover :focus etc.

Today, CSS pseudo-classes cover just about every transition state you need when designing a web application.

I appreciate the approach frameworks like Tailwind are taking to CSS. At first I found it awkward to include so many classes in my markup, but I've come to appreciate the flexibility (without surprising behaviors).

10 years ago, I caused all kinds of headaches for myself by trying to customize .btn with crap like a#sales-promo-1.btn a#sales-promo-2.btn - truly a mess.

Re: Is there too much CSS now?

#43

Yes, because the whole web has become infected with the server side dictating rendering for you instead of just delivering documents and letting the user render how they desire.

>Yes, because the whole web has become infected with the server side dictating rendering for you

This makes me feel old. We've come full circle. The rediscovery of SSR in the JS community is now considered "new" again.

Re: Is there too much CSS now?

#44
post #19

Earlier quoted context omitted.

I wouldn't compare it to a scripting language specifically; it's maybe powerful like JS, but I wouldn't say it's "very JavaScript-like" in any other way. I'd compare modern CSS more to a logic language like Prolog or SQL; or maybe to whatever you'd call Excel (dataflow programming?) In places where CSS takes expressions, they're always declarative, functional expressions; and they're always guaranteed to auto-update…

CSS is also, notably faster for many equivalent operations, because JS has its whole single-threaded, interpreted bottleneck.

CSS is also interpreted. CSS is faster because it's not a general purpose language and so its expressions have many optimization opportunities for reusing partial computations and parallelization.

Re: Is there too much CSS now?

#45

CSS has become like a scripting language now. You can do things like nested CSS[0], keyframe animations[1], calc operations[2], etc It has become very JavaScript-like and this is why I always try to see if I can do something in CSS first before I resort to JS. [0] https://www.w3.org/TR/css-nesting-1/ [1] https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes [2] https://developer.mozilla.org/en-US/docs/Web/CSS/c…

I mean some of those things just make sense. Why shouldn't CSS allow you to mix units and do some basic maths like with calc? Having had to resort to JS for that stuff is the real issue there.

CSS in my eyes should be able to handle 99% of visual style related needs with ease, JS should be there for the rest.

Re: Is there too much CSS now?

#46
post #21

No. It's finally getting to be reasonable. The hackarounds are being displaced in droves now. Ever since CSS grid became a thing, I dumpstered all of the 3rd party web framework stuff I had been using. Placing elements in the right parts of the viewport (across all target devices) has always been 95% of the reason I consumed 3rd party libraries.

What's the best reference and tutorial for modern CSS grid compatible across the standard browsers?

https://gridbyexample.com

Re: Is there too much CSS now?

#47
Nope. Flexbox makes it easy to just use plain CSS nowadays. No more SASS or any other preprocessor nonsense. Not even a fan of Tailwind (too much complexity for dubious benefit).

CSS has never been better and now there's just the right amount of it. Also now that there's no more need for crazy JS hacks, you can have just a little bit of JS for interactivity and that's it. Front end development is finally pleasant again.

Re: Is there too much CSS now?

#48
post #19

CSS has become like a scripting language now. You can do things like nested CSS[0], keyframe animations[1], calc operations[2], etc It has become very JavaScript-like and this is why I always try to see if I can do something in CSS first before I resort to JS. [0] https://www.w3.org/TR/css-nesting-1/ [1] https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes [2] https://developer.mozilla.org/en-US/docs/Web/CSS/c…

I wouldn't compare it to a scripting language specifically; it's maybe powerful like JS, but I wouldn't say it's "very JavaScript-like" in any other way. I'd compare modern CSS more to a logic language like Prolog or SQL; or maybe to whatever you'd call Excel (dataflow programming?) In places where CSS takes expressions, they're always declarative, functional expressions; and they're always guaranteed to auto-update…

yes, declarative is exactly how i'd describe css "programming". you supply constraints and the css engine applies them as best it can. the constraint declaration language of css is becoming more sophisticated, which is much needed and welcome, but it's not anywhere close to scripting (as in, providing a precise flow of instructions).

Re: Is there too much CSS now?

#49

This take is a disaster. So we get a decade of bloated frameworks to compensate for missing properties and then just when browsers are about to catch up and make all that cruft pointless we get people complaining about it. This isn't a thing. This is some software engineer edgelording. Yeah, we get it, you don't like CSS because you aren't good at it. Just stop.

> This is some software engineer edgelording.

This is Chris Coyier, who launched css-tricks back in 2007 and codepen in 2012. He's worked in this field for over 15 years and is one of the most recognisable figures in the webdev community.

Re: Is there too much CSS now?

#50
post #38

Too much CSS, possibly. Too much cognitive load, definitely, I do think so. As a whole, modern CSS features feel unintuitive and often require a historical knowledge of the problems this new feature X was trying to solve, which means to me, it's laden with baggage. Some new CSS feature pages on MDN are absolutely gigantic in their explanations, and that means that there is a lot of 'talking' required to overcome its…

I've just started playing around with CSS after a seven year break from web programming and have the opposite impression. The two biggest additions I've seen are flexbox and grid both of which massively decrease the cognitive load—compared to past options, it almost feels like cheating. Moreover, they do this by consciously not building on top of past layout features but instead doing their own thing. CSS is still a…

> CSS is still a mess of random features that can't be cleanly composed or extended

The lack of orthogonality and composability has always been the core issue. It's definitely better now, and atomic CSS makes this pretty close to simple.

Post reply on HN