0.1.5 • Published 6 years ago
pasteque-unit v0.1.5
🍉 pasteque-unit
Sass function and mixin to use rem
w/ optional px
fallback.
pasteque-unit is a fork from compass/typography/units
Installation
$ npm install pasteque-unit
Usage
📖 Read the docs! Coming soon.
@charset "UTF-8";
@import "path/to/node_modules/pasteque-unit/unit";
// Length unit in which to output rhythm values.
$p-unit-global: "rem";
// Toggle optional `px` fallback.
$p-unit--rem-with-px: false;
@debug p-unit-convert(1em, $p-unit-global);
// /path/to/style.scss:11 DEBUG: 1rem
@debug _p-unit-px-rem(1px);
// /path/to/style.scss:14 DEBUG: ("px": 1px, "rem": 0.0625rem)
@debug p-unit-px-rem((2px, 3rem, 5.8rem));
// /path/to/style.scss:17 DEBUG: ("px": 2px, 48px, 93px, "rem": 0.125rem, 3rem, 5.8rem)
.foo {
@include p-unit-rem("property", 13px);
}
.foo {
@include p-unit-rem("property", (34px 5.5rem 8rem));
}
.foo {
@include p-unit-rem("property", 2.1rem, true);
}
.foo {
property: 0.8125rem;
}
.foo {
property: 2.125rem 5.5rem 8rem;
}
.foo {
property: 34px;
property: 2.1rem;
}