JSPM

add-px-to-style

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 325347
  • Score
    100M100P100Q183011F
  • License MIT

Will add px to the end of style values which are Numbers

Package Exports

  • add-px-to-style

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (add-px-to-style) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.