Tailwind CSS·Tailwind from utilities to design system

Spacing, sizing and colour

Use the spacing scale, intrinsic sizing and semantic colour shades.

Intermediate 13 min read Lesson 2 of 300 Challenge included
What you will be able to do
  • Use p-*, m-*, gap-* and space-y-* for rhythm.
  • Use w-full, max-w-prose and min-h-screen for layout.
  • Pick a colour family and use 50–200 for surfaces, 600–800 for text.
  • Use opacity and ring for subtle separation.

In plain English

Tailwind spacing is a consistent scale, not arbitrary pixels. Colour shades run from 50 to 950, which makes hover and surface states predictable. Prefer max-w-* and min-h-* over fixed sizes so content can grow.

colors.htmlHTML
<article class="max-w-prose rounded-xl bg-slate-50 p-6 ring-1 ring-slate-200">
  <h2 class="text-lg font-semibold text-slate-900">CSS Grid</h2>
  <p class="mt-2 text-slate-600">Layout without hacks.</p>
</article>
Your turn

Create a muted surface

Easy

Give a section a light slate background, a ring and vertical padding.

HTML · starter
<section class="">
Check your understanding before moving on.
Knowledge checkQuestion 1

Which utility creates space between flex or grid children?

Select an answer to continue
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Typography
Lesson 2 of 300 · 0% of course