CSS Features That Are New Enough to Surprise You

A recent write-up by Andy surveyed CSS capabilities that are genuinely recent. The premise is simple: if you haven’t checked in on CSS for about a year, nearly everything on the list will be unfamiliar. Much of it is cutting-edge enough that it may not be ready for immediate production use, but that gap is narrowing fast — by a rough estimate, within a year developers will be reaching for these features without a second thought.

  • Masonry layout, expressed as grid-template-rows: masonry; — described as a terribly clever way to deliver this long-awaited feature.
  • The :is selector, which strips a lot of the pain out of writing certain selectors, as in article :is(h1, h2, h3):not(:first-child). It raises the question of why Sass never offered something similar.
  • min(), max(), and clamp(), whose best practices and clever applications are still being worked out. Fluid typography is the most obvious and useful example, but it only scratches the surface.
  • Units such as ch and ex — max-width: 70ch; comes highly recommended. Common typography guidance puts line length at 45 to 75 characters, so instead of approximating that with some abstractly related width, you size against the actual width of characters.
  • Fancier text-decoration, for example text-decoration-thickness: 0.5rem; — thicken an underline while keeping the benefit of text-decoration-skip-ink, which is lost when you resort to a border.