# lerp-css-string

> interpolate values in a css string

Latest version **1.0.1** (published 2014-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install lerp-css-string
pnpm add lerp-css-string
yarn add lerp-css-string
bun add lerp-css-string
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2014-12-08 |
| First published | 2014-12-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Matt DesLauriers |
| Maintainers | mattdesl |
| Keywords | lerp, css, string, parse, px, unit, em, %, interpolate, tween, animate, style, styling |

## Links

- npm: https://www.npmjs.com/package/lerp-css-string
- Repository: https://github.com/mattdesl/lerp-css-string
- Issues: https://github.com/mattdesl/lerp-css-string/issues
- npm.io page: https://npm.io/package/lerp-css-string

## Dependencies (2)

- [lerp](https://npm.io/package/lerp.md) ^1.0.0
- [parse-unit](https://npm.io/package/parse-unit.md) ^1.0.1

## 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

- 1.0.1 (latest) — 2014-12-08
- 1.0.0 — 2014-12-07

## README

# lerp-css-string

[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Interpolates the values between two CSS strings, returning a new string.

```js
var lerp = require('lerp-css-string')

lerp('10px', '0px', 0.5)                     // -> '5px'
lerp('100%', '50%', 0.5)                     // -> '75%'
lerp('100px 25%', '50px 20%', 0.5)           // -> '75px 22.5%'
lerp('360, 50%, 25%', '200, 100%, 50%', 0.5) // -> '280 75% 37.5%'
```

## Usage

[![NPM](https://nodei.co/npm/lerp-css-string.png)](https://nodei.co/npm/lerp-css-string/)

#### `lerp(str1, str2, alpha)`

Lerps between `str1` and `str2` based on the given `alpha` (typically 0.0 to 1.0), returning a new string with interpolated values and their units. Numbers and units are expected to be tightly packed (e.g. `50px`).

## License

MIT, see [LICENSE.md](http://github.com/mattdesl/lerp-css-string/blob/master/LICENSE.md) for details.

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