Export Color Palettes to Tailwind Config
Paste a JSON palette, set a namespace like brand or accent, and copy a Tailwind colors map plus optional HSL variable scaffold.
Generate Tailwind Config
Used for CSS variables prefix
import type { Config } from "tailwindcss"
export default {
theme: {
extend: {
colors: {
"50": "#EFF6FF",
"100": "#DBEAFE",
"200": "#BFDBFE",
"300": "#93C5FD",
"400": "#60A5FA",
"500": "#3B82F6",
"600": "#2563EB",
"700": "#1D4ED8",
"800": "#1E40AF",
"900": "#1E3A8A"
}
}
}
} satisfies Config
:root {
--brand-50: #EFF6FF;
--brand-100: #DBEAFE;
--brand-200: #BFDBFE;
--brand-300: #93C5FD;
--brand-400: #60A5FA;
--brand-500: #3B82F6;
--brand-600: #2563EB;
--brand-700: #1D4ED8;
--brand-800: #1E40AF;
--brand-900: #1E3A8A;
}Color Preview
Why export to Tailwind
Hand-typing every shade into tailwind.config is slow and easy to mistype. Exporting from a normalized palette keeps names and scales aligned with design tokens and unlocks utilities like bg-brand-500 without scattering raw HEX through components.
What you get
- Semantic names and optional namespaces
- HSL channel variables for theme tweaks
- Copy-paste config ready to merge
Before you export
- Normalize with the Color Palette Importer
- Validate contrast on key pairs
- Prefer families like brand, accent, muted
Start from the Color Palette Importer if sources are messy, then check pairs with the Contrast Checker.
HSL variables and steps
Storing --brand-h, --brand-s, and --brand-l lets you nudge hover/dark states without rewriting every HEX. In Tailwind, reference hsl(var(--brand-h) var(--brand-s) var(--brand-l)) (syntax may vary slightly by Tailwind version and CSS setup).
- Paste JSON (object map or name/hex array).
- Set a namespace (brand, accent, muted, or your token family).
- Copy the config snippet and optional CSS variable scaffold.
Frequently asked questions
Where do I paste the output?
Merge the generated colors into theme.extend.colors in tailwind.config.ts or .js. Put the CSS variable scaffold in your global stylesheet if you export HSL channels.
How do I use the colors in components?
After rebuild, use utilities like bg-brand-500, text-accent-700, or border-muted-300—namespace plus key from your export.
Can I edit the scale afterward?
Yes. Treat the export as a starting point. Tweak HEX or HSL channels in config/CSS as the brand evolves.
Does this work with Tailwind v3 and v4 workflows?
The color map format matches common Tailwind theme extension patterns used in v3+. If you are on Tailwind v4 CSS-first config, adapt the values into your @theme block the same way you would any custom palette.
Which JSON shapes are accepted?
Objects of name→hex, arrays of { name, hex }, or simple hex string arrays (auto-named). Normalize odd exports with the Color Palette Importer first if needed.
Next steps
- Preview utilities in the Theme Preview Sandbox
- Keep charts readable with the Accessible Chart Color Palette Generator
- Re-check tokens in the Design System Color Validator
Related tools
Related tools
Related Color and Design Tools
8pt Grid Visualizer
Visualize and work with 8pt grid systems
Accessible Color Combinations
Find accessible color combinations
Accessible Font Size Checker
Check font sizes for accessibility
Animated Gradient Background
Create animated gradient backgrounds
Baseline Grid Generator
Generate baseline grids for typography
Border Radius Previewer
Preview and test border radius values
Color Blindness Simulator
Simulate color blindness for accessibility testing
Color Harmony Visualizer
Visualize color harmony schemes
Color Naming Tool
Generate names for colors
Color Palette Generator
Generate beautiful color palettes