TH The Sass Way
Sass & SCSS

What Is Sass? SCSS Explained for CSS Developers

What Is Sass? SCSS Explained for CSS Developers
tldrSass (Syntactically Awesome Style Sheets) is a CSS preprocessor: you write stylesheets in a more powerful language with variables, nesting, mixins, math, and file splitting, then a compiler turns it into plain CSS the browser reads. SCSS is its most popular, CSS-like syntax, and Dart Sass is the official compiler you run as a build step.

What Sass Actually Is

Sass is a CSS preprocessor: a tool that lets you write stylesheets in a more powerful language, then compiles them down to plain CSS the browser can read. You get features CSS historically lacked — variables, nesting, reusable chunks of styles, math, loops, and file splitting — and a compiler turns all of it into a regular .css file. The browser never sees your Sass. It only ever sees the compiled CSS output.

The name stands for Syntactically Awesome Style Sheets. When people say "Sass" in casual conversation they usually mean the whole tool and language. When they say SCSS, they mean the specific, CSS-like syntax most projects actually write (more on that distinction below). Sass has been around since 2006 and is the most widely used CSS preprocessor by a wide margin — it ships baked into countless design systems, component libraries, and framework build tools.

Here is the core idea in one comparison. This SCSS:

@use 'sass:color';

$brand: #2d6cdf;

.button {
  background: $brand;

  &:hover {
    background: color.adjust($brand, $lightness: -10%);
  }
}

compiles to this CSS:

.button {
  background: #2d6cdf;
}
.button:hover {
  background: #1d55bc;
}

You wrote the color once and nested the hover state inside the button. The compiler expanded it into the flat, repetitive CSS the browser expects. Note the color.adjust() call from the built-in sass:color module — it shifts the color's lightness down by 10 points. You may still see the older darken($brand, 10%) in tutorials, but that legacy color function is being phased out of Dart Sass (it emits deprecation warnings and is slated for removal in Dart Sass 2.0), so reach for color.adjust() or color.scale() in new code.

Sass vs SCSS: The Two Syntaxes

This trips up almost everyone new to Sass. "Sass" refers to two things at once: the overall tool, and one of its two syntaxes.

SCSS syntax (.scss) Indented syntax (.sass)
Looks like Regular CSS, with extras Terse, no braces or semicolons
Braces { } Yes No — uses indentation
Semicolons Yes No — uses line breaks
Superset of CSS Yes — any valid CSS is valid SCSS No
Popularity Dominant, used almost everywhere Rare

Here is the same rule in both. SCSS:

.card {
  padding: 1rem;
  color: #333;
}

Indented .sass:

.card
  padding: 1rem
  color: #333

Use SCSS. It's a superset of CSS, which means you can rename any .css file to .scss and it just works, then adopt Sass features gradually. That single fact is why the industry standardized on it. The rest of this guide, and virtually every tutorial you'll read, uses SCSS syntax. We break the differences down further in Sass vs SCSS.

Why Developers Use Sass

Plain CSS has improved a lot, but Sass still solves real maintenance problems on medium and large stylesheets. Here's what you actually get.

Variables

Define a value once, reuse it everywhere. Change your brand color or spacing scale in one place instead of hunting through thousands of lines.

$space: 8px;
$radius: 6px;

.panel {
  padding: $space * 2;
  border-radius: $radius;
}

Nesting

Write selectors inside their parent to mirror your HTML structure. The & refers to the parent selector, which is perfect for states and modifiers.

.nav {
  display: flex;

  a {
    color: inherit;

    &.is-active {
      font-weight: 700;
    }
  }
}

A word of caution: deep nesting is the most common Sass mistake. Every level you nest adds specificity and length to the compiled selector. Keep it to two or three levels.

Mixins and functions

A mixin is a reusable block of declarations you pull in with @include. A function computes and returns a single value with @return. Mixins output styles; functions output values.

@mixin flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  @include flex-center;
}

Mixins can take arguments too, which makes them ideal for things like consistent media queries or button variants. We cover the split in depth in Sass mixins vs functions.

Partials and file splitting

Break your stylesheet into small files (called partials, named with a leading underscore like _buttons.scss) and pull them together. Modern Sass uses @use for this:

// main.scss
@use 'reset';
@use 'buttons';
@use 'layout';

Everything compiles into a single CSS file, so splitting your source costs you nothing at runtime. Note that @use is the current standard — the older @import rule is deprecated and being removed from the language, so don't reach for it in new code.

Math, loops, and logic

Sass can do arithmetic and generate repetitive CSS programmatically:

@use 'sass:math';

@for $i from 1 through 4 {
  .col-#{$i} {
    width: math.div($i, 4) * 100%;
  }
}

That loop generates four column classes. Note the @use 'sass:math' and math.div() — Sass moved math into a proper module, and math.div() is now the correct way to divide (the old / operator for division is deprecated).

How Sass Actually Runs: The Build Step

The catch is that browsers don't understand Sass. Between writing .scss and the browser rendering it, a compiler has to run. This is the single biggest conceptual difference from writing plain CSS.

The standard flow:

  1. You write styles in .scss files.
  2. Dart Sass — the official, actively maintained implementation — compiles them to a .css file.
  3. You link the compiled .css in your HTML.

You'd typically run something like sass input.scss output.css --watch, and the --watch flag recompiles automatically every time you save. Most real projects wire this into a build tool (Vite, webpack, or a framework's tooling) so it happens invisibly on save.

A note on implementations, because you'll see old advice: Dart Sass is the only supported version today. The older Ruby Sass and the C-based LibSass are both officially deprecated and no longer get new features. If you're installing Sass in 2026, you're installing Dart Sass. Our installation guide walks through the npm and CLI setup step by step.

Sass Variables vs CSS Custom Properties

A fair question in 2026: CSS now has native variables (custom properties), so why use Sass variables? They're genuinely different tools.

Sass variables ($x) CSS custom properties (--x)
Resolved At compile time At runtime, in the browser
Live in the browser No — gone after compiling Yes — inspectable and changeable
Can change with JS or media queries No Yes
Cascade / inheritance No Yes
Good for Build-time logic, math, loops Theming, dark mode, runtime values

The short version: Sass variables are for build-time convenience; CSS custom properties are for runtime flexibility. They coexist happily, and many modern codebases use both — Sass to generate the CSS, custom properties for the values that need to change live. Learn the native side in our CSS variables guide.

Do You Still Need Sass?

Honest answer: less often than you used to, but it's far from obsolete. Plain CSS has absorbed several of Sass's headline features. Native CSS nesting now works in every current browser, and custom properties cover a lot of what Sass variables did. If you're building something small, modern CSS may be all you need.

Where Sass still clearly pulls its weight:

If you want the honest, feature-by-feature breakdown of what modern CSS replaced, we wrote a whole comparison on native CSS nesting vs Sass.

Getting Started in Three Steps

The fastest path from zero to compiled CSS:

  1. Install Dart Sass — via npm (npm install -D sass) or a standalone install. Details in how to install Sass.
  2. Write a .scss file — start by renaming an existing .css file; it already works as valid SCSS.
  3. Compile with --watch — run the CLI so every save regenerates your CSS automatically.

From there, adopt features one at a time: variables first, then nesting, then partials with @use, then mixins. You don't have to learn all of Sass at once, and you shouldn't try to.

The Bottom Line

Sass is a preprocessor that gives your stylesheets variables, nesting, reusable mixins, math, and a real module system, then compiles it all to ordinary CSS. SCSS is the CSS-like syntax you'll write in practice, and Dart Sass is the compiler you'll run. Modern CSS has closed part of the gap, but for organizing large stylesheets, generating CSS programmatically, and working in the countless codebases already built on it, Sass remains a core front-end skill. When you're ready to go deeper, the complete guide to Sass takes you from setup all the way to scalable, production-grade stylesheets.

FAQ

What is the difference between Sass and SCSS?

They're the same tool with two syntaxes. SCSS uses braces and semicolons and is a superset of CSS, so any valid CSS is valid SCSS. The original indented syntax (.sass) drops braces and semicolons in favor of indentation. SCSS is dominant today because you can rename a .css file to .scss and it just works, then adopt Sass features gradually.

Is Sass still worth learning in 2026?

Yes, though less essential than before. Native CSS now has nesting and custom properties, covering some of Sass's old advantages. But Sass still wins for loops, maps, mixins with arguments, and its @use module system, and nearly every mature design system and large codebase is written in it. Knowing Sass remains a practical requirement on most front-end teams.

Do browsers understand Sass?

No. Browsers only read plain CSS. Sass must be compiled first: you write .scss files, run the Dart Sass compiler (often with a --watch flag that recompiles on save), and link the resulting .css file in your HTML. This build step is the biggest practical difference between using Sass and writing plain CSS by hand.

What does Sass stand for?

Sass stands for Syntactically Awesome Style Sheets. It's been in use since 2006 and is the most widely adopted CSS preprocessor. In everyday conversation, 'Sass' refers to the whole tool and language, while 'SCSS' refers specifically to the newer, CSS-like syntax that most projects actually write their stylesheets in.

What is the difference between Sass variables and CSS variables?

Sass variables ($x) are resolved at compile time and disappear from the final CSS. CSS custom properties (--x) live in the browser at runtime, inherit through the cascade, and can change via JavaScript or media queries. Use Sass variables for build-time logic and math; use CSS custom properties for theming, dark mode, and any value that must change live.

Which version of Sass should I install?

Dart Sass, the official and only actively maintained implementation. The older Ruby Sass and C-based LibSass are both deprecated and no longer receive new features. Install Dart Sass through npm (npm install -D sass) or a standalone package, then compile with the CLI. Any tutorial mentioning Ruby Sass or node-sass is outdated.