modernizr
Version:
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
27 lines (26 loc) • 755 B
JavaScript
/*!
{
"name": "Background Position Shorthand",
"property": "bgpositionshorthand",
"tags": ["css"],
"notes": [{
"name": "MDN Docs",
"href": "https://developer.mozilla.org/en/CSS/background-position"
}, {
"name": "W3 Spec",
"href": "http://www.w3.org/TR/css3-background/#background-position"
}, {
"name": "Demo",
"href": "http://jsfiddle.net/Blink/bBXvt/"
}]
}
!*/
define(['Modernizr', 'createElement'], function( Modernizr, createElement ) {
Modernizr.addTest('bgpositionshorthand', function() {
var elem = createElement('a');
var eStyle = elem.style;
var val = 'right 10px bottom 10px';
eStyle.cssText = 'background-position: ' + val + ';';
return (eStyle.backgroundPosition === val);
});
});