Earlier quoted context omitted.
You say awesome, I say layers upon layers of opaque incantations I have to remember. Thank god for LLMs.
And how might you do this in Javascript?
Replacing JavaScript with Just HTML
121–130 of 296 posts
Re: Replacing JavaScript with Just HTML
#122Re: Replacing JavaScript with Just HTML
#123Earlier 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.
The biggest gap is Chrome versions > 2 years old.
Re: Replacing JavaScript with Just HTML
#124Earlier 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.
Re: Replacing JavaScript with Just HTML
#125Earlier 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.
Re: Replacing JavaScript with Just HTML
#126A simple page which shows what native components are available with/without the need for polyfills for a given browserslist config
Re: Replacing JavaScript with Just HTML
#127Earlier 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!)
Re: Replacing JavaScript with Just HTML
#128Re: Replacing JavaScript with Just HTML
#129Re: Replacing JavaScript with Just HTML
#130Nobody tell them about how much stuff can go into SVG. That can even be inlined within HTML source code.