@curiousmedia/sass-numbers
v2.1.0
Published
Simple library to manipulate numbers and units.
Downloads
124
Keywords
Readme
SASS Numbers
Simple library to manipulate numbers and units.
Examples
Unitless
num-unitless(5px); //5
Round
num-round(1.5555, 1); //1.6
num-round(1.5555, 2, 'ceil'); //1.56
num-round(1.5555, 3, 'floor'); //1.555
Em
num-em(32); // 2em
num-em(32, 8); // 4em
Rem
num-rem(32); // 2em
num-rem(32, 8); // 4em
Vw
Recommended for scaling elements using VW units.
num-vw(32); // 5vw
num-vw(32, 1024) // 2.5vw
Credits
Unitless (formerly strip-unit) by Hugo Giraudel on http://www.css-tricks.com
Round (formerly decimal-round) by Takeru Suzuki on http://gist.github.com/terkel
Em by Chris Coyier on http://www.css-tricks.com