frontend

The One CSS Feature I Wish Everyone Used

Thoughts from the intersection of code, craft, people, and progress.

It’s time we all embraced aspect-ratio.

The aspect-ratio property solves a common layout problem with one clear declaration, which feels almost rude after years of percentage padding tricks. It makes media and responsive components more predictable while allowing several old hacks a dignified retirement.

CSS rewards people who understand its model more than people who accumulate workarounds. The cascade, intrinsic sizing and modern layout tools solve a surprising number of problems once we stop fighting them.

There is a practical tension underneath this topic: we want enough structure to move confidently, but not so much that the structure becomes the work.

Front-end work has a habit of looking simple from a distance. The browser then introduces real content, small screens, old devices, keyboard navigation and somebody using the product in a way nobody drew in the design file.

That is not a dramatic conclusion, but useful work is often built from undramatic conclusions applied consistently.