How to use the modernizr._prefixes function in modernizr

To help you get started, we’ve selected a few modernizr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jplusplus / the-accountant / src / modernizr.js View on Github external
function addTest() {
    // Try using window.CSS.supports
    if ('CSS' in $window && 'supports' in $window.CSS) {
      for (let i = 0; i < Modernizr._prefixes.length; i++) {
        prop = `${Modernizr._prefixes[i]}clip-path`;
        if ($window.CSS.supports(prop, value)) {
          return true;
        }
      }
      return false;
    }
    const properties = Modernizr._prefixes.join(`clip-path: ${value};`);
    // Otherwise, use Modernizr.testStyles and examine the property manually
    return Modernizr.testStyles(`#modernizr { ${properties} }`, elem => {
      const style = getComputedStyle(elem);
      let clip = style.clipPath;

      if (!clip || clip === "none") {
        clip = false;

        for (let i = 0; i < Modernizr._domPrefixes.length; i++) {
github jplusplus / the-accountant / src / modernizr.js View on Github external
function addTest() {
    // Try using window.CSS.supports
    if ('CSS' in $window && 'supports' in $window.CSS) {
      for (let i = 0; i < Modernizr._prefixes.length; i++) {
        prop = `${Modernizr._prefixes[i]}clip-path`;
        if ($window.CSS.supports(prop, value)) {
          return true;
        }
      }
      return false;
    }
    const properties = Modernizr._prefixes.join(`clip-path: ${value};`);
    // Otherwise, use Modernizr.testStyles and examine the property manually
    return Modernizr.testStyles(`#modernizr { ${properties} }`, elem => {
      const style = getComputedStyle(elem);
      let clip = style.clipPath;

      if (!clip || clip === "none") {
        clip = false;