I want to use Modernizr to detect whether a user is view a site on a desktop, tablet or mobile device.
My initial first thoughts are obviously to check screen sizes
You can use the following extension for Modernizr: https://www.npmjs.org/package/mobile-detect
Or (without Modernizr) you could use Restive.JS to add a ".phone" or ".tablet"-class to your body: http://docs.restivejs.com
(Look for "formfactor" down the page.)