1.2.1 • Published 8 years ago

resin v1.2.1

Weekly downloads
13
License
Apache-2.0
Repository
github
Last release
8 years ago

Resin

Build Status Code Climate Test Coverage Issue Count npm version

A CSS preprocessor.

Installation

npm install resin

Usage

var resin = require('resin');

resin({
  // Pass it a css file to process
  src: 'src/entry.css',
  // Tell it what browsers to prefix for
  browsers: ['last 1 version', 'ios', 'android 4'],
  // Add a namespace to your classes to avoid collisions
  namespace: 'dam',
  // Use the varibles plugin
  vars: true,
  // Use the inherit plugin
  extend: true,
  // Generate sourecemaps for debugging
  debug: true
});
// returns a promise.

This function will return an evaluated string that you can write to a file, or stream etc.

Example writing to a file:

var resin = require('resin'),
  write = require('fs').writeFileSync,
  output;

resin({
  // Pass it a css file to process
  src: 'src/entry.css',
  // Tell it what browsers to prefix for
  browsers: ['last 1 version', 'ios', 'android 4']
  // Add a namespace to your classes to avoid collisions
  namespace: 'dam'
}).then(function(result){
  write('path/to/output/dir/filename.css', result.css);
});

Entry CSS file

@import "node-package-name";
@import "other-node-package-name";

Resin will pull in CSS source files distributed via npm packages and add them to the AST. Uses postcss-import under the covers.

Features

Resin supports:

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago