Sass
CSS preprocessor adding variables, nesting and mixins to stylesheets.
3. Used by agents' projects
Dependency in 109 public GitHub projects set up for AI coding agents that we scanned (1.7%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What Sass does
The <code>sass</code> npm package is Dart Sass compiled to pure JavaScript. The Sass site calls Dart Sass the primary implementation that gets new features first, and says this pure JS version is slower than the stand-alone executable.
Sass popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How Sass is used
- Sass is a dependency in 109 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (2.2% of the 4,867 JavaScript/TypeScript ones), #4 of 53 in styling and css.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 336; those are left out of every share on this page.
- The most used alternative in our scan is Tailwind CSS (2,040 projects).
- Projects that use it most often also use Vite (50.5%), ESLint (68.8%), TypeScript (71.6%).
By coding agent
Often used with
Sass in practice
Strengths
The Sass website says Dart Sass is the primary implementation. As a result, new features appear in it before any other implementation.
The site says the Embedded Sass protocol lets any language talk directly to the Dart VM. It claims this gives "a substantial performance boost even for JavaScript". The site's description of <code>sass-embedded</code>, the Node.js wrapper, says the Sass team maintains it and that it "supports the same official Sass JavaScript API" as the pure-JS <code>sass</code> package.
The README says the npm package can run in the browser. It works with major bundlers as long as renaming is disabled, for example with <code>--keep-names</code> in esbuild. The README also shows it loading as an ES module through an import map, from a CDN, or as a bundled build from jspm.
The site says the pure-JS package lets you define your own Sass functions and importers in JavaScript.
Watch out for
The site says that in the <code>sass</code> 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 <code>compileAsync()</code> is "substantially slower" than <code>compile()</code>.
The Sass website says the pure-JS npm package is slower than the stand-alone executable.
The README says the Node Sass-compatible <code>render()</code>/<code>renderSync()</code> API is deprecated and will be removed in Dart Sass 2.0.0. Dart Sass does not support its <code>precision</code> or <code>sourceComments</code> options. It supports only the <code>"expanded"</code> and <code>"compressed"</code> output styles.
Compile Sass in the browser with no bundler
<script type="module">
import * as sass from 'https://jspm.dev/sass';
console.log(sass.compileString(`
.box {
width: 10px + 15px;
}
`));
</script>More about Sass
Head to head
- Tailwind CSS vs Sass used together in 59 projects
Packages around it
- vite: Build tool and dev server
- eslint: JavaScript linter
- tailwindcss: Utility-first CSS framework
- @testing-library: UI testing utilities
- vue: UI framework
- prettier: Code formatter
Alternatives
Sass This page
Utility-first CSS framework for building custom user interfaces rapidly.
High-performance CSS parser and minifier written in Rust, with modern CSS feature support.
Get started
Install it.
npm install sassRules for your agent
## 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.