Socket
Socket
Sign inDemoInstall

@csstools/postcss-trigonometric-functions

Package Overview
Dependencies
Maintainers
0
Versions
20
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


Version published
Weekly downloads
3.5M
decreased by-1.28%
Maintainers
0
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 18 Aug 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