So I need to detect if a user's browser supports CSS gradients, that's it. I would use Modernizr, but even with only including gradient detection, it would be wasteful compared to just doing it myself.
As I understand it, this would be how to go about it;
- Creating an element that isn't added to the DOM
- Setting
background-image
tolinear-gradient
with all the vendor prefixes - Reading
background-image
and checking forgradient
, to see if it's still there
I couldn't figure out Modernizr's source though, what's the core of what they're doing in this? So I can do it myself. http://modernizr.com/download/#-cssgradients-prefixes