0.3.0 • Published 7 years ago

vcalc v0.3.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

vcalc is an Sass function for calculate unit from px to vw or vmin.

Install

$ npm install --save-dev vcalc
@import 'vcalc';

Set variable $base-v-size as you want, default sets 375 (iPhone6).

$base-v-size: 320;

Useage

NameArg1Arg2
vmin-calc$values: px based value$base: base viewport size
vw-calc$values: px based value$base: base viewport size
// $base-v-size: 375;
{
  font-size: vmin-calc(16px);
}

Will be 4.26667vmin, which means

Screen width4.26667vmin In px
414px18px
375px16px
320px14px

Also can pass multiple values

{
  margin: vmin-calc(10px 20px 30px 40px);
}
0.3.0

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago