Skip to content

Instantly share code, notes, and snippets.

@trey
Created February 14, 2012 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save trey/1827930 to your computer and use it in GitHub Desktop.
Save trey/1827930 to your computer and use it in GitHub Desktop.
Detect webkit image masks
// Detect CSS mask support and hack it into Modernizr
if ( document.body.style[ '-webkit-mask-repeat' ] !== undefined ) {
Modernizr.cssmasks = true;
$('html').addClass('cssmasks');
} else {
Modernizr.cssmasks = false;
$('html').addClass('no-cssmasks');
}
@trey
Copy link
Author

trey commented Feb 14, 2012

Thanks to @zenworm for pointing me to this code.

@postpostmodern
Copy link

Apparently, this is available in the community add-ons when configuring Modernizr.

http://www.modernizr.com/download/

@trey
Copy link
Author

trey commented Feb 19, 2012

@postpostmodern, if you can get that to work, let me know. I had no luck. Firefox returned true.

@postpostmodern
Copy link

Oh. I just saw it in the config. I hadn't actually tried it.

@Yubari
Copy link

Yubari commented May 9, 2012

still not fixed=(

@paulirish
Copy link

thanks for the suggestion. fixed it upstream: Modernizr/Modernizr@2d3a32c...314ceda

@trey
Copy link
Author

trey commented May 11, 2012

@paulirish Awesome! Thanks.

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