Skip to content
A future facing CSS preprocessor made with rework
CSS JavaScript
Latest commit 4bba514 Aug 27, 2014 @kristoferjoseph kristoferjoseph 0.5.0
Failed to load latest commit information.
test Updating debug output file for updated sourcemap Aug 27, 2014
.gitignore Adding test infrastructure and initial test. Nov 6, 2013
.travis.yml Adding url function for managing asset paths Feb 3, 2014
LICENSE Adding license Nov 8, 2013
README.md
entry.css
index.js Add support for plugins and raw source Jun 16, 2014
package.json 0.5.0 Aug 27, 2014

README.md

Resin

Build Status

A future facing CSS preprocessor made with Rework.

Installation

npm install topcoat-resin

Usage

var resin = require('topcoat-resin');

    resin({
        // Pass it a css file to process
        src: 'src/entry.css',
        // Alternatively pass it the file contents, defaults to src
        contents: 'body { color: rgba(#fff, 0.5); }',
        // 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',
        // Add a license to the final output
        license: '// Copyright 2013 and stuff \n',
        // Generate sourecemaps for debugging
        debug: true,
        // Extend resin further with more rework plugins
        use: [rework.ease()]
    });

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('topcoat-resin'),
    write = require('fs').writeFileSync,
    output;

    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'
    });

    write('path/to/output/dir/filename.css', output);

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 rework-npm under the covers.

Features

Resin supports:

TODO

Something went wrong with that request. Please try again.