Skip to content

Commit

Permalink
Added installation, usage and example to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmarineau committed Aug 12, 2014
1 parent 01e99ad commit e280682
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,22 @@ shrthnd.js
==========

Makes your CSS files lighter and more readable by converting and combining properties into their shorthand versions when possible.

## Installation

npm install shrthnd

## Usage

The module takes a CSS string as only parameter and returns an object containing two properties:

* **string**: The shorthanded CSS string
* **longPropertiesPositions**: An array containing the position (row & column in input string) of the properties that have been shorthanded

## Example

var cssString = 'body { background-image: url(/img/meow.jpg); background-position: top center; }';

var shrthnd = require('shrthnd');
var shorthandedCss = shrthnd(cssString);
console.log(shorthandedCss.string);

0 comments on commit e280682

Please sign in to comment.