mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-17 15:11:04 +00:00
23 lines
841 B
JavaScript
23 lines
841 B
JavaScript
/*!
|
|
{
|
|
"name": "CSS Multiple Backgrounds",
|
|
"caniuse": "multibackgrounds",
|
|
"property": "multiplebgs",
|
|
"tags": ["css"]
|
|
}
|
|
!*/
|
|
define(['Modernizr', 'createElement'], function(Modernizr, createElement) {
|
|
// Setting multiple images AND a color on the background shorthand property
|
|
// and then querying the style.background property value for the number of
|
|
// occurrences of "url(" is a reliable method for detecting ACTUAL support for this!
|
|
|
|
Modernizr.addTest('multiplebgs', function() {
|
|
var style = createElement('a').style;
|
|
style.cssText = 'background:url(https://),url(https://),red url(https://)';
|
|
|
|
// If the UA supports multiple backgrounds, there should be three occurrences
|
|
// of the string "url(" in the return value for elemStyle.background
|
|
return (/(url\s*\(.*?){3}/).test(style.background);
|
|
});
|
|
});
|