CSS Container Queries Explained: Build Smarter Responsive Components
Media queries respond to the viewport. Container queries respond to the parent element. This single difference unlocks truly reusable components that adapt to wherever they are placed — sidebars, grids, modals, anywhere.