modernizr
Version:
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
41 lines (39 loc) • 1.39 kB
JavaScript
define(['ModernizrProto', 'testProps'], function(ModernizrProto, testProps) {
/**
* testProp() investigates whether a given style property is recognized
* Property names can be provided in either camelCase or kebab-case.
*
* @memberof Modernizr
* @name Modernizr.testProp
* @access public
* @optionName Modernizr.testProp()
* @optionProp testProp
* @function testProp
* @param {string} prop - Name of the CSS property to check
* @param {string} [value] - Name of the CSS value to check
* @param {boolean} [useValue] - Whether or not to check the value if @supports isn't supported
* @returns {boolean}
* @example
*
* Just like [testAllProps](#modernizr-testallprops), only it does not check any vendor prefixed
* version of the string.
*
* Note that the property name must be provided in camelCase (e.g. boxSizing not box-sizing)
*
* ```js
* Modernizr.testProp('pointerEvents') // true
* ```
*
* You can also provide a value as an optional second argument to check if a
* specific value is supported
*
* ```js
* Modernizr.testProp('pointerEvents', 'none') // true
* Modernizr.testProp('pointerEvents', 'penguin') // false
* ```
*/
var testProp = ModernizrProto.testProp = function(prop, value, useValue) {
return testProps([prop], undefined, value, useValue);
};
return testProp;
});