# postcss-property-lookup

> PostCSS plugin that allows referencing property values without a variable

Latest version **3.0.0** (published 2021-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-property-lookup
pnpm add postcss-property-lookup
yarn add postcss-property-lookup
bun add postcss-property-lookup
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-05-19 |
| First published | 2015-05-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 10 |
| Dependencies | 1 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 64 |
| Author | Simon Smith |
| Maintainers | jedmao, simonsmith |
| Keywords | postcss, css, postcss-plugin, property-lookup |

## Links

- npm: https://www.npmjs.com/package/postcss-property-lookup
- Repository: https://github.com/simonsmith/postcss-property-lookup
- Homepage: https://github.com/simonsmith/postcss-property-lookup#readme
- Issues: https://github.com/simonsmith/postcss-property-lookup/issues
- npm.io page: https://npm.io/package/postcss-property-lookup

## Dependencies (1)

- [tcomb](https://npm.io/package/tcomb.md) ^3.2.21

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

- 3.0.0 (latest) — 2021-05-19
- 0.4.0 (postcss-4.x) — 2015-09-08
- 2.0.0 — 2017-07-06
- 1.2.1 — 2016-01-02
- 1.2.0 — 2016-01-01
- 1.1.4 — 2015-10-24
- 1.1.3 — 2015-10-18
- 1.1.2 — 2015-09-15
- 1.1.1 — 2015-09-08
- 1.1.0 — 2015-09-06
- 1.0.0 — 2015-09-05
- 0.3.0 — 2015-09-05
- 0.2.2 — 2015-07-04
- 0.2.1 — 2015-05-28
- 0.2.0 — 2015-05-28
- … 1 more at https://npm.io/package/postcss-property-lookup/versions

## README

# postcss-property-lookup [![Build Status][ci-img]][ci]

[PostCSS] plugin that allows referencing property values without a variable, [similar to Stylus](https://learnboost.github.io/stylus/docs/variables.html#property-lookup).

[PostCSS]: https://github.com/postcss/postcss
[ci-img]:  https://api.travis-ci.org/simonsmith/postcss-property-lookup.svg?branch=master
[ci]:      https://travis-ci.org/simonsmith/postcss-property-lookup


```css
.Test {
  margin-left: 20px;
  margin-right: @margin-left;
  color: red;
  background: @color url('test.png');
  line-height: 1.5;
  font-size: @(line-height)em;
}
```

```css
.Test {
  margin-left: 20px;
  margin-right: 20px;
  color: red;
  background: red url('test.png');
  line-height: 1.5;
  font-size: 1.5em;
}
```

Check the [test fixtures](test/fixtures/in) for more examples.

## Usage

```js
postcss([ require('postcss-property-lookup') ])
```

See [PostCSS] docs for examples for your environment.

## Installation

```
$ yarn add postcss-property-lookup
```

## Usage

### JavaScript

```js
postcss([
  require('postcss-property-lookup')(/* options */),
  // more plugins...
])
```

### TypeScript

```ts
///<reference path="node_modules/postcss-property-lookup/.d.ts" />
import postcssPropertyLookup from 'postcss-property-lookup';

postcss([
  postcssPropertyLookup(/* options */),
  // more plugins...
])
```

## Options

### logLevel

Type: `string: <error|warn>`<br>
Required: `false`<br>
Default: `warn`

When a lookup cannot be resolved, this specifies whether to throw an error or log a warning. In the case of a warning, the invalid lookup value will be replaced with an empty string.

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