SyntaxStudy
Sign Up
SASS / SCSS Beginner 1 min read

What Is SASS and Why Use It

SASS (Syntactically Awesome Style Sheets) is a CSS preprocessor that extends the capabilities of plain CSS with features like variables, nesting, mixins, functions, and more. It compiles down to standard CSS that any browser can understand. SASS was first released in 2006 and has become one of the most widely adopted CSS preprocessors in the web development community. There are two syntaxes available in SASS: the indented syntax (the original, using .sass files) and SCSS (Sassy CSS, using .scss files). SCSS is a superset of CSS, meaning any valid CSS is also valid SCSS. Because of its familiarity to CSS developers, SCSS is the more commonly used syntax today. Using SASS in a project dramatically improves stylesheet maintainability. Variables eliminate repetition, nesting reflects HTML structure, and mixins allow reusable blocks of styles. These features make large stylesheets easier to read, refactor, and scale across a team.
Example
// ── What SASS/SCSS looks like vs plain CSS ───────────────────────────────────

// 1. SASS variables  (compile-time, replaced by value in output)
$brand-color : #3498db;
$font-stack  : 'Helvetica Neue', Helvetica, sans-serif;
$base-radius : 4px;

// 2. Nesting (mirrors HTML hierarchy)
nav {
    background: $brand-color;

    ul {
        margin  : 0;
        padding : 0;
        list-style: none;
    }

    li { display: inline-block; }

    a {
        color      : #fff;
        padding    : 0.5rem 1rem;
        text-decoration: none;

        &:hover { text-decoration: underline; }
    }
}

// 3. The above compiles to clean, flat CSS:
// nav { background: #3498db; }
// nav ul { margin: 0; padding: 0; list-style: none; }
// nav li { display: inline-block; }
// nav a { color: #fff; padding: 0.5rem 1rem; text-decoration: none; }
// nav a:hover { text-decoration: underline; }