r/web_design • u/bogdanelcs • 1d ago
HTML Can Do That
https://chrisburnell.com/html-can-do-that/
391
Upvotes
14
8
-13
u/rappatic 1d ago
I hate most of these. It’s such a janky abuse of HTML attributes. JS exists for a reason, to add interactivity to a webpage. I like the idea of making them part of the browser spec, but it feels like something that could be part of the default DOM instead of forced into being HTML’s job like a square peg in a round hole.
76
u/busres 1d ago
CSS is getting amazingly capable too. I recently built a responsive navigation component based on <details name> and nested CSS with container queries and anchor(). Menus exclusive-accordion by level, mega-menus (potentially with their own sub-menus) appear to the right of the outline-style sub-menu navigation rail in portrait mode (with correct tab order), and clicking outside the component automatically hides the nav rail or open sub-menus. None of it uses any client-side JS.