Comment

Comment by zichy

Those "toggle buttons without JavaScript" are one of my pet peeves. It's always the same thing:

1. Someone finds out that you can use `:checked`.

2. They add some JavaScript to "enhance" their idea.

3. It's still less accessible than a proper implementation.

This example is a CSS hack and not something you would actually want to use in a production environment. JavaScript is absolutely necessary if you are developing a custom interactive element. If `<details>` works for you, fine. If it doesn't, you might want to look up ARIA attributes.

parent zichy 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton