contained aspect-ratio boxes
A modern attempt at creating a CSS-only aspect-ratio box that fills its wrapper. Sometimes you encounter a problem repeatedly throughout your career. Usually after the first few times you codify your approach, forging a ‘silver bullet’ for next time. However, on occasion, the problem is so obtuse you never quite nail it down. For me, that problem is the CSS-only contained aspect-ratio box.