# postcss-simple-trig

> A PostCSS plugin to calculate trigonometric functions sin/cos/tan

Latest version **0.2.2** (published 2021-10-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-simple-trig
pnpm add postcss-simple-trig
yarn add postcss-simple-trig
bun add postcss-simple-trig
```

## 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.2 |
| Published | 2021-10-02 |
| First published | 2017-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Rplus |
| Maintainers | rplus.tw |
| Keywords | postcss, css, postcss-plugin, trigonometric, sin, cos, tan |

## Links

- npm: https://www.npmjs.com/package/postcss-simple-trig
- Repository: https://github.com/Rplus/postcss-simple-trig
- Issues: https://github.com/Rplus/postcss-simple-trig/issues
- npm.io page: https://npm.io/package/postcss-simple-trig

## Dependencies (1)

- [postcss](https://npm.io/package/postcss.md) ^6.0.23

## 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.2.2 (latest) — 2021-10-02
- 0.2.1 — 2020-07-21
- 0.2.0 — 2020-04-22
- 0.1.4 — 2017-08-13
- 0.1.3 — 2017-08-13
- 0.1.2 — 2017-08-13
- 0.1.1 — 2017-08-13
- 0.1.0 — 2017-08-13
- 0.0.1 — 2017-08-13

## README

# PostCSS Simple Trig [![Build Status][ci-img]][ci]

[![Join the chat at https://gitter.im/Rplus/postcss-simple-trig](https://badges.gitter.im/Rplus/postcss-simple-trig.svg)](https://gitter.im/Rplus/postcss-simple-trig?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[PostCSS] plugin to calculate trigonometric functions: `sin`/`cos`/`tan`.

[PostCSS]: https://github.com/postcss/postcss
[ci-img]:  https://travis-ci.org/Rplus/postcss-simple-trig.svg
[ci]:      https://travis-ci.org/Rplus/postcss-simple-trig

```css
/* Input */
.foo {
  boo: sin(60deg);
  padding: calc(cos(60deg) * 1em);
}
```

```css
/* Output */
.foo {
  boo: 0.86603;
  padding: calc(0.5 * 1em);
}
```

## Usage

```js
postcss([ require('postcss-simple-trig') ]);
postcss([ require('postcss-simple-trig')({ precision: 2 }) ]);
```

See [PostCSS] docs for examples for your environment.

## Options

### precision
* type: `Integer`
* default: `5`
* allow: `0` ~ `20`

Used to determine how many digits after the decimal will be allowed.  
ref: [number.toFixed @ MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)

```css
/* Input */
.foo {
  margin-left: sin(60deg);
}
```

```css
/* Output with { precision: 2 } */
.foo {
  margin-left: 0.87;
}
```

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