Live data from Hacker News

Replacing JavaScript with Just HTML

htmhell.dev

121–130 of 296 posts

Re: Replacing JavaScript with Just HTML

#122
I don't want to be so negative, but we got details and popover after literally decades, and we still have datalist presented as a plausible option? Html is so underdeveloped and the first we all agree on that the first we'll pretend from committee real advancement

Re: Replacing JavaScript with Just HTML

#123

Earlier quoted context omitted.

That is no longer true! You can do it in CSS with a combination of `@starting-style` and `transition-behavior: allow-discrete`. [1] Another gotcha you'll run into is animating the height. A couple other new features (`interpolate-size: allow-keywords` and `::details-content`) will let you get around that. [2] Modern CSS is awesome. [1] https://developer.chrome.com/blog/entry-exit-animations [2] https://nerdy.dev/open…

@starting-style Has less than 90% browser support making it a non-starter for the time being at least.

91% of usage for browsers tracked by caniuse [1].

The biggest gap is Chrome versions > 2 years old.

[1] https://caniuse.com/?search=%40starting-style

Re: Replacing JavaScript with Just HTML

#124

Earlier quoted context omitted.

> But as much as I hate to admit it, it is very difficult to build something functional today with plain HTML and no/minimal JS. I would certainly agree that using a little JS can get you further than just HTML. But I think that a plain HTML page is far more pleasant to use (and thus, functional) than the JS monstrosities that dominate the Web today. There's a reason people use the NoScript addon: because a whole lot…

It's not an either/or. Modern Javascript is actually really nice to write and use, and you can write it in a tight, minimal way that doesn't bloat the page or slow it down.

Of course you can, but most people still opt to pull in a whole framework (React) or heavy library (jQuery) just to achieve what's essentially a few XMLHttpRequests and some DOM changes.

Re: Replacing JavaScript with Just HTML

#125
post #87

Earlier quoted context omitted.

Why would you build a switch instead of relying on the user’s system settings? The only reason I can imagine is that your dark/light mode is not usable/readable so it forces the user to switch

I often use different light/dark settings between apps and my system. Just because I want system UIs to be dark, for example, doesn't mean I want to read long pages of white-on-black prose on your blog.

Seconded. Just because I like to have the browser toolbar dark and GitHub dark doesn't mean I also want to read lengthy articles (LWN) in thin white text on a black background.

Re: Replacing JavaScript with Just HTML

#127

Earlier quoted context omitted.

Tabs, accordion, combobox. There is a whole lot more, these are just the ones I can remember now.

Accordion behavior is discussed in the article in the "Accordions / Expanding Content Panels" section: > Use the same name attribute on all related details (like radio buttons) to restrict only one open panel at a time And tabs can be a -based accordion with some creative CSS to adjust the layout (left as an exercise for the reader, but I could write up an example if that would be helpful!)

It won’t have the necessary keyboard shortcuts.
Post reply on HN