Colors help make websites look nice and easy to read. Tailwind gives a set of ready colors with different shades to use quickly.
Default color palette and shades in Tailwind
Start learning this pattern below
Jump into concepts and practice - no test required
bg-{color}-{shade}
text-{color}-{shade}
border-{color}-{shade}Replace {color} with a color name like blue, red, or gray.
Replace {shade} with a number like 50, 100, up to 900. Lower numbers are lighter colors, higher are darker.
bg-blue-500
text-red-700
border-gray-300
This page shows colored boxes using Tailwind's default colors and shades. Each box uses a background color and text color from the palette. The grid layout arranges them nicely.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Tailwind Default Colors</title> <script src="https://cdn.tailwindcss.com"></script> </head> <body class="p-6"> <h1 class="text-2xl font-bold mb-4">Tailwind Default Color Palette</h1> <div class="grid grid-cols-5 gap-4 max-w-xl"> <div class="bg-red-500 text-white p-4 rounded">Red 500</div> <div class="bg-green-300 text-green-900 p-4 rounded">Green 300</div> <div class="bg-blue-700 text-white p-4 rounded">Blue 700</div> <div class="bg-yellow-200 text-yellow-900 p-4 rounded">Yellow 200</div> <div class="bg-gray-100 text-gray-800 p-4 rounded border border-gray-300">Gray 100</div> </div> </body> </html>
Use the Tailwind CDN or install Tailwind to use these classes.
Colors are designed to have good contrast for readability.
You can customize the palette in Tailwind config if needed.
Tailwind provides ready colors with shades from 50 (light) to 900 (dark).
Use classes like bg-blue-500 or text-red-700 to apply colors.
This helps keep your website colors consistent and easy to change.
Practice
Solution
Step 1: Understand Tailwind color shade scale
Tailwind colors range from 50 (lightest) to 900 (darkest). 500 is the medium shade.Step 2: Identify the correct class for medium blue
The classbg-blue-500applies the medium blue background color.Final Answer:
bg-blue-500 -> Option CQuick Check:
Medium shade blue = bg-blue-500 [OK]
- Choosing 50 or 900 thinking they are medium
- Using non-existent shade like 1000
- Confusing text color with background color classes
Solution
Step 1: Identify dark shade range in Tailwind
Dark shades are closer to 700 or 900. Light shades are 50 or 100.Step 2: Pick the class for dark red text
text-red-700is a dark red shade suitable for text color.Final Answer:
text-red-700 -> Option BQuick Check:
Dark red text = text-red-700 [OK]
- Using 300 which is lighter shade
- Using 50 which is very light
- Using invalid shade 1000
bg-green-200 apply in Tailwind CSS?Solution
Step 1: Understand Tailwind green shade numbering
Lower numbers like 50, 100, 200 are light shades; higher numbers like 700, 900 are dark.Step 2: Interpret bg-green-200
The classbg-green-200applies a light green background color.Final Answer:
A light green shade -> Option DQuick Check:
Green 200 = light green shade [OK]
- Thinking 200 is medium or dark shade
- Confusing background and text color classes
- Assuming 200 is invalid shade
bg-yellow-600. The color looks too dark. What is the best fix?Solution
Step 1: Understand shade brightness in Tailwind
600 is a dark shade; 400 is medium; 50 is very light.Step 2: Choose a medium shade for yellow background
Changing tobg-yellow-400will give a medium yellow shade, lighter than 600.Final Answer:
Change class to bg-yellow-400 -> Option AQuick Check:
Medium yellow = bg-yellow-400 [OK]
- Choosing 900 which is even darker
- Choosing 50 which is too light
- Adding opacity instead of adjusting shade
Solution
Step 1: Understand shade order for blue in Tailwind
Lower numbers (300) are lighter, higher numbers (700) are darker.Step 2: Match states with correct shades
Base: light blue (300), hover: medium blue (500), active: dark blue (700).Step 3: Verify class order
bg-blue-300 hover:bg-blue-500 active:bg-blue-700matches the requirement.Final Answer:
bg-blue-300 hover:bg-blue-500 active:bg-blue-700 -> Option AQuick Check:
Light to dark on hover and active = bg-blue-300 hover:bg-blue-500 active:bg-blue-700 [OK]
- Reversing light and dark shades in states
- Using darker base color than hover
- Mixing up hover and active shades
