What is Sass, how do its SCSS and indented syntaxes differ, and what does the browser actually receive from a .scss file?
answer
- a language compiled before the browser
- two syntaxes, one feature set
- braces versus indentation
- only plain CSS ships
- Dart Sass: sass or sass-embedded
basics
~20 sSass is a stylesheet language compiled to plain CSS at build time by Dart Sass. SCSS (.scss) is nearly a superset of CSS; the indented syntax (.sass) swaps braces and semicolons for indentation. The browser only receives the compiled CSS.
solid answer
~40 sSass adds variables, nesting, mixins, functions, `@extend`, control flow such as `@each` and `@if`, and a module system (`@use`, `@forward`) on top of CSS. None of it runs in the browser: the compiler substitutes every variable, expands every mixin, flattens nested rules and drops placeholder selectors, so the output is an ordinary `.css` file. Both syntaxes have the same features: **SCSS** (`.scss`), where essentially all valid CSS is valid SCSS, and the original **indented syntax** (`.sass`), which uses indentation instead of braces and semicolons; each can load the other. The maintained implementation is Dart Sass, on npm as `sass` (compiled to pure JavaScript) and `sass-embedded` (a wrapper around the native Dart compiler, released at the same version and generally faster on large stylesheets). LibSass and `node-sass` are end-of-life.
code
scss · 17 lines// history-site/main.scss
@use "campus-ui/tokens";
$card-gap: 1.5rem;
@mixin elevated {
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.event-card {
padding: $card-gap;
@include elevated;
&__title {
color: tokens.$brand-navy;
}
}go deeper
Say plainly that Sass is compiled ahead of time and only CSS ships. Name the two syntaxes by file extension and one feature Sass adds, such as variables or mixins.
Explain what the compiler does to each feature: variables substituted, mixins expanded, nesting flattened, placeholders dropped, and unknown functions passed through as plain CSS.
Show you know the toolchain: Dart Sass is the only maintained implementation, sass versus sass-embedded is a build-speed choice, and a LibSass-era project needs a migration, not a version bump.
Treat Sass as a build-time dependency with its own deprecation policy, and weigh what it still adds over modern CSS against keeping a preprocessor in every pipeline.
## What Sass is **Sass** is a stylesheet language layered on top of CSS. You write `.scss` (or `.sass`) files, a **compiler** turns them into ordinary `.css` during the build, and the browser only ever sees that output. In a normal build nothing about Sass runs at page load: there is no Sass runtime, no interpretation in the browser and no Sass-specific syntax left in the delivered file. What Sass adds is a set of authoring features, every one of them resolved at compile time: - **Variables** (`$brand-navy: #1d3a5f;`) whose values are substituted wherever they are referenced. - **Nesting**, including the parent selector `&`, which the compiler flattens into ordinary selectors: `&__title` written inside `.event-card` becomes `.event-card__title`. - **Mixins** (`@mixin` / `@include`) that paste reusable declarations and rules where they are included. - **Functions** (`@function` / `@return`) and built-in modules such as `sass:math` and `sass:color` that compute values. - **`@extend` and placeholder selectors** (`%name`) that let one selector share another's rules. - **Control flow** (`@if`, `@each`, `@for`, `@while`) for generating rules from data. - A **module system** (`@use` and `@forward`) for splitting code across files behind namespaces. ## What the compiler does with each feature | Feature in the source | What reaches the CSS output | |---|---| | `$variable` | Its value, substituted at each use | | Nested rule with `&` | A flat selector such as `.event-card__title` | | `@include` of a mixin | The mixin's declarations and rules, copied in | | Call to a Sass function | The computed value | | `%placeholder` | Nothing on its own; only the selectors that extend it | | `@each` / `@if` | Whatever rules the loop or branch generated | | A function Sass does not know | The call, passed through unchanged as plain CSS | The last row matters in practice. Any call that is neither a user-defined nor a built-in Sass function is compiled as a plain CSS function with its arguments compiled as-is, so new CSS functions work without waiting for a Sass release. The same design means a misspelt helper name is not a compile error: it is copied into the CSS. ## SCSS and the indented syntax Sass has **two syntaxes with the same features**: 1. **SCSS** (`.scss`) uses braces and semicolons. With a few small exceptions it is a superset of CSS, so essentially any valid CSS file is already valid SCSS. It is the most popular syntax and the one most teams mean when they say "Sass". 2. **The indented syntax** (`.sass`) is the original one. Indentation replaces braces, and a line end counts as a statement end. It has a few extra shorthands, such as `=` to define a mixin and `+` to include one, but no feature SCSS lacks. Each syntax can load the other, so a project can mix them, although most codebases standardise on one. Files whose names start with an underscore (`_tokens.scss`) are **partials**: they exist to be loaded by other stylesheets, and Sass tools do not compile them on their own. Only entry points produce `.css` files. ## Which compiler: Dart Sass The maintained implementation is **Dart Sass**. It ships as a standalone executable, through Homebrew and Chocolatey, and on npm as two packages that are always released at the same version: - **`sass`** is Dart Sass compiled to pure JavaScript. It runs anywhere Node.js runs (it can even run in a browser), and provides the `sass` command and a JavaScript API (`compile`, `compileAsync`, `compileString`). - **`sass-embedded`** is a JavaScript wrapper that drives the native Dart Sass compiler over the embedded protocol. It supports the same JavaScript API and language features and is generally much faster on substantial stylesheets, which is the usual reason to choose it. Two older names are history, and a candidate should recognise them as such: - **LibSass**, the C++ implementation, was deprecated in October 2020 and declared end-of-life on 2025-10-22. It never gained the module system. - **`node-sass`**, the Node.js wrapper around LibSass, was declared end-of-life in July 2024; its npm package is marked deprecated and its repository archived. A project still on it needs a migration to Dart Sass, followed by a check for output differences. ## A typical compile From the command line the one-to-one form is `sass <input.scss> <output.css>`; build tools call the same compiler through its JavaScript API. Either way the result is a CSS file, optionally with a source map that points browser devtools back to the `.scss` lines. ## Misconceptions worth correcting - "The browser reads `.scss`." It never does; only compiled CSS ships. - "The indented syntax is a cut-down Sass." It has the same features as SCSS. - "Any Sass compiler will do." Only Dart Sass is maintained; LibSass-based tools and Ruby Sass are end-of-life. - "Unknown functions are compile errors." They pass through as plain CSS calls. - "Placeholders and mixins appear in the output." They are consumed by the compiler.
- What happens when an .scss file calls a CSS function that Sass itself does not define?Sass passes it through. Any call that is neither a user-defined nor a built-in Sass function is compiled as a plain CSS function, with its arguments compiled and included as-is, so new CSS functions keep working without a Sass release. The flip side is that a misspelt helper name is also copied into the CSS instead of failing the build.
- Why would a team choose `sass-embedded` over `sass` from npm?Both are Dart Sass at the same version with the same language features and JavaScript API. `sass` is Dart Sass compiled to pure JavaScript, so it runs anywhere Node.js runs. `sass-embedded` drives the native Dart compiler over the embedded protocol and is generally much faster on substantial stylesheets, which is the reason to switch for a large codebase or a slow build.
- Where do LibSass and node-sass fit today?They are history. LibSass, the C++ implementation, was deprecated in October 2020 and declared end-of-life on 2025-10-22, and it never supported the module system. `node-sass`, its Node.js wrapper, was declared end-of-life in July 2024 and its npm package is deprecated. Dart Sass replaces both.
- The browser downloads the .scss file and a Sass runtime interprets it.
- The indented .sass syntax lacks features that SCSS has.
- node-sass is still the standard way to compile Sass in a Node project.
- Plain CSS must be rewritten before it can be saved as .scss.
- Mixins and placeholder selectors appear in the output CSS as written.