- px
- cm
- mm
- Q
- in
- pc
- pt
- rem
- em
- vw
- vh
- vmin
- vmax
- percent
- magnification
The basic usage is as follows:
import { Unit, convertUnits } from '@karibash/pixel-units';
const pixel: Unit<'px'> = '32px';
const rem = convertUnits(pixel, 'rem');
console.log(rem);
// -> 2rem
$ npm install @karibash/pixel-units
Contributions, issues and feature requests are welcome.
Feel free to check issues page if you want to contribute.
Copyright © 2020 @Karibash.
This project is MIT
licensed.