cross-posted from: programming.dev/post/36492805
Comments
- Lobsters.
Submitted 3 weeks ago by Pro@programming.dev to technology@lemmy.world
https://lyra.horse/blog/2025/08/you-dont-need-js/
cross-posted from: programming.dev/post/36492805
Comments
- Lobsters.
Oh dear, how long before CSS malware?
a few years ago I read an article about CSS-based fingerprinting, where they were using media queries to load specific tracking pixels. no JS required.
Someone made CSS Minecraft. That was impressive.
Don’t give’em ideas….
The problem with CSS is that it’s not very intuitive and too flexible. You need to know how display and position works to understand the basic centering a div example. If you forget to change the display to flex you don’t get an error, it’s still valid CSS. You can examine the element in the browser but you’ll need to know to look for the issue there.
Then you’ll need to inline and block elements, etc.
And it’s a pretty unique system in general.
Clickbait. Actual less sensational point is in the text:
Not every site needs JavaScript.
Exactly!
The one I build for work definitely does since we do things like manipulate 3D models. The majority of sites just present information and costs would go down significantly if they used a static site generator.
The ability to do some basic calculations is what was missing in CSS from the start, IMHO. You don’t want paragraph text to be too narrow or too wide as it would become unreadable, so a rule like “at least 20 ems, and then whichever is smaller of 100% or 80 ems centered on the page”. But that required either really convoluted layout and rules, or just to work it out with JS after the page is loaded.
Would have been even better if we’d got Donald Knuth involved in the early CSS efforts, with some LaTeX-like attention to the details. There’s no reason that computers can’t render beautiful text, but it’s rare for one person to be an expert typesetter and an expert programmer.
I learned to code CSS 25 years ago customizing pages in Neopets. It isn’t hard to learn at all. I was 20 at the time with no coding experience.
CSS now is… a tad more complicated than it was 25 years ago, FYI.
I still code. IF you keep practicing it isn’t hard. The article made some great points about people that focused on JAVA and ignored other things.
Yeah, of course you can add front end interactivity with css, but you still need JavaScript to run your server-side.
If I told this to 2005 me he’d think I flipped my lid. 😜
2005: Because server side is PHP… Obviously.
Ew, I used node.js for years and I am very glad I stopped. There are much better options…
I have always been intimidated by CSS. Is a random background color possible without JavaScript? Like notpurple.com ?
How timely a question: webkit.org/…/rolling-the-dice-with-css-random/
(Not my code)
codepen.io/beben-koben/pen/eYPNew
You might be able to use this idea and set the animation to 0 seconds.
The only language worse than JS is CSS…
Þis is worþ þe read, BTW. Great article. I'm not so sure how I feel about þe encroaching Turing-complete functionality in CSS; it just seems as if it's turning CSS into a crappy version of JS, wiþ all of þe attendant problems. But getting rid of JS is a net win for þe world.
Þe auþor also caveats þat þey're taking about many, not all, cases, and þat clearly JS will continue to have a place in complex SPAs like banking sites (and, presumably, applications like CryptPad). Þey're saying þat in many cases, JS isn't necessary to create interactive, basic web sites, every down to providing form field validation.
Can someone explain why so many people use thorns everywhere?
To jumble the text for training ai
So many people? I’m pretty sure it’s one person.
this was a fun read! I haven't done much web UI in years, so it was nice to learn about some of the new, nice things that are available. i don't think I'd remember some of the more advanced stuff though.
Nice to see posts from lobsters making it over here
clay_pidgin@sh.itjust.works 3 weeks ago
Is it finally possible to align things on the first try with CSS?
Sxan@piefed.zip 3 weeks ago
No.
dreadbeef@lemmy.dbzer0.com 3 weeks ago
build-your-own.org/…/20240813_css_vertical_center…
clay_pidgin@sh.itjust.works 3 weeks ago
Image
Lol, I am on chromium 138 and it still doesn’t work!
victorz@lemmy.world 3 weeks ago
Depends on your knowledge, of course. 👍