Skip to content

Instantly share code, notes, and snippets.

@anselmh
Created December 5, 2013 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anselmh/7801609 to your computer and use it in GitHub Desktop.
Save anselmh/7801609 to your computer and use it in GitHub Desktop.
/* Wildcard selector searches through any part of the string */
html[data-useragent*='Chrome/13.0'] .nav{
background:url(img/radial_grad.png) center bottom no-repeat;
}
<html
data-useragent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1'
data-platform='MacIntel'>
var b = document.documentElement;
b.setAttribute('data-useragent', navigator.userAgent);
b.setAttribute('data-platform', navigator.platform );
b.className += ((!!('ontouchstart' in window) || !!('onmsgesturechange' in window))?' touch':'');
@anselmh
Copy link
Author

anselmh commented Dec 5, 2013

Just a re-write to save it for myself from this blog post: http://rog.ie/blog/html5-boilerplate-addon by Rogie King. All attributions go to him.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment