modernizr
Version:
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
16 lines (15 loc) • 457 B
JavaScript
/*!
{
"name": "CSS HSLA Colors",
"caniuse": "css3-colors",
"property": "hsla",
"tags": ["css"]
}
!*/
define(['Modernizr', 'createElement', 'contains'], function(Modernizr, createElement, contains) {
Modernizr.addTest('hsla', function() {
var style = createElement('a').style;
style.cssText = 'background-color:hsla(120,40%,100%,.5)';
return contains(style.backgroundColor, 'rgba') || contains(style.backgroundColor, 'hsla');
});
});