0.1.5 • Published 6 years ago

pasteque-unit v0.1.5

Weekly downloads
25
License
CC-BY-4.0
Repository
-
Last release
6 years ago

🍉 pasteque-unit

npm

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;
}

Author

Zaza Agency

Contributors

Aziz Da


CC-BY-4.0

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago