Skip to content

Instantly share code, notes, and snippets.

@tomblanchard
Created April 25, 2014 14:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save tomblanchard/11290882 to your computer and use it in GitHub Desktop.
Save tomblanchard/11290882 to your computer and use it in GitHub Desktop.
Mini Modernizr: I only ever use Modernizr mostly to check for JS and / or touch screen devices. This tiny piece of code will replace the classes which are on the `<html>` element `no-js` with `js` and `no-touch` with `touch`.
<script>!function(a,b){"use strict";b.documentElement.className=b.documentElement.className.replace("no-js","js"),("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(document.documentElement.className=document.documentElement.className.replace("no-touch","touch"))}(window,document);</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment