UNPKG

px2rem2px

Version:

Convert pixel (px) to rem and rem to pixel (px)

36 lines (23 loc) 1 kB
# Pixel to REM and REM to Pixel (px2rem2px) ## Overview NPM package that simply converts pixel to REM and/or pixel to REM. [![Build Status](https://dev.azure.com/dv-github-repos/px2rem2px/_apis/build/status/deanilvincent.px2rem2px?branchName=main)](https://dev.azure.com/dv-github-repos/px2rem2px/_build/latest?definitionId=11&branchName=main) ## Installation ``` npm i px2rem2px --save ``` ## Setup and basic usage ``` const { pxToRem, remToPx } = require('px2rem2px') // OR import { pxToRem, remToPx } from 'px2rem2px' console.log(pxToRem(3)) // 0.188rem console.log(remToPx(3.33)) // 53.28px ``` ### Contribute Feel free to clone or fork this project: `https://github.com/deanilvincent/px2rem2px.git` ### License This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/deanilvincent/px2rem2px/blob/main/LICENSE) file for details. Feel free to clone or fork this project: `https://github.com/deanilvincent/px2rem2px.git`