math.sin($number) returns the sine of $number. Pass an angle whose units are compatible with deg, or a unitless number treated as radians. The result is a unitless ratio (typically between -1 and 1). Load it with @use "sass:math" on Dart Sass 1.25+.
Unitless input = radians; prefer explicit deg when needed.
Compile-time — CSS gets a fixed number.
Dart Sass 1.25+ via @use "sass:math".
One line: when an angle must become a fixed sine ratio in CSS, call math.sin($number).
Practice
Compile Notes
Practical checklist:
checklist.txt
1. @use "sass:math"
2. Pass deg-compatible angle or unitless radians
3. Expect a unitless ratio (about -1…1)
4. Multiply by a length when you need CSS offsets
5. Use CSS sin() for runtime angles
Frequently Asked Questions
math.sin($number) returns the sine of an angle. Example: math.sin(100deg) is about 0.984807753; math.sin(1rad) and math.sin(1) are about 0.8414709848.
Add @use "sass:math"; then call math.sin($number). Requires Dart Sass 1.25+.
An angle compatible with deg (such as deg, rad, turn, grad), or a unitless number. Unitless values are treated as radians.
No. Sine is a unitless ratio (typically between -1 and 1). Multiply by a length if you need a CSS length, for example $r * math.sin(30deg).
Sass math.sin() runs at compile time and writes a fixed number. CSS sin() stays in the stylesheet and can use runtime values like custom properties in supporting browsers.
Official docs expose this as math.sin() on sass:math. Prefer the module form with @use "sass:math".