New(ish) CSS properties worth adopting
websmith.studio·19h·
Discuss: Hacker News
Flag this post

Here are some new(ish) CSS properties that are seriously worth adopting. We use them in production, suggest you also try them out if not already. Hopefully there is a couple you haven’t tried yet.

Balanced headlines without manual line breaks

h1 { text-wrap: balance; }

Stops headlines from having one word on the last line. Browser redistributes text automatically. Works across modern browsers.

Tailwind: text-balance

Massive performance boost for long pages

article { content-visibility: auto; }

Browser skips rendering off-screen content. Massive performance boost for long pages with lots of content. You need to handle heights properly (via contain-intrinsic-size) to prevent scroll jumping.

Tailwind: [content-visibility:auto]

F…

Similar Posts

Loading similar posts...