Key takeaways
- A 500 step plus lighter and darker steps covers most UI needs.
- Paste the generated block into @theme in Tailwind v4.
- Always test contrast for text on mid-tones.
Tailwind projects work best with a full scale of each brand color. You can get one from a single hex code in a minute.
Step 1: Pick your base color
This will become the 500 step. Choose the color you use most for buttons and links.
Step 2: Generate the scale
Open the shade scale generator, enter your hex code, name the color (for example brand) and choose the Tailwind v4 format.
Step 3: Paste it into your CSS
Add the generated block to your main stylesheet.
@import "tailwindcss";
@theme {
--color-brand-50: #eef3ff;
--color-brand-500: #3b6cff;
--color-brand-950: #0a1a4d;
/* ...the other steps */
}Step 4: Use the classes
Tailwind now generates utilities for every step.
<button class="bg-brand-500 hover:bg-brand-600 text-white"> Get started </button>
Step 5: Check contrast
Mid-tones like 400 to 600 often fail with white text. Test your button colors before you ship them.
Wrap up
On Tailwind v3, the same values go under theme.extend.colors in tailwind.config.js.