Skip to content

Instantly share code, notes, and snippets.

@rondevera
Created May 23, 2011 19:53
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 rondevera/987444 to your computer and use it in GitHub Desktop.
Save rondevera/987444 to your computer and use it in GitHub Desktop.
JS to detect whether the browser supports `box-shadow: inset [...]`
// Detect whether the browser supports `box-shadow: inset [...]`:
(function(e,s,k,u){s=e[s];s[k]=s[k]==u?0:'inset 0 0 0 red';return!!s[k]}(document.createElement('test'),'style','webkitBoxShadow'));
// Replace `webkitBoxShadow` as needed, e.g., `MozBoxShadow`.
// For use when Modernizr doesn't provide such fine-grained coverage:
// https://github.com/Modernizr/Modernizr/issues/109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment