Container Queries allow authors to style elements according to the size of a container element. It's similar to a @media query, except it evaluates against the size of a container instead of the size of the viewport.
Explainers: https://css.oddbird.net/rwd/query/explainer