2026-08-14 09:42

Status:


CSS Frameworks & Spin-Offs

A quick-reference guide to CSS frameworks and tooling built on top of vanilla CSS — for use alongside your Common CSS Elements notes.


1. Tailwind CSS (Utility-First)

CategoryCommon ClassesCSS Equivalent
Spacingp-4, m-2, px-6, gap-4padding: 1rem, margin: 0.5rem, etc.
Sizingw-full, h-screen, max-w-mdwidth: 100%, height: 100vh
Typographytext-lg, font-bold, text-centerfont-size, font-weight, text-align
Colorbg-blue-500, text-gray-800background-color, color (from a preset palette)
Flexboxflex, justify-between, items-centerdisplay: flex, justify-content, align-items
Gridgrid, grid-cols-3, gap-4display: grid, grid-template-columns
Responsivemd:flex, lg:grid-cols-4Media query breakpoints as class prefixes
Statehover:bg-blue-700, focus:outline-none:hover, :focus pseudo-classes

Example — Card component:

<div class="max-w-sm rounded-lg shadow-md p-6 bg-white">
  <h2 class="text-xl font-bold mb-2">Card Title</h2>
  <p class="text-gray-600">Some description text goes here.</p>
  <button class="mt-4 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600">
    Learn More
  </button>
</div>

When to Use Tailwind

Use CaseWhy Tailwind Fits
Custom, unique designsNo fighting pre-built component styles to override
Small bundle size neededPurges unused classes at build time
Rapid prototyping with full controlStyling happens right in the markup, no context-switching
Design systems with consistent scaleSpacing/color/type scales are enforced by the config
Team comfortable with “utility class soup”Trade-off: HTML gets verbose, but nothing is hidden in a stylesheet

2. Bootstrap (Component-Based)

CategoryCommon ClassesWhat It Provides
Grid systemcontainer, row, col-md-612-column responsive grid
Buttonsbtn, btn-primary, btn-outline-dangerPre-styled button variants
Cardscard, card-body, card-titleReady-made card component structure
Navbarnavbar, navbar-expand-lg, nav-linkFull responsive navigation component
Utilitiesd-flex, text-center, mt-3Utility classes (spacing/display), similar in spirit to Tailwind but smaller in scope
Alerts/Badgesalert alert-warning, badge bg-secondaryPre-styled feedback/status components

Example — Card component:

<div class="card" style="width: 18rem;">
  <div class="card-body">
    <h5 class="card-title">Card Title</h5>
    <p class="card-text">Some description text goes here.</p>
    <a href="#" class="btn btn-primary">Learn More</a>
  </div>
</div>

Example — Responsive Grid:

<div class="container">
  <div class="row">
    <div class="col-md-4">Column 1</div>
    <div class="col-md-4">Column 2</div>
    <div class="col-md-4">Column 3</div>
  </div>
</div>

When to Use Bootstrap

Use CaseWhy Bootstrap Fits
Fast MVP / admin dashboardPre-built components mean less design work upfront
Team without dedicated designerSensible defaults look decent out of the box
Standard UI patterns (navbars, modals, forms)Components like modal, dropdown, carousel come with JS behavior included
Consistent look across many pages quicklyWhole design system is baked in
Less control over unique brandingTrade-off: sites can look “Bootstrap-y” unless heavily customized

3. Tailwind vs. Bootstrap — Quick Decision Guide

QuestionAnswer
Need a highly custom, unique visual design?Tailwind
Need to ship a standard UI fast with minimal styling effort?Bootstrap
Want small production CSS bundle?Tailwind (purges unused styles)
Want built-in JS components (modals, dropdowns, carousels)?Bootstrap
Prefer styling in HTML/JSX directly?Tailwind
Prefer semantic class names and separate stylesheets?Bootstrap
Building a design system from scratch?Tailwind
Prototyping internal tools/admin panels?Bootstrap

4. Other CSS Spin-Off Tools

ToolTypeWhat It’s For
Sass/SCSSPreprocessorAdds variables, nesting, mixins, functions to CSS (compiles to plain CSS)
PostCSSPost-processorTransforms CSS with plugins (e.g., autoprefixer for vendor prefixes)
CSS ModulesScoping methodLocally scopes class names to avoid collisions in component-based apps
styled-componentsCSS-in-JSWrite actual CSS inside JavaScript, scoped to React components
BulmaFrameworkSimilar to Bootstrap but no built-in JS, purely CSS-based
Materialize / MUIFrameworkImplements Google’s Material Design system

When to Use Each

Use CaseBest Fit
Want CSS superpowers (variables, nesting) without leaving CSS syntaxSass/SCSS
Need automatic vendor prefixing or modern CSS transformsPostCSS
Building components and want zero class-name collisionsCSS Modules
Building in React and want styles colocated with componentsstyled-components
Want a lightweight Bootstrap alternative with no jQuery/JS baggageBulma
Building an app that should look/feel like Google productsMaterialize / MUI

5. Example — Same Component, Three Ways

Vanilla CSS:

.btn {
  padding: 0.5rem 1rem;
  background-color: #3b82f6;
  color: white;
  border-radius: 0.375rem;
}
.btn:hover {
  background-color: #2563eb;
}

Tailwind:

<button class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600">
  Click Me
</button>

Bootstrap:

<button class="btn btn-primary">Click Me</button>


References