Prefer to watch?
This article has a full video walkthrough on YouTube
Watch the same walkthrough on YouTube.
Comparing CSS methods
Modern frontend developers have multiple choices for styling: BEM (standard CSS/Sass structure), CSS Modules (scoped and modular native CSS), and Utility-First (Tailwind CSS).
Pros and cons
Utility-first offers lightning-fast styling speed and zero bloated stylesheets as your project grows. CSS Modules provide excellent separation of concerns. BEM is still useful for design systems that need generic distribution classes.
css
/* Scoped CSS Module example */
.cardContainer {
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
padding: 1.5rem;
transition: transform 0.2s ease;
}
.cardContainer:hover {
transform: translateY(-4px);
}