Live data from Hacker News

Replacing JavaScript with Just HTML

htmhell.dev

11–20 of 296 posts

Re: Replacing JavaScript with Just HTML

#11

The details / summary thing absolutely kills me. There’s basically nothing you can’t do with them. Hiding and replacing markers is easy. But every component library just pretends they don’t exist. It even saves you the effort of all the aria control and expanded tags: these tags don’t need them.

Details works even when it's set display:contents too, for even more flexibility. Can't animate from open›close, yet, though. That's pretty much my last frustration with it.

Re: Replacing JavaScript with Just HTML

#12
Something I keep thinking about when I consider the trade-offs between building a site with HTML/CSS wherever possible vs JS is what the actual _experience_ of writing and maintaining HTML/CSS is vs JS. JS gets knocked around a bunch compared to "real" languages (although less so in recent years), but at the end of the day, it's a programming language. You can write a loop in it.

Writing a web server in C++ is a way to get excellent performance. So why don't most people do it?

Re: Replacing JavaScript with Just HTML

#16

When building out a new app or site, start with the simplest solution like the html-only autofilters first, then add complex behavior later. It's good to know these things exist so there are alternatives to reaching for a fat react component as the first step.

Until your client tells you that it doesn't work in Edge and you find out it's because every browser has its own styling and they are impossible to change enough to get the really long options to show up correctly.

Then you're stuck with a bugfix's allotment of time to implement an accessible, correctly themed combo box that you should have reached for in the first place, just like what you had to do last week with the native date pickers.

Re: Replacing JavaScript with Just HTML

#18

The details / summary thing absolutely kills me. There’s basically nothing you can’t do with them. Hiding and replacing markers is easy. But every component library just pretends they don’t exist. It even saves you the effort of all the aria control and expanded tags: these tags don’t need them.

Details works even when it's set display:contents too, for even more flexibility. Can't animate from open›close, yet, though. That's pretty much my last frustration with it.

I think the CSS support for that has finally landed, though it means targetting a pseudo element instead. Its been a year, so support is probably good enough you don't care if just the animation doesn't happen.

https://developer.chrome.com/blog/styling-details

Post reply on HN