css-shorthand-expand

1.2.0 • Public • Published

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

Package Sidebar

Install

npm i css-shorthand-expand

Weekly Downloads

10,545

Version

1.2.0

License

MIT

Unpacked Size

14.6 kB

Total Files

14

Last publish

Collaborators

  • kapetan