Just stumbled upon a nice article by Chris Miles about a new feature in CSS3 that might in the future offer an alternative to doing feature detection with Modernizr.

Modernizr is probably the first 3rd-party library I add to every single web project at the beginning. Way before jQuery. But most of the time I only use it for detecting CSS-feature-support in browsers. Wouldn’t it be nice if CSS itself offered some kind of feature-detection functionality built natively right into the browser? Esp. if you mostly have a static page but just want to use some nice modern CSS features, adding Modernizr to the mix (a) hits your site’s performance a little bit and (b) simply kind of feels redundant. Surely, you can get pretty far by letting the cascade and the fallback-behaviour of CSS work for you, but the code gets unmaintainable pretty quickly.

I doubt @supports will replace Modernizr for me in the near future, though, simply because it is not “officially” available in most browsers (Chrome >= 24, Firefox >= 17, Opera >= 12.1 according to MDN), but this is hopefully just a matter of time. In the meantime Modernizr will hopefully include window.supportsCSS-based detection soon :-)

Another really nice introduction about this topic (this time with a focus on Firefox instead of Opera) is available on Peter Gasston’s blog