1.0.3 • Published 9 years ago

smallector v1.0.3

Weekly downloads
3
License
GPL
Repository
github
Last release
9 years ago

Smallector Build Status

Smallector is a Nodejs module designed to shorten css class names. This is useful for shrinking css files and reducing the overall size of your site.

Usage

Smallector provides the Smallector class which can be used as fallows:

var Smallector = require( 'smallector' ),
    s = new Smallector( '.red-text { color: red; }', { compress: true } );
console.log( s.compiled ); // Will output `.a{color:red;}`

There are two ways to shorten classes: 1. Compleate replacment. 2. Segment replacment.

The example above uses compleate replacement, let's have a look at segment replacment:

var Smallector = require( 'smallector' ),
    s = new Smallector( '.red-text { color: red; }', { compress: true, split: true} );
console.log( s.compiled ); // Will output `.a-b{color:red;}`

As you can see segment replacment splits the classes at the hyphen and replaces each segment seperatly. This is usefull for very large projects which have a lot of repeated segments. But for most projects it is best to leave this off.

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago