# seed-props

> Props mixin pack for Seed

Latest version **0.3.1** (published 2017-05-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install seed-props
pnpm add seed-props
yarn add seed-props
bun add seed-props
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2017-05-26 |
| First published | 2016-07-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | itsjonq |
| Keywords | bem, callback, content, css, design, functional, itcss, modular, oocss, performance, props, seed, seed-pack, scss |

## Links

- npm: https://www.npmjs.com/package/seed-props
- Repository: https://github.com/helpscout/seed-props
- Issues: https://github.com/helpscout/seed-props/issues
- npm.io page: https://npm.io/package/seed-props

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.3.1 (latest) — 2017-05-26
- 0.3.0 — 2016-07-14
- 0.1.0 — 2016-07-13
- 0.0.3 — 2016-07-08
- 0.0.2 — 2016-07-07
- 0.0.1 — 2016-07-07

## README

# seed-props [![npm version](https://badge.fury.io/js/seed-props.svg)](https://badge.fury.io/js/seed-props)
Props mixin pack for [Seed](https://github.com/helpscout/seed)!

## Install
```
npm install seed-props --save
```


## Documentation

Check out our **[documentation of this pack](http://developer.helpscout.net/seed/packs/seed-props/)**.


## Basic Usage

### SCSS
This seed pack needs to be imported into your sass pipeline. Below is an example using Gulp:


```javascript
var gulp = require('gulp');
var sass = require('gulp-sass');
var pack = require('seed-props');

gulp.task('sass', function () {
  return gulp.src('./sass/**/*.scss')
    .pipe(sass({
      includePaths: pack
    }))
    .pipe(gulp.dest('./css'));
});
```

Once that is setup, simply `@import` *seed-props* as needed in your `.scss` file:

```sass
// Packs
@import "pack/seed-props/_index";
```

## Usage

### prop-map
The `prop-map` mixin allows you to loop through a map and use arguments as variables in your styles (`@content`).
You have to use the `prop` function for your `@content` to utilize the argument defined in your `prop-map`.

#### Simple
```sass
// Input (scss)
$grid-columns: (
  1: 10%,
  2: 20%
);

.col- {
  @include prop-map($grid-columns, (width)) {
    width: prop(width);
  }
}

// Output (css)
.col-1 {
  width: 10%; }

.col-2 {
  width: 20%; }
```

#### Slightly trickier (aka. Awesome)
Yo dawg. I heard you like using maps within maps. `prop-map` will be able to handle that!

```sass
// Input (scss)
$btn-states: (
  success: (
    background: green,
    border-color: green),
  danger: (
    background: red,
    border-color: red)
);

.btn {
  @include prop-map($btn-states, (background, border-color)) {
    background: prop(background);
    border-color: prop(border-color);
  }
}

// Output (css)
.btn-success {
  background: green;
  border-color: green; }

.btn-danger {
  background: red;
  border-color: red; }
```

P.S. For maps within maps, the arguments are based on *name* (not the argument order).

---
_Source: https://npm.io/package/seed-props · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
