Releases: github.com/sass/dart-sass/releases
Sass is the name of the CSS pre-processor language. It comes in two syntaxes:
| Feature | Sass (Indented) | SCSS (Sassy CSS) |
|---|---|---|
| File extension | .sass |
.scss |
| Look & feel | Like Python — uses indentation (tabs/spaces) | Like CSS — uses braces {} and semicolons ; |
| CSS compatibility | Cannot paste plain CSS into it | Superset of CSS — all valid CSS is valid SCSS |
| Popularity | Older, "classic" style | Standard / modern choice |
Use SCSS. Because SCSS is a superset of CSS, you can take any .css file, rename it to .scss, and it works immediately — zero changes required.
Dart Sass ships as a standalone bundle. The compiler lives at:
dart-sass\src\dart.exe ← the Dart runtime
dart-sass\src\sass.snapshot ← the compiled Sass program
Navigate to the src folder first:
cd /d "D:\%username%\Downloads\dart-sass-1.99.0-windows-x64\dart-sass\src"Note:
dart.exe sass.snapshot,dart.exe sass, and the wrappersassare not equivalent — they differ in how and whether the Dart VM is invoked. See § 4 for the full breakdown.
All commands below use dart.exe sass.snapshot (equivalent to dart sass — see § 4).
dart.exe sass.snapshot --style=compressed scss:distdart.exe sass.snapshot --watch scss:distdart.exe sass.snapshot --no-source-map --style=compressed scss:distdart.exe sass.snapshot --style=compressed "C:\Users\YourName\Desktop\MyProject\scss":"C:\Users\YourName\Desktop\MyProject\dist"dart.exe sass.snapshot --style=compressed .:.dart.exe sass.snapshot .:.dart.exe sass.snapshot --no-source-map .:.dart.exe sass.snapshot --no-source-map "inputdir":"outputdir"dart.exe sass.snapshot --style=compressed "$f" "${f%.scss}.min.css"dart.exe sass.snapshot --style=compressed "main.scss" "main.min.css"dart sass.snapshot --style=expanded --no-source-map .:.These are not all equivalent. Understanding the difference requires knowing how the Dart Sass bundle is structured.
The standalone Dart Sass download ships with exactly three files:
dart-sass\
sass ← wrapper script (sass.bat on Windows / sass shell script on Unix)
src\
dart.exe ← the Dart VM (runtime)
sass.snapshot ← the compiled Sass program (kernel/JIT snapshot)
The Dart VM supports two distinct snapshot formats:
| Type | Extension (convention) | Run with | Description |
|---|---|---|---|
| Kernel / JIT snapshot | .snapshot |
dart.exe |
Compiled to Dart's intermediate bytecode; JIT-compiled at runtime by the full VM |
| AOT snapshot | .aot or none |
dartaotruntime |
Fully compiled to native machine code ahead of time; smaller, faster startup, but not portable |
sass.snapshot is a kernel/JIT snapshot — it requires the full dart.exe VM to run. If you mistakenly try to run it with dartaotruntime, you get the error:
sass is not an AOT snapshot, it cannot be run with 'dartaotruntime'
:: ✅ Explicit and correct — runs the JIT snapshot directly via the Dart VM
dart.exe sass.snapshot --style=compressed .:.
:: ⚠️ Works, but only if the Dart VM happens to resolve 'sass' as 'sass.snapshot'
:: This is NOT guaranteed across all environments
dart.exe sass --style=compressed .:.
:: ✅ Recommended — the wrapper script handles everything for you
sass --style=compressed .:.The wrapper script (sass.bat on Windows, sass on Unix) is the right tool to use from the command line. It internally calls dart.exe sass.snapshot with the correct paths — so you get the full Dart VM speed without having to manage paths yourself.
- Use
dart.exe sass.snapshotwhen you are inside thesrc\directory and want to invoke the compiler directly (e.g. in scripts where you can't rely on PATH). - Use
sass(the wrapper) for everyday command-line use — it's simpler and more portable. - Never use
dartaotruntimewithsass.snapshot— it is not an AOT snapshot.
| Flag | Description |
|---|---|
--style=compressed |
Minified output — removes all whitespace |
--style=expanded |
Human-readable output (default) |
--watch |
Watch input files and recompile on change |
--no-source-map |
Skip generating .css.map files |
input:output |
Map an input file or directory to an output file or directory |
input:output
- Directory → directory:
scss:distor.:.or"C:\...\scss":"C:\...\dist" - File → file:
"main.scss":"main.min.css"or"main.scss" "main.min.css"(space also works)
Quotes are required whenever the path contains spaces.
$primary-color: #3498db
$accent-color: #e74c3c
$bg-color: #f4f4f4
@mixin flex-center
display: flex
justify-content: center
align-items: center@use 'colors';
body {
background-color: colors.$bg-color;
font-family: sans-serif;
}
.container {
@include colors.flex-center;
height: 100vh;
.card {
background: white;
padding: 2rem;
border-top: 5px solid colors.$primary-color;
h1 {
color: colors.$accent-color;
}
}
}