# postcss-icss-keyframes

> PostCSS plugin for css-modules to local-scope keyframes

Latest version **0.2.1** (published 2017-06-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-icss-keyframes
pnpm add postcss-icss-keyframes
yarn add postcss-icss-keyframes
bun add postcss-icss-keyframes
```

## 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.2.1 |
| Published | 2017-06-14 |
| First published | 2017-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Bogdan Chadkin |
| Maintainers | geelen, trysound |

## Links

- npm: https://www.npmjs.com/package/postcss-icss-keyframes
- Repository: https://github.com/css-modules/postcss-icss-keyframes
- Homepage: https://github.com/css-modules/postcss-icss-keyframes#readme
- Issues: https://github.com/css-modules/postcss-icss-keyframes/issues
- npm.io page: https://npm.io/package/postcss-icss-keyframes

## Dependencies (3)

- [postcss](https://npm.io/package/postcss.md) ^6.0.2
- [icss-utils](https://npm.io/package/icss-utils.md) ^3.0.1
- [postcss-value-parser](https://npm.io/package/postcss-value-parser.md) ^3.3.0

## Recent versions

- 0.2.1 (latest) — 2017-06-14
- 0.2.0 — 2017-06-07
- 0.1.1 — 2017-05-31
- 0.1.0 — 2017-05-31

## README

# postcss-icss-keyframes [![Build Status][travis-img]][travis]

[PostCSS]: https://github.com/postcss/postcss
[travis-img]: https://travis-ci.org/css-modules/postcss-icss-keyframes.svg
[travis]: https://travis-ci.org/css-modules/postcss-icss-keyframes

PostCSS plugin for css-modules to local-scope keyframes.

```css
@keyframes foo {
  from { width: 10px; }
  to { width: 100px; }
}

/* transforms to */

:export {
  foo: __scope__foo
}
@keyframes __scope__foo {
  from { width: 10px; }
  to { width: 100px; }
}
```

## Usage

```js
postcss([ require('postcss-icss-keyframes')(options) ])
```

See [PostCSS] docs for examples for your environment.

### Options

#### generateScopeName(keyframesName, filepath, css)

Converts every new animation name in `@keyframes` defintion to global alias.
By default returns `__filename__keyframesName`.

### Importing animation name from another file

Via [postcss-modules-values](https://github.com/css-modules/postcss-modules-values)

```
/* imported.css */
@keyframes foo {}

/* importer.css */
@value foo from './imported.css';
.bar {
  animation-name: foo;
}
```

### Using globally defined keyframes

Animation names are not replaced if css module does not contain `@keyframes` or `@value` defintions with the same name.

```
.foo {
  animation-name: fade-in;
}
```

### Messages

postcss-icss-keyframes passes result.messages for each defined keyframes

```
{
  plugin: 'postcss-icss-keyframes',
  type: 'icss-scoped',
  name: string, // local name
  value: string // scoped name
}
```

# License

MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru)

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