Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save markhowellsmead/6b25628059dd2f3be09d768dd2c2be17 to your computer and use it in GitHub Desktop.
Save markhowellsmead/6b25628059dd2f3be09d768dd2c2be17 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