CSS Architecture and Frameworks: BEM Naming, Utility Classes, Bootstrap vs Tailwind, Reset and a Scalable File Structure

Web Designing 55 min min read Updated: Nov 17, 2026 Intermediate
CSS Architecture and Frameworks: BEM Naming, Utility Classes, Bootstrap vs Tailwind, Reset and a Scalable File Structure
Intermediate Topic 3 of 3

The Problem: CSS Gets Messy

Small sites are easy. Big sites grow rules that fight each other, names nobody understands and styles nobody dares to delete. A naming system and structure keep it healthy.

BEM Naming

BEM = Block, Element, Modifier. It gives every class a clear role.

html <article class="card card--featured"> <h3 class="card__title">Chocolate truffle</h3> <p class="card__text">Rich and soft.</p> <a class="card__button" href="/order.html">Order</a> </article>
css .card { padding: 1rem; border: 1px solid #ddd; } .card__title { margin: 0 0 .5rem; } .card__button { display: inline-block; } .card--featured { border-color: gold; }
PartPatternExample
Block.block.card
Element.block__element.card__title
Modifier.block--modifier.card--featured

Utility-First CSS

Instead of writing custom CSS for each component, you combine many small single-purpose classes in the HTML.

html <a class="inline-block px-5 py-3 rounded-lg bg-blue-600 text-white font-semibold" href="/order">Order</a>

Bootstrap vs Tailwind

BootstrapTailwind CSS
StyleReady-made components (navbar, modal, card)Utility classes you combine
Speed to first resultVery fast, looks 'Bootstrap-like' by defaultFast once you learn the classes
CustomizationVariables and overridesVery flexible, design from scratch
HTMLFewer classes per elementMany classes per element
Best forDashboards, prototypes, quick sitesCustom designs and component systems
Learn plain CSS first Frameworks are tools on top of CSS. If you understand the box model, Flexbox, Grid and the cascade, you can learn any framework quickly.

Reset and Base

css *, *::before, *::after { box-sizing: border-box; } body { margin: 0; line-height: 1.6; } img, picture, video { max-width: 100%; display: block; } button, input, select, textarea { font: inherit; }

Scalable Structure

text css/ base/ reset.css, typography.css, tokens.css layout/ container.css, grid.css, header.css, footer.css components/ button.css, card.css, form.css, modal.css utilities/ spacing.css, visibility.css main.css imports all of the above in order

Rules of Thumb

  • One component, one file
  • Style with classes, not tags or ids
  • Keep selectors short (one or two levels)
  • Use variables for colors and spacing
  • Delete unused CSS regularly
  • Do not use !important as a habit

Practice

  1. Rewrite a messy card style using BEM
  2. Build the same button with plain CSS and with a utility approach
  3. Create the folder structure for your project

Conclusion

Use clear names (BEM or utilities), a short reset, shared tokens and a folder structure. Learn plain CSS first, then add a framework when it helps.

Quick Summary: Problem; BEM; utility-first; frameworks; reset; structure; rules.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators