Sass·Sass from variables to a design system

Architecture and design tokens

Organise Sass for a growing product with tokens, components and utilities.

Intermediate 14 min read Lesson 9 of 300 Challenge included
What you will be able to do
  • Separate tokens from components.
  • Keep one entry file.
  • Avoid cross-component selectors.
  • Audit unused rules before shipping.

In plain English

A maintainable Sass codebase separates tokens, base styles, components and utilities. One entry file loads the layers in order. Keep component styles close to the component, even in a global build.

main.scssSCSS
@use "tokens";
@use "base/reset";
@use "base/typography";
@use "components/button";
@use "components/card";
@use "utilities/spacing";
Your turn

Order the layers

Easy

List the correct load order for tokens, base and utilities.

SCSS · starter
@use
Check your understanding before moving on.
Knowledge checkQuestion 1

Why keep one Sass entry file?

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: Migrate a CSS codebase
Lesson 9 of 300 · 0% of course