Skip to content
BENIBIX Learn

Sass

Development🌐 Web DevelopmentBrowser Code

Also known as SCSS, Sass CSS, .scss, Syntactically Awesome Style Sheets

A language for writing CSS with extra tools, like nesting. It turns into plain CSS.

Think of it like

It is like a shorthand for notes. You write fast, then copy it out neat for others.

Example

Jack has 30 style files for a big shop site. He writes them in Sass, and one build step joins them into one small CSS file.

Why it matters

Big stylesheets stay tidy and short. Many CSS frameworks, like Bootstrap, are written in it.

Definition

Sass is a language that adds extra tools to CSS, then turns into plain CSS for the browser. It lets you nest rules, share pieces of style, and split your styles into many files. Most people write it in .scss files, where any normal CSS still works. A tool called a compiler turns those files into one .css file. Browsers never see the Sass itself.

Example code

scss
$brand: teal;
.card {
  padding: 16px;
  h2 { color: $brand; }
}
A Sass value and a nested rule. It compiles to .card h2 { color: teal; }.
Sass, in the middle panel, is written as .scss and comes out as plain .css.

Common mistake

Nesting rules five levels deep. The CSS that comes out gets long selectors that are hard to beat.

Key takeaways

  1. 1
    Becomes CSS. A compiler turns it into plain CSS.
  2. 2
    Nesting. Rules can sit inside other rules.
  3. 3
    SCSS is CSS plus. Normal CSS works in a .scss file.

Compare

Learn it properly