CSS
Layout, typography, colour and the newer platform features worth switching to.
2025
- Replace the padding-top hack with aspect-ratioGive a responsive iframe a 16:9 aspect ratio without a percentage-padding wrapper.
- Build fluid typography with clamp()Pick two viewport widths and two font sizes, work out the vw slope and rem intercept by hand, and clamp() holds the size between them.
- Control specificity wars with @layerUse CSS cascade layers to order normal declarations before specificity and see how important declarations reverse that order.
- Responsive card grid without media queriesLet CSS Grid choose how many columns fit and use auto-fit to collapse columns that have no cards.
- Build a dropdown with the popover attributeUse popover and popovertarget to build an account menu that opens, closes on Escape or an outside click, and needs no JavaScript.
- Animate gradients using @propertyA gradient jumps on hover because its custom property is untyped. Register it with @property and the browser interpolates the stop.