How to use the postcss.vendor.prefix function in postcss

To help you get started, we’ve selected a few postcss 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 stylelint / stylelint / src / rules / selector-pseudo-class-no-unknown / index.js View on Github external
selectorTree.walkPseudos(pseudoNode => {
          const { value } = pseudoNode

          if (!isStandardSyntaxSelector(value)) { return }

          // Ignore pseudo-elements
          if (value.slice(0, 2) === "::") { return }

          if (optionsMatches(options, "ignorePseudoClasses", pseudoNode.value.slice(1))) { return }

          const name = value.slice(1)

          if (
            vendor.prefix(name)
            || pseudoClasses.has(name.toLowerCase())
            || pseudoElements.has(name.toLowerCase())
          ) { return }

          report({
            message: messages.rejected(value),
            node: rule,
            index: pseudoNode.sourceIndex,
            ruleName,
            result,
          })
        })
      })
github johandb / svg-drawing-tool / node_modules / autoprefixer / lib / prefixer.js View on Github external
_proto.parentPrefix = function parentPrefix(node) {
    var prefix;

    if (typeof node._autoprefixerPrefix !== 'undefined') {
      prefix = node._autoprefixerPrefix;
    } else if (node.type === 'decl' && node.prop[0] === '-') {
      prefix = vendor.prefix(node.prop);
    } else if (node.type === 'root') {
      prefix = false;
    } else if (node.type === 'rule' && node.selector.indexOf(':-') !== -1 && /:(-\w+-)/.test(node.selector)) {
      prefix = node.selector.match(/:(-\w+-)/)[1];
    } else if (node.type === 'atrule' && node.name[0] === '-') {
      prefix = vendor.prefix(node.name);
    } else {
      prefix = this.parentPrefix(node.parent);
    }

    if (Browsers.prefixes().indexOf(prefix) === -1) {
      prefix = false;
    }

    node._autoprefixerPrefix = prefix;
    return node._autoprefixerPrefix;
github GoogleContainerTools / kpt / node_modules / autoprefixer / lib / prefixer.js View on Github external
_proto.parentPrefix = function parentPrefix(node) {
    var prefix;

    if (typeof node._autoprefixerPrefix !== 'undefined') {
      prefix = node._autoprefixerPrefix;
    } else if (node.type === 'decl' && node.prop[0] === '-') {
      prefix = vendor.prefix(node.prop);
    } else if (node.type === 'root') {
      prefix = false;
    } else if (node.type === 'rule' && node.selector.includes(':-') && /:(-\w+-)/.test(node.selector)) {
      prefix = node.selector.match(/:(-\w+-)/)[1];
    } else if (node.type === 'atrule' && node.name[0] === '-') {
      prefix = vendor.prefix(node.name);
    } else {
      prefix = this.parentPrefix(node.parent);
    }

    if (!Browsers.prefixes().includes(prefix)) {
      prefix = false;
    }

    node._autoprefixerPrefix = prefix;
    return node._autoprefixerPrefix;
github postcss / autoprefixer / lib / prefixer.js View on Github external
parentPrefix (node) {
    let prefix

    if (typeof node._autoprefixerPrefix !== 'undefined') {
      prefix = node._autoprefixerPrefix
    } else if (node.type === 'decl' && node.prop[0] === '-') {
      prefix = vendor.prefix(node.prop)
    } else if (node.type === 'root') {
      prefix = false
    } else if (
      node.type === 'rule' &&
      node.selector.includes(':-') &&
      /:(-\w+-)/.test(node.selector)
    ) {
      prefix = node.selector.match(/:(-\w+-)/)[1]
    } else if (node.type === 'atrule' && node.name[0] === '-') {
      prefix = vendor.prefix(node.name)
    } else {
      prefix = this.parentPrefix(node.parent)
    }

    if (!Browsers.prefixes().includes(prefix)) {
      prefix = false
github webhintio / hint / packages / hint-compat-api / src / css.ts View on Github external
const unprefixedReports = reports.filter(({ node }) => {
            switch (node.type) {
                case 'atrule':
                    return !vendor.prefix(node.name);
                case 'decl':
                    return !vendor.prefix(node.prop) && !vendor.prefix(node.value);
                default:
                    return false;
            }
        });
github makuga01 / dnsFookup / FE / node_modules / autoprefixer / lib / transition.js View on Github external
_proto.cleanFromUnprefixed = function cleanFromUnprefixed(params, prefix) {
    var _this4 = this;

    var remove = params.map(function (i) {
      return _this4.findProp(i);
    }).filter(function (i) {
      return i.slice(0, prefix.length) === prefix;
    }).map(function (i) {
      return _this4.prefixes.unprefixed(i);
    });
    var result = [];

    for (var _iterator10 = _createForOfIteratorHelperLoose(params), _step10; !(_step10 = _iterator10()).done;) {
      var param = _step10.value;
      var prop = this.findProp(param);
      var p = vendor.prefix(prop);

      if (!remove.includes(prop) && (p === prefix || p === '')) {
        result.push(param);
      }
    }

    return result;
  }
  /**
github sindresorhus / sublime-autoprefixer / node_modules / autoprefixer / lib / transition.js View on Github external
for (var _iterator10 = params, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) {
      var _ref9;

      if (_isArray10) {
        if (_i10 >= _iterator10.length) break;
        _ref9 = _iterator10[_i10++];
      } else {
        _i10 = _iterator10.next();
        if (_i10.done) break;
        _ref9 = _i10.value;
      }

      var param = _ref9;
      var prop = this.findProp(param);
      var p = vendor.prefix(prop);

      if (!remove.includes(prop) && (p === prefix || p === '')) {
        result.push(param);
      }
    }

    return result;
  }
  /**
github GoogleContainerTools / kpt / site / node_modules / autoprefixer / lib / transition.js View on Github external
for (var _iterator10 = params, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) {
      var _ref9;

      if (_isArray10) {
        if (_i10 >= _iterator10.length) break;
        _ref9 = _iterator10[_i10++];
      } else {
        _i10 = _iterator10.next();
        if (_i10.done) break;
        _ref9 = _i10.value;
      }

      var param = _ref9;
      var prop = this.findProp(param);
      var p = vendor.prefix(prop);

      if (!remove.includes(prop) && (p === prefix || p === '')) {
        result.push(param);
      }
    }

    return result;
  }
  /**
github daviddbarrero / Ionic-4-firebase / node_modules / autoprefixer / lib / value.js View on Github external
var _loop = function _loop(prefix) {
            var value = decl._autoprefixerValues[prefix];

            if (value === decl.value) {
                return 'continue';
            }

            var item = void 0;
            var propPrefix = vendor.prefix(prop);

            if (propPrefix === '-pie-') {
                return 'continue';
            }

            if (propPrefix === prefix) {
                item = decl.value = value;
                result.push(item);
                return 'continue';
            }

            var prefixed = prefixes.prefixed(prop, prefix);
            var rule = decl.parent;

            if (!rule.every(function (i) {
                return i.prop !== prefixed;