Sentry Logo Debug Microservices & Distributed Systems

Join my free newsletter

Level up your dev skills and career with curated tips, practical advice, and in-depth tech insights – all delivered straight to your inbox.

3 min read
Up to date

Trevor I. Lasn

Staff Software Engineer & Engineering Manager

CSS @supports: Write Future-Proof CSS

Detect CSS feature support and provide smart fallbacks with @supports

I use @supports constantly to check if browsers can handle modern CSS features. Think of it as a safety net for your styles - if a browser doesn’t support a feature, you can provide a solid fallback.

Here’s what it looks like in practice:


How @supports Works

The @supports rule checks if a browser understands a CSS property-value pair. You can test for single or multiple features:

Here’s how I use @supports to progressively improve a layout:


Testing Multiple Properties

Sometimes you need to test for multiple CSS properties. Here’s how to handle complex feature detection:


Best Practices

  1. Start with solid fallback styles that work everywhere
  2. Use @supports to enhance the experience with modern features
  3. Test features individually when possible
  4. Consider using multiple @supports rules for different feature combinations
  5. Keep fallback code maintainable - don’t create overly complex style overrides

Become a better engineer

Here are engineering resources I've personally vetted and use. They focus on skills you'll actually need to build and scale real projects - the kind of experience that gets you hired or promoted.

Many companies have a fixed annual stipend per engineer (e.g. $2,000) for use towards learning resources. If your company offers this stipend, you can forward them your invoices directly for reimbursement.


This article was originally published on https://www.trevorlasn.com/blog/detect-css-features-with-supports-property. It was written by a human and polished using grammar tools for clarity.

Interested in a partnership? Shoot me an email at hi [at] trevorlasn.com with all relevant information.