How to use the css-vendor.prefix function in css-vendor

To help you get started, we’ve selected a few css-vendor 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 ianobermiller / nuclearmail / src / js / Cesium.js View on Github external
},
  };
}

//
// Animations using keyframes
//
var animationIndex = 1;
var animationStyleSheet: any = document.createElement('style');
document.head.appendChild(animationStyleSheet);

// Test if prefix needed for keyframes (copied from PrefixFree)
var keyframesPrefixed = 'keyframes';
animationStyleSheet.textContent = '@keyframes {}';
if (!animationStyleSheet.sheet.cssRules.length) {
  keyframesPrefixed = cssVendor.prefix.css + 'keyframes';
}

// Simple animation helper that injects CSS into a style object containing the
// keyframes, and returns a string with the generated animation name.
function animation(keyframes: Object): string {
  var name = 'Animation' + animationIndex;
  animationIndex += 1;

  var rule = '@' + keyframesPrefixed + ' ' + name + ' {\n' +
    Object.keys(keyframes).map((percentage) => {
      var props = keyframes[percentage];
      var serializedProps = CSSPropertyOperations.createMarkupForStyles(
        _prefix(props)
      );
      return '  ' + percentage + ' {\n  ' + serializedProps + '\n  }';
    }).join('\n') +
github littlebits / react-popover / source / index.js View on Github external
const jsprefix = x => `${cssVendor.prefix.js}${x}`
github littlebits / react-popover / source / index.js View on Github external
const cssprefix = x => `${cssVendor.prefix.css}${x}`

css-vendor

CSS vendor prefix detection and property feature testing.

MIT
Latest version published 4 years ago

Package Health Score

74 / 100
Full package analysis