API Reference

Sass

The reference implementation of Sass, compiling SCSS to CSS with a Dart-based CLI and a JavaScript API.

Official Documentation ↗
CompatibilityThis documentation covers version v1.77. Check the official docs for the latest API surface.

Installation

npmnpm install sass

Methods

Dart Sass provides variables, nesting, mixins, and modules, and is the recommended Sass implementation.

Key Features

  • SCSS and indented syntax support
  • Modules with @use and @forward
  • Synchronous and async JavaScript compile APIs

Usage Notes

Pin a version and check the official docs for the API surface you depend on before upgrading.

Security notes

Quoted verbatim from the official documentation; this is not a complete threat model. 来源:https://sass-lang.com/documentation/js-api/ · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:52:24.052Z.

FAQ

Should I use @import or @use?
Use @use. The @import rule is deprecated because it causes duplicated output and unclear namespaces; @use gives each module its own scope.
Is Dart Sass the right implementation?
Yes. LibSass and Ruby Sass are deprecated. Dart Sass is the reference implementation and the only one receiving new features.
How do I watch files?
Use sass --watch input.scss output.css, or call your own watcher and rerun compile on change for more control.