# Sass — card for AI agents

CSS preprocessor adding variables, nesting and mixins to stylesheets.

Category: Styling and CSS · npm package `sass` · latest version 1.107.1 (checked 2026-11-01)
Install: `npm install sass`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## Sass
- Add it to a project with `npm install --save-dev sass`.
- Write new code against the modern API (`compile()`, `compileString()`). Do not use the legacy `render()`/`renderSync()` API; the README says it will be removed in Dart Sass 2.0.0.
- When speed matters, use `compile()` rather than `compileAsync()` in the `sass` package. This is a performance trade-off: the site says the synchronous functions are more than twice as fast.
- If you need more speed with the same JavaScript API, consider `sass-embedded`. The site says the Sass team maintains it and that it runs on the Dart VM.
- In the browser, `compile()` and `compileAsync()` are unavailable. Use `compileString()` or `compileStringAsync()` with a custom importer to load other files, and disable renaming in the bundler (such as esbuild `--keep-names`).
- Under Jest, install `jest-environment-node-single-context` and add `testEnvironment: 'jest-environment-node-single-context'` to the Jest config.
- On upgrades, read the changelog. The README says breaking language changes can arrive in minor versions after deprecation warnings.

## What it is
- The `sass` package on npm is Dart Sass. The GitHub repository describes Dart Sass as "The reference implementation of Sass, written in Dart." The README says it is "available, compiled to JavaScript" as an npm package. The GitHub repository was created on 2016-10-31 and lists its license as MIT. The latest release listed on GitHub is 1.108.2, published 2026-11-11.
- Dart Sass has a single version number shared across its Dart, JavaScript and stand-alone distributions. The README warns that a major version bump may therefore carry no breaking changes for some of them. The same npm package runs in Node.js, through `compile()` and `compileAsync()`, and directly in the browser, through `compileString()`. Outside npm, Dart Sass also ships as a stand-alone executable on the Dart VM, as a Dart library on pub, and as the compiler side of the Embedded Sass protocol.
- The Sass website calls Dart Sass "the primary implementation of Sass". Its list of current releases shows Dart Sass 1.108.2, with a ⚰ next to the names LibSass and Ruby Sass. The site also lists a second npm package, `sass-embedded`. It says the Sass team maintains that package and that it supports the same official JavaScript API as the pure-JS `sass` package.

## Caveats
- The async API is the slow path: The site says that in the `sass` package the synchronous API functions are more than twice as fast as the asynchronous ones. It blames the overhead of asynchronous callbacks. The README's own example also notes that `compileAsync()` is "substantially slower" than `compile()`.
- Pure JS is slower than the executable: The Sass website says the pure-JS npm package is slower than the stand-alone executable.
- Legacy render() API is deprecated: The README says the Node Sass-compatible `render()`/`renderSync()` API is deprecated and will be removed in Dart Sass 2.0.0. Dart Sass does not support its `precision` or `sourceComments` options. It supports only the `"expanded"` and `"compressed"` output styles.
- Jest needs a different test environment: The README says Jest has a "longstanding bug" where its default test environment breaks `instanceof`, which the Sass JS package uses heavily. Its fix is to install `jest-environment-node-single-context` and set it as `testEnvironment`.
- No filesystem in the browser: In the browser, `compile()`, `compileAsync()` and the legacy API are not available. To load other files, the README says to pass a custom importer to `compileString()` or `compileStringAsync()`.

## Numbers (AgentGid data)
- Gid Score: 71.3 (#331 of all tools, 5 of 53 in its category)
- Used in 109 public projects set up for AI coding agents (1.7%)
- Downloads last week: 44,799,965 (as of 2026-11-24), +42.2% over 4 weeks
- GitHub stars: 4,238 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
Vite 50.5%, ESLint 68.8%, TypeScript 71.6%, Tailwind CSS 54.1%, Testing Library 30.3%, Vue 22.0%

## Checked alternatives (same job)
- Tailwind CSS: https://agentgid.com/tools/tailwindcss/agent.md
- Lightning CSS: https://agentgid.com/tools/lightningcss/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/sass/
- Homepage: https://github.com/sass/dart-sass
- Repository: https://github.com/sass/dart-sass
- Source: https://github.com/sass/dart-sass#readme
- Source: https://github.com/sass/dart-sass
- Source: https://github.com/sass/dart-sass/releases
- Source: https://sass-lang.com/dart-sass

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
