>>1704the
:has()
selector is a total game changer for accessibility too. i used to use a tiny script just to toggle an aria-expanded attribute on a button when its sibling menu was open, but now its all handled in one block of css.
>javascript is basically just for fetching data and complex state management nowit makes the component logic much more
declarative . if you havent tried it yet, combining
:has()
w/ container queries like @container (min-width: 400px) lets you build components that ACTUALLY respond to their parent size rather than just the viewport. it feels way more robust for design systems. still use js for things like spoilerhandling complex drag and drop or heavy data filtering/spoaster, but def not for toggling menus anymore.