UNPKG

browsernizr

Version:

Modernizr wrapper for use with browserify

35 lines (32 loc) 1.03 kB
/*! { "name": "Background Position Shorthand", "property": "bgpositionshorthand", "tags": ["css"], "builderAliases": ["css_backgroundposition_shorthand"], "notes": [{ "name": "MDN Docs", "href": "https://developer.mozilla.org/en/CSS/background-position" }, { "name": "W3C Spec", "href": "https://www.w3.org/TR/css3-background/#background-position" }, { "name": "Demo", "href": "https://jsfiddle.net/Blink/bBXvt/" }] } !*/ /* DOC Detects if you can use the shorthand method to define multiple parts of an element's background-position simultaneously. eg `background-position: right 10px bottom 10px` */ var Modernizr = require('./../../lib/Modernizr.js'); var createElement = require('./../../lib/createElement.js'); 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); });