Sass·Sass from variables to a design system

Migrate a CSS codebase

Move from CSS to Sass incrementally with tests and visual checks.

Intermediate 16 min read Lesson 10 of 300 Challenge included
What you will be able to do
  • Rename and compile before refactoring.
  • Introduce tokens first.
  • Extract mixins only where repetition hurts.
  • Compare compiled output at every step.

In plain English

Rename CSS to SCSS first, then introduce variables and mixins gradually. Keep the compiled output close to the original at each step. Use visual regression or a screenshot diff to catch changes.

terminalTerminal
mkdir -p src/styles
mv src/styles/app.css src/styles/app.scss
sass src/styles/app.scss public/app.css
Your turn

Compile the renamed file

Easy

Write the command that compiles app.scss to public/app.css.

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

What is the safest first migration step?

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.

Lesson 10 of 300 · 0% of course