How to use the autoprefixer.data function in autoprefixer

To help you get started, we’ve selected a few autoprefixer 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 / utils / isAutoprefixable.js View on Github external
property(identifier) {
    return autoprefixer.data.prefixes[prefixes.unprefixed(identifier.toLowerCase())]
  },
github sasstools / sass-lint / lib / helpers-autoprefixer.js View on Github external
'use strict';

const autoprefixer = require('autoprefixer');
const Browsers = require('autoprefixer/lib/browsers');
const Prefixes = require('autoprefixer/lib/prefixes');

const prefixes = new Prefixes(
  autoprefixer.data.prefixes,
  new Browsers(autoprefixer.data.browsers, [])
);

module.exports = {

  /**
   * Check an at rule name against autoprefixer's list
   *
   * @param {string} identifier The at rule name as a string
   * @returns {object} The matching at rule object from autoprefixer
   */
  atRuleName (identifier) {
    return prefixes.remove[`@${identifier.toLowerCase()}`];
  },

  /**
github stylelint / stylelint / lib / utils / isAutoprefixable.js View on Github external
const autoprefixer = require('autoprefixer');
const Browsers = require('autoprefixer/lib/browsers');
const Prefixes = require('autoprefixer/lib/prefixes');

/**
 * Use Autoprefixer's secret powers to determine whether or
 * not a certain CSS identifier contains a vendor prefix that
 * Autoprefixer, given the standardized identifier, could add itself.
 *
 * Used by `*-no-vendor-prefix-*` rules to find superfluous
 * vendor prefixes.
 */

const prefixes = new Prefixes(
	autoprefixer.data.prefixes,
	new Browsers(autoprefixer.data.browsers, []),
);

/**
 * Most identifier types have to be looked up in a unique way,
 * so we're exposing special functions for each.
 */
module.exports = {
	/**
	 * @param {string} identifier
	 * @returns {boolean}
	 */
	atRuleName(identifier) {
		return !!prefixes.remove[`@${identifier.toLowerCase()}`];
	},
github stylelint / stylelint / lib / utils / isAutoprefixable.js View on Github external
const autoprefixer = require('autoprefixer');
const Browsers = require('autoprefixer/lib/browsers');
const Prefixes = require('autoprefixer/lib/prefixes');

/**
 * Use Autoprefixer's secret powers to determine whether or
 * not a certain CSS identifier contains a vendor prefix that
 * Autoprefixer, given the standardized identifier, could add itself.
 *
 * Used by `*-no-vendor-prefix-*` rules to find superfluous
 * vendor prefixes.
 */

const prefixes = new Prefixes(
	autoprefixer.data.prefixes,
	new Browsers(autoprefixer.data.browsers, []),
);

/**
 * Most identifier types have to be looked up in a unique way,
 * so we're exposing special functions for each.
 */
module.exports = {
	/**
	 * @param {string} identifier
	 * @returns {boolean}
	 */
	atRuleName(identifier) {
		return !!prefixes.remove[`@${identifier.toLowerCase()}`];
	},

	/**
github sasstools / sass-lint / lib / helpers-autoprefixer.js View on Github external
'use strict';

const autoprefixer = require('autoprefixer');
const Browsers = require('autoprefixer/lib/browsers');
const Prefixes = require('autoprefixer/lib/prefixes');

const prefixes = new Prefixes(
  autoprefixer.data.prefixes,
  new Browsers(autoprefixer.data.browsers, [])
);

module.exports = {

  /**
   * Check an at rule name against autoprefixer's list
   *
   * @param {string} identifier The at rule name as a string
   * @returns {object} The matching at rule object from autoprefixer
   */
  atRuleName (identifier) {
    return prefixes.remove[`@${identifier.toLowerCase()}`];
  },

  /**
   * Check a selector name against autoprefixer's list