mint-sass

2.1.3 • Public • Published

mint-sass

Sweet unit library

Legend
Unit Functions
$mint-base
mint()
mint-compress()
mint-strip()

Unit Functions

Shorthands for units based off mint() that assume a base equal to $mint-base

  • px(values, unit, [scale])
  • em(values, unit, [scale])
  • rem(values, unit, [scale])
  • un(values, unit, [scale])

$mint-base

Base font size (16 by default)

mint(values, base, scale, unit)

Converts and scales values

  • values (List) List of values for mint to process
  • base (Number) Base font size
  • scale (Number) Relative font size or scale
  • unit (String) Unit for each number
// in
.foo {
  margin: mint(8 4 8 4, 16, 16, em);
}

// out
.foo {
  margin: 0.5em 0.25em;
}

mint-compress(values)

Compress values to their shortest form

// in
.foo {
  margin: mint-compress(8px 4px 8px 4px);
}

// out
.foo {
  margin: 8px 4px;
}

mint-strip(value)

Strip a unit from a number

// in
.foo {
  line-height: mint-strip(16px);
}

// out
.foo {
  line-height: 16;
}

Package Sidebar

Install

npm i mint-sass

Weekly Downloads

1

Version

2.1.3

License

MIT

Last publish

Collaborators

  • dustin-archive