Discover how a simple color system can save you hours and make your website look amazing!
Why Default color palette and shades in Tailwind? - Purpose & Use Cases
Start learning this pattern below
Jump into concepts and practice - no test required
Imagine you are designing a website and want to pick colors for buttons, backgrounds, and text. You try to write down each color code manually, like #ff0000 for red or #00ff00 for green, and then create lighter or darker versions by guessing or using a separate tool.
This manual way is slow and tricky. You might pick colors that don't look good together or spend too much time adjusting shades. It's easy to make mistakes, and changing one color means updating many places by hand.
Tailwind's default color palette gives you a ready set of colors with matching shades from light to dark. You just use simple names like bg-blue-500 or text-red-300. This saves time, keeps colors consistent, and makes your design look balanced.
background-color: #3b82f6; /* blue */ color: #dbeafe; /* light blue */
class="bg-blue-500 text-blue-100"
You can quickly build beautiful, consistent designs without worrying about color codes or shade matching.
When creating a blog, you want your headings, links, and buttons to share the same blue color but with different brightness. Using Tailwind's palette, you pick blue-700 for headings, blue-500 for buttons, and blue-300 for links easily and confidently.
Manual color picking is slow and error-prone.
Tailwind's default palette offers ready colors with matching shades.
This makes your design consistent, faster, and easier to update.
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
