Live data from Hacker News

Is there too much CSS now?

css-tricks.com

51–60 of 125 posts

Re: Is there too much CSS now?

#51
post #28

there's a very old argument in computer science between minimal standards and "batteries included" standards — RISC vs CISC, C vs C++, scheme vs common lisp, Algol W vs Algol 68 etc. The web community, for whatever reason, is firmly in the "batteries included" camp. CSS alone is approaching the number of built-in symbols as a "big" language like common lisp or Perl. New features are always loudly celebrated, even if…

> Personally I think we need a "scheme" for the web

Yes!

And since it's the web, perhaps put some training wheels for newcomers: easy global variables, more familiar syntax... let me time-travel and see how it goes:

time travels

Sorry, turns out those training wheels were a bad idea!

Other than that, please open up your devTools console and tell me: what do you think?

:)

Re: Is there too much CSS now?

#52

Earlier quoted context omitted.

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.

CSS is also interpreted.

CSS is actually compiled. WebKit uses a Just In Time (JIT) compiler [1]; I suspect all modern web engines do something similar.

[1]: https://webkit.org/blog/3271/webkit-css-selector-jit-compile...

Re: Is there too much CSS now?

#53

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…

and there's the vulkan like layer coming up, it's gonna become a rendering pipeline (for better or worse)

Re: Is there too much CSS now?

#54
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?

Wes Bos has a freebie

https://cssgrid.io/

CSS Tricks also has

https://css-tricks.com/snippets/css/complete-guide-grid/

Re: Is there too much CSS now?

#55
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?

I found watching Kevin Powell's intro on YouTube really helpful. I already had a basic understanding of grid before watching it, but this helped me make sense of the snippets I'd pieced together in my brain over the last couple of years.

https://www.youtube.com/watch?v=rg7Fvvl3taU

Re: Is there too much CSS now?

#56
I’m personally more annoyed at the SVG pollution in modern day frontends. I’m not saying I hate SVGs but why in the heck are we producing 10k like html files by incorporating SVG paths directly into the HTML? There should be a standardized browser protocol to be able to insert SVG via filename and pass it any styling references.

Re: Is there too much CSS now?

#57

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…

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…

Disagree.

The beauty of CSS Grid and Flexbox is that you don’t need to know anything about the hacks and work-arounds which were the industry standard to approximate what these specifications give us today.

The reason why you see seasoned web developers go on and on about how it used to be is due to how unintuitive and fragile those methods were compared to today.

It’s similar to young people today: they don’t need to know anything about using a modem to dial-up to an ISP to access the internet in the age of broadband and Wi-Fi.

Re: Is there too much CSS now?

#58

Earlier quoted context omitted.

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.

CSS is also interpreted. CSS is actually compiled. WebKit uses a Just In Time (JIT) compiler [1]; I suspect all modern web engines do something similar. [1]: https://webkit.org/blog/3271/webkit-css-selector-jit-compile...

By that argument JavaScript is also compiled, so this point is wrong no matter how you interpret it: if "interpreted" means source code is transmitted and then executed in whatever fashion, then both JS and CSS are interpreted, if "interpreted" means a specific execution model on the client machine, then they are both JIT compiled and neither are interpreted.

Re: Is there too much CSS now?

#59
Since this went by the HN wayside earlier today I thought I would share it amongst people with thoughts on CSS. I made a very absurd hommage to CSS (the language, itself) over the weekend - https://css-magnetic-poetry.tone-row.com/

Definitely not too much CSS IMO. It's a language in flux for sure, but as someone who has been doing frontend for more than a decade, I would rather have 5 ways to accomplish something than 1 way that's a hack and only works on some browsers.

Re: Is there too much CSS now?

#60
I still remember a time where CSS pundits claimed that the box model was "simple" and if you didn't understand how to make a layout with "float" you were an idiot.

There is a reason why people resorted to tables at the time, because tables were simple to reason about. Grids are kind of tables 2.0 and that float stuff was never good nor simple. So F. you to all the people all these years that claimed there was nothing wrong with CSS, float layouts were a hack and it was bad.

CSS is now actually much much simpler than it used to be, all you need to know as a developer is basically flexbox and/or grids to make beautiful layouts.

CSS can succeed where the DOM failed: CSS can become a great tool that makes using CSS frameworks _unnecessary_, it just needs some kind of module system for scoped CSS rules, which AFAIK doesn't exist in the spec yet.

Post reply on HN