add-px-to-style

1.0.0 • Public • Published

add-px-to-style

experimental

Will add px to the end of style values which are Numbers. The following style properties will not have px added.

  • animationIterationCount
  • boxFlex
  • boxFlexGroup
  • boxOrdinalGroup
  • columnCount
  • fillOpacity
  • flex
  • flexGrow
  • flexPositive
  • flexShrink
  • flexNegative
  • flexOrder
  • gridRow
  • gridColumn
  • fontWeight
  • lineClamp
  • lineHeight
  • opacity
  • order
  • orphans
  • stopOpacity
  • strokeDashoffset
  • strokeOpacity
  • strokeWidth
  • tabSize
  • widows
  • zIndex
  • zoom

Usage

var addPxToStyle = require('add-px-to-style');

addPxToStyle('top', 22); // '22px'
addPxToStyle('zIndex', 3); // 3

NPM

License

MIT, see LICENSE.md for details.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    267,951
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    267,951

Package Sidebar

Install

npm i add-px-to-style

Weekly Downloads

267,951

Version

1.0.0

License

MIT

Last publish

Collaborators

  • mikkoh