Sometimes, we need to take environment-specific actions while working on web projects.

Device.js is a tiny JavaScript library that simplifies writing conditional CSS or JavaScript that is based on the platform, operating system or browser.


The library detects them and adds specific classes to the <html> element, just like <html lang="en" class="android tablet landscape">.

But that’s not all. Device.js has JavaScript methods to detect them too. And there is support for all the major operating systems + browsers.

WebResourcesDepot Feed