/**
 *  class CssoCompressor
 *
 *  Engine for CSS minification. You will need `csso` Node module installed:
 *
 *      npm install csso
 *
 *
 *  ##### SUBCLASS OF
 *
 *  [[Template]]
 **/


'use strict';


// 3rd-party
var csso; // initialized later


// internal
var Template = require('../template');
var prop     = require('../common').prop;


////////////////////////////////////////////////////////////////////////////////


// Class constructor
var CssoCompressor = module.exports = function CssoCompressor() {
  Template.apply(this, arguments);
  csso = csso || Template.libs.csso || require('csso');
};


require('util').inherits(CssoCompressor, Template);


// Compress data
CssoCompressor.prototype.evaluate = function (/*context, locals*/) {
  this.data = csso.justDoIt(this.data);
};


// Expose default MimeType of an engine
prop(CssoCompressor, 'defaultMimeType', 'text/css');

@@ -754,19 +754,105 @@
 %7B%0A  
-this.data =
+// CSSO 2.+ renamed .justDoIt() -%3E .minify()%0A  this.data = csso.minify ? csso.minify(this.data) :
  css

Fix CSSO 2.+ compatibility, close #229