logoalt Hacker News

tapirltoday at 2:58 PM2 repliesview on HN

The details / summary feature can also be implemented with pure css without JavaScript. Here is an example: https://docs.go101.org/std/pkg/io.html, just click all "+" signs to expand contents.

We can also use pure css to implement tab panels. A demo: http://tmd.tapirgames.com/demos.html#section-demo-4

Modern css is powerful.


Replies

jakelazarofftoday at 3:35 PM

Note that pure HTML and CSS implementations of tabs using <details> and <summary> fail to meet several important accessibility criteria [1].

While you can make something that visually appears to act as a set of tabs, building it accessibly unfortunately still requires JavaScript.

[1] https://adrianroselli.com/2019/04/details-summary-are-not-in...

show 2 replies
xorcisttoday at 3:23 PM

What is a good reference to learn modern CSS? I seems most books and online resources are quickly outdated.

show 1 reply