Skip to content
forked from topcoat/resin

Opinionated CSS preprocessor for Topcoat made with rework

License

Notifications You must be signed in to change notification settings

SlexAxton/resin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Resin

Build Status

Opinionated CSS preprocessor for Topcoat 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',
        // 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
    });

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

About

Opinionated CSS preprocessor for Topcoat made with rework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 76.1%
  • CSS 23.9%