1.2.0 • Published 6 years ago

css-shorthand-expand v1.2.0

Weekly downloads
6,226
License
MIT
Repository
github
Last release
6 years ago

css-shorthand-expand

Build Status

Expand CSS shorthand properties to their longhand equivalent.

npm install css-shorthand-expand

Usage

The module exposes a single function which takes a property name and a value and returns a map with the expanded properties.

var expand = require('css-shorthand-expand');

expand('background', 'url(image.png) no-repeat #ff0');

The above returns an object.

{
	'background-image': 'url(image.png)',
	'background-repeat': 'no-repeat',
	'background-color': '#ff0'
}

Currently the following properties are supported.

  • background
  • font
  • padding
  • margin
  • border
  • border-width
  • border-style
  • border-color
  • border-top
  • border-right
  • border-bottom
  • border-left
  • border-radius
  • outline