Namespace: stylus

stylus

Methods

<static> write(src, dst, options, callback)

Compile the stylus file, and save it to a file.
Parameters:
Name Type Description
src String Stylus target file(formt: stylus)
dst String CSS file to be saved
options Object stylus options
callback function
Source:
Example
beezlib.css.stylus.write('./test.styl', './test.css', {
  options: {
    compress: true,
    firebug: false,
    linenos: false,
    nib: true,
    fn : function (styl) {
      styl.define('body-padding', function (data) {
        var rate  = data.val || 1;
        var base = 10;
        return (rate * base) + 'px';
      });
    }
  },
  {
    extend: {
      "condition": {
        "ua": [ "android", "ios" ]
      },
      "content": {
        "options": {
          "fn": {
            "STAT_URL": "http://stat.example.com"
          }
        }
      }
    }
  }
}, function (err, css) {
  if (err) {
    throw err;
  }
  console.log(css)
});