Course contentsShow
← Web Development
Lesson 598 of 2,98210. Typography and Design SystemsFree lesson

SMACSS (Scalable and Modular Architecture)

Organizing CSS into categories: base, layout, module, state, and theme for better structure.

SMACSS (Scalable and Modular Architecture)

What you'll learn: How to organize your CSS into five clear categories that make large projects easier to manage and scale.

What Is SMACSS?

SMACSS is a CSS architecture methodology that sorts your styles into five distinct categories: Base, Layout, Module, State, and Theme. Think of it like organizing a library: instead of throwing all books in one pile, you create sections (fiction, non-fiction, reference) so anyone can find what they need quickly.

The Five Categories

Base rules are the defaults—your resets and element styles without classes. These apply to raw HTML elements like body, h1, or a.

Layout rules divide your page into major sections. These use prefixes like .l- or .layout- and define structure: headers, sidebars, grids. They're the "rooms" in your webpage house.

Module rules are reusable, independent components like buttons, cards, or navigation menus. Most of your CSS lives here. Modules don't depend on layout and can be dropped anywhere.

State rules describe how modules or layouts look in different conditions: .is-active, .is-collapsed, .is-error. These often toggle via JavaScript.

Theme rules define colors, typography, and visual styling that can be swapped. They override base styles for different "skins."

Why Use SMACSS?

By categorizing styles, you immediately know where to find or add CSS. Need to change button hover states? Look in Module + State. Want to adjust the sidebar width? Check Layout. This prevents the CSS chaos that happens when everything mixes together randomly.

Key Takeaway: SMACSS organizes CSS into Base, Layout, Module, State, and Theme categories, creating a predictable structure that scales beautifully as your project grows.