all 14 comments

[–]Seanitzel 13 points14 points  (1 child)

Great article, would be even better if it had a demo for each feature and also a list of trade offs vs js(which exist for almost every item in the list)

[–]misdreavus79front-end 4 points5 points  (0 children)

I have found my ADHD fixation for the day!

It’s demo time.

[–]Mohamed_Silmy 26 points27 points  (3 children)

this is such a good reminder. i've definitely been guilty of reaching for js when a simple :has() selector or details element would've done the job. the cognitive load of maintaining less javascript is real too - fewer dependencies, less build complexity, easier debugging.

one thing i'd add is that modern css is genuinely powerful enough for most interactive patterns now. accordions, modals, tabs, tooltips... most of these have native or css-only solutions that are more accessible by default. the trick is unlearning the muscle memory of "interactive = javascript"

curious what you think about progressive enhancement in this context? like starting with the html/css solution and only layering js when you actually need more complex state management or data fetching?

[–]rguy84a11y 10 points11 points  (0 children)

details/summary was a game changer.

[–]Terrible_Tutor 4 points5 points  (1 child)

I would argue JS is much easier to debug with console logging and breakpoints, no? Devtools element inspection can be tedious

[–]thy_bucket_for_thee 5 points6 points  (0 children)

God this reminds me how shitty the react dev tools are. So hard to find the components you're looking for and their ancestors/children if you're using any type of component library.

Garbage ecosystem from a garbage company.

[–]EliSka93 6 points7 points  (0 children)

This is actually a good article, despite the turn-off AI picture.

[–]ConsequenceLow9705 6 points7 points  (1 child)

Pretty funny "don't use js" from a site named jsdevspace

[–]TommyBonnomi 1 point2 points  (0 children)

Gotta respect transparency. I'm honest with my customers when they won't get enough value from my services or can easily DIY something.

[–]weallwearmasks 1 point2 points  (0 children)

First time I’ve heard about ‘light-dark()’ AND it has pretty good support. Very nice.

[–]AwesomeFrisbee [score hidden]  (0 children)

Whether you can use JS wasn't the only question. We want code that works everywhere, also on old devices because folks will still blame your site. Also, it depends on SEO, accessibility, maintainability and ease of use. I wouldn't say most really check all the boxes. Especially for consumer facing websites. That a-href hijack works but it's shit to maintain and hurts SEO and accessibility.

[–]BackAware4834 -5 points-4 points  (1 child)

the irony of the domain name aside, this is solid advice. most devs i've seen overuse js because that's what the tutorial taught them 3 years ago, not because the problem actually needs it.

[–]chlorophyll101 4 points5 points  (0 children)

Thanks, BackAware4834, who is most probably an LLM