postcss-position

1.1.0 • Public • Published

PostCSS Position

NPM version Downloads Build Status

PostCSS plugin that adds shorthand attributes to position declarations.

Part of Rucksack - CSS Superpowers

Input

.foo {
  position: absolute 10px 0;
}
 
.bar {
  position: fixed 0;
}
 
.baz {
  position: relative 30% auto 0;
}
 
.fab {
  position: absolute 10px 0 20px 30px;
}

Output

.foo {
  position: absolute;
  top: 10px;
  right: 0;
  bottom: 10px;
  left: 0;
}
 
.bar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
 
.baz {
  position: relative;
  top: 30%;
  right: auto;
  bottom: 0;
  left: auto;
}
 
.fab {
  position: absolute;
  top: 10px;
  right: 0;
  bottom: 20px;
  left: 30px;
}

Usage

postcss([ require('postcss-position') ])

See PostCSS docs for examples for your environment.


MIT © Sean King

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    4,460
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    4,460
  • 1.0.0
    249
  • 0.5.0
    465
  • 0.4.0
    1,022
  • 0.3.1
    0
  • 0.3.0
    0

Package Sidebar

Install

npm i postcss-position

Weekly Downloads

6,197

Version

1.1.0

License

MIT

Unpacked Size

9.38 kB

Total Files

6

Last publish

Collaborators

  • seaneking