SassยทSass from variables to a design system

Setup and syntax

Compile SCSS and understand the two syntaxes.

Intermediate 12 min read Lesson 1 of 300 Challenge included
What you will be able to do
  • Use .scss for new code.
  • Compile with sass input.scss output.css.
  • Use --watch during development.
  • Keep the compiled CSS out of source control when a build handles it.

In plain English

Sass has SCSS (CSS-like, braces and semicolons) and the older indented syntax. Compile with the Sass CLI, Vite or your framework. The output is still plain CSS.

input.scssSCSS
$brand: #2f74c0;

.card {
  color: $brand;
  padding: 16px;
}
Your turn

Compile a file

Easy

Write the command that compiles input.scss to output.css.

BASH ยท starter
sass
Check your understanding before moving on.
Knowledge checkQuestion 1

What does Sass compile to?

Select an answer to continue
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Variables and tokens
Lesson 1 of 300 ยท 0% of course