0.2.2 • Published 3 years ago

postcss-simple-trig v0.2.2

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

PostCSS Simple Trig Build Status

Join the chat at https://gitter.im/Rplus/postcss-simple-trig

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

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

Usage

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

/* Input */
.foo {
  margin-left: sin(60deg);
}
/* Output with { precision: 2 } */
.foo {
  margin-left: 0.87;
}
0.2.2

3 years ago

0.2.1

4 years ago

0.2.0

5 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago