Esempio n. 1
0
export default function(stylesheets, options) {
  let css = '';

  foreach(stylesheets, (stylesheet, name) => {
    let cssOptions = Object.assign({}, options);
    cssOptions.prefixes = [options.filename, name];

    css += transformSpecificationIntoCSS(stylesheet, cssOptions);

    if (css.length) {
      css += '\n';
    }
  });

  if (css.length === 0) {
    return null;
  }

  const vp = options.vendorPrefixes;

  if (vp) {
    if (typeof vp === 'object') {
      css = autoprefixer(vp).process(css).css;
    } else {
      css = autoprefixer.process(css).css;
    }
  }

  if (options.minify) {
    css = new CleanCSS().minify(css).styles;
  }

  return css;
}
Esempio n. 2
0
function minifyCss(source) {
	var ret = '';
	ret = autoprefixer.process(source, opts.autoprefixer).css;
	ret = new CleanCSS(opts.cleanCss).minify(ret).styles;

	return ret;
}
Esempio n. 3
0
 value: function(keyframe) {
     if (!keyframe) throw new Error('.kf expects a keyframe object');
     var name = keyframe.name;
     delete keyframe.name;
     if (!name) {
         name = 'keyframe-' + _kfs.length;
     }
     var _keyframeStr = '@' + _prefix.dashed + 'keyframes ' + name + '  {';
     for (var _keyframeProp in keyframe) {
         var _keyframeValue = keyframe[_keyframeProp];
         if (!Number.isNaN(_keyframeProp) && _keyframeProp >= 0 && _keyframeProp <= 100){
             _keyframeProp += '%';
         }
         if (typeof _keyframeProp !== 'string') throw new Error('object key must be a string or number (0-100)');
         _keyframeStr += _keyframeProp;
   var _css = ' { ';
         for (var _prop2 in _keyframeValue) {
             _css += _prop2 + ':' + _keyframeValue[_prop2] + '; ';
         }
         _css += ' }';
   _keyframeStr += autoprefixer.process(_css).css;
     }
     _keyframeStr += '}';
     _sheet.insertRule(_keyframeStr, _sheet.cssRules.length);
     _kfs.push(name);
     return this;
 }
Esempio n. 4
0
 style.on('end', function(err, css){
   if (opts) { return ap(opts).process(css).css; }
   return ap.process(css).css;
 });
Esempio n. 5
0
 css: function(css, req) {
   return autoprefixer.process(css).css;
 }
/// <reference path="autoprefixer-core.d.ts" />
var autoprefixer = require("autoprefixer-core");
var css;
var prefixed = autoprefixer.process(css).css;
var processor = autoprefixer({ browsers: ['> 1%', 'IE 7'], cascade: false });
console.log(processor.info());
Esempio n. 7
0
 before(function () {
     if (!browser.msie || browser.version >= 10) {
         Vue.config.debug = true;
     }
     insertCss(autoprefixer.process('* {transition: none !important;}').css);
 });
Esempio n. 8
0
 }, function (err, result) {
   p.done(autoprefixer.process(result.css).css);
 });