Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@csstools/postcss-trigonometric-functions

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@csstools/postcss-trigonometric-functions

Use sin(), cos(), tan(), acos(), atan(), and atan2() to compute trigonometric relationships

  • 4.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.9M
decreased by-17.86%
Maintainers
3
Weekly downloads
 
Created

What is @csstools/postcss-trigonometric-functions?

@csstools/postcss-trigonometric-functions is a PostCSS plugin that allows you to use trigonometric functions like sine, cosine, and tangent directly in your CSS. This can be particularly useful for creating complex animations, responsive designs, and other dynamic styles that require mathematical calculations.

What are @csstools/postcss-trigonometric-functions's main functionalities?

Sine Function

This feature allows you to use the sine function in your CSS. In this example, the sine of 45 degrees is calculated and used to translate an element along the X-axis.

body {
  --angle: 45deg;
  --sine-value: sin(var(--angle));
  transform: translateX(calc(100px * var(--sine-value)));
}

Cosine Function

This feature allows you to use the cosine function in your CSS. In this example, the cosine of 45 degrees is calculated and used to translate an element along the Y-axis.

body {
  --angle: 45deg;
  --cosine-value: cos(var(--angle));
  transform: translateY(calc(100px * var(--cosine-value)));
}

Tangent Function

This feature allows you to use the tangent function in your CSS. In this example, the tangent of 45 degrees is calculated and used to skew an element along the X-axis.

body {
  --angle: 45deg;
  --tangent-value: tan(var(--angle));
  transform: skewX(calc(10deg * var(--tangent-value)));
}

Other packages similar to @csstools/postcss-trigonometric-functions

Keywords

FAQs

Package last updated on 11 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc