Mohamed GhoniemWeb Developer
MohamedGhoniem
  • Work
  • Services
  • Experience
  • Blog
Available
CV
Open to opportunities
WorkServicesExperienceBlogDownload CV
All blogs

© 2026 Mohamed Ghoniem. All rights reserved.

TwitterGitHubLinkedIn
CSS architecture at scale: BEM vs. utility-first vs. CSS Modules
DesignFrontend
All blogs

CSS architecture at scale: BEM vs. utility-first vs. CSS Modules

MG
Mohamed Ghoniem
·July 16, 2026·11 min read

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);
}
On this page11 min left
Comparing CSS methodsPros and cons

Share

On this page11 min left
Comparing CSS methodsPros and cons

Written by

Mohamed Ghoniem

I build fast, responsive web experiences, from pixel-perfect UI to the backend behind it.

Get in touchAll posts
Older postReact Query vs. SWR vs. Zustand: picking the right state toolNewer postThe complete Next.js SEO checklist for 2025
Keep reading
Building a design system from scratch with Figma tokens & Tailwind
DesignFrontendJuly 16, 2026

Building a design system from scratch with Figma tokens & Tailwind

A practical walkthrough of how I set up a token-driven design system that stays in sync between Figma and code — no plugin lock-in, no manual updates.

MG
Mohamed G.
8 min read
The hidden cost of unoptimized images in Next.js
DesignFrontendJuly 16, 2026

The hidden cost of unoptimized images in Next.js

A practical walkthrough of how I set up a token-driven design system that stays in sync between Figma and code — no plugin lock-in, no manual updates.

MG
Mohamed G.
5 min read
JWT refresh token rotation — the right way
DesignFrontendJuly 16, 2026

JWT refresh token rotation — the right way

A practical walkthrough of how I set up a token-driven design system that stays in sync between Figma and code — no plugin lock-in, no manual updates.

MG
Mohamed G.
6 min read