Skip to content
Learn Netverks

Lesson

Step 4/32 13% through track

how-tailwind-works

How Tailwind works under the hood

Last reviewed May 28, 2026 Content v20260528
Track mode
iframe_html
Means
HTML preview sandbox
Reading
~2 min
Level
intermediate

This lesson

This lesson teaches How Tailwind works under the hood—the ideas, syntax, and habits you need before moving on in Tailwind CSS.

Config-driven utilities are how most greenfield product CSS is written today.

You will apply How Tailwind works under the hood in contexts like: React/Vue/Next apps, marketing sites, design systems, and rapid prototypes where consistency and speed matter.

Read the lesson, edit HTML/CSS in the playground, press Run to preview, then answer the lesson MCQs.

Early in the track—complete this before layout, scripting, or architecture lessons that assume these basics.

Tailwind scans your source files for class names, generates only the CSS you use, and orders utilities so variants (responsive, hover) compose predictably.

Build pipeline (production)

  1. Content paths — tell Tailwind which files to scan (./src/**/*.{jsx,tsx,html})
  2. JIT engine — generates rules on demand; arbitrary values like w-[137px] work at build time
  3. Purge / content — unused utilities never ship, keeping bundles small

The playground uses the CDN build for convenience. Production apps install tailwindcss via npm and integrate with PostCSS or Vite.

Important interview questions and answers

  1. Q: Why is Tailwind’s bundle small if it has thousands of classes?
    A: Only classes found in your content are emitted; purge/content configuration strips the rest.
  2. Q: What is JIT?
    A: Just-In-Time generation: utilities are created when detected in source, enabling arbitrary values and faster builds vs. pre-generating every permutation.
  3. Q: CDN vs npm?
    A: CDN is fine for demos; npm + build gives purge, plugins, custom theme, and no runtime compiler in production.

Self-check

  1. What step prevents shipping unused utility CSS?
  2. Why is the CDN approach different from a Vite + Tailwind setup?

Interview prep

What does the build step actually generate?

A CSS file containing only the utility rules your content paths reference—JIT scans class names at compile time.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • What files does the build scan for class names?
  • What breaks if classes are built dynamically in JS strings?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump