Skip to content

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

License

Notifications You must be signed in to change notification settings

frankmarineau/shrthnd.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d740432 · Jun 4, 2020

History

21 Commits
Jan 20, 2016
May 16, 2020
Aug 9, 2014
Aug 9, 2014
Aug 12, 2014
Aug 11, 2014
Jun 4, 2020

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published