| ▲ | dnlzro 4 hours ago | |
Web Components are a great way to implement things that the browser should have already implemented, like accordions, combo boxes, and date pickers that don’t suck. It’s been a pleasure to use them in a mostly static, content-heavy Astro site. But beyond that, they’re not really usable without a framework that can deal with state and reactivity across a whole application. And that’s fine! They fill a good niche. But just because the browser provides an API doesn’t mean it should be used whenever possible. | ||
| ▲ | WorldMaker 2 hours ago | parent [-] | |
Accordions: just use `<details name="accordion-name">` and style it however you like. No need for JS or Web Components any more for an accordion. Combo Boxes and Date Pickers: CSS Form Control Styling Level 1 [1] will be a massive game changer. `appearance: base` will make it easier to style every part of a browser's form input with just CSS as they start with fewer opinions on how it should be styled (less trying to be platform-specific, more web platform generic) and have more CSS selectors for their component parts. Yet they will still have all the accessibility of native form controls. Really hoping that draft moves forward this year. | ||