Adapt.js is a tiny (<1kb minified) JavaScript file that can load CSS files according to the width of the web pages.

Before the browser renders a page, it checks for the width and decides the CSS file to be used from a given array.

Adapt.js

This can be easily accomplished with a server-side script, however, Adapt.js will work even if caching is enabled and it has support for the resize + orientationchange events.

A potential drawback is the possibility of the flash of unstyled content (the same problem that occurs when using JS-powered web fonts) which can occur only for a tiny period time.

The usage of the script is very straightforward, just include it to your web pages, define the rules and that's it.

WebResourcesDepot Feed