pixel-number

Cast numbers to CSS pixel strings

Usage no npm install needed!

<script type="module">
  import pixelNumber from 'https://cdn.skypack.dev/pixel-number';
</script>

README

pixel-number Build Status

Cast numbers to CSS pixel strings

Install

$ npm install --save pixel-number

Usage

var pixel = require('pixel-number')

pixel(10)
//=> 10px

pixel('10em')
//=> 10em

API

pixel(input) -> string

input

Required
Type: number

A number to be transformed into a pixel string. Strings are returned unchanged.

License

MIT © Ben Drucker