UNPKG

browsernizr

Version:

Modernizr wrapper for use with browserify

38 lines (35 loc) 1.33 kB
var ModernizrProto = require('./ModernizrProto.js'); var prefixed = require('./prefixed.js'); var domToCSS = require('./domToCSS.js'); /** * prefixedCSS is just like [prefixed](#modernizr-prefixed), but the returned values are in * kebab-case (e.g. `box-sizing`) rather than camelCase (boxSizing). * * @memberOf Modernizr * @name Modernizr.prefixedCSS * @optionName Modernizr.prefixedCSS() * @optionProp prefixedCSS * @access public * @function prefixedCSS * @param {string} prop - String name of the property to test for * @returns {string|false} The string representing the (possibly prefixed) * valid version of the property, or `false` when it is unsupported. * @example * * `Modernizr.prefixedCSS` is like `Modernizr.prefixed`, but returns the result * in hyphenated form * * ```js * Modernizr.prefixedCSS('transition') // '-moz-transition' in old Firefox * ``` * * Since it is only useful for CSS style properties, it can only be tested against * an HTMLElement. * * Properties can be passed as both the DOM style camelCase or CSS style kebab-case. */ var prefixedCSS = ModernizrProto.prefixedCSS = function(prop) { var prefixedProp = prefixed(prop); return prefixedProp && domToCSS(prefixedProp); }; module.exports = prefixedCSS;