Skip to content
T
Tools.Town
Free Online Tools for Everyone
Design Tools

Tailwind Config Generator Guide — Custom Colors, Fonts, Breakpoints & Dark Mode

How to generate tailwind.config.js or .ts with custom colors, font families, breakpoints, and dark mode strategy using the Tools.Town Tailwind Config Generator.

25 June 2026 5 min read By Tools.Town Team Fact Checked

Key Takeaways

  • Use 'Extend defaults' (recommended)
  • 'class' is the most common: it activates dark mode when the
  • The CSS block defines :root { --color-brand: #6366f1;
  • Standard CSS hex values (#6366f1), RGB, HSL, or named colours

What the generator produces

For each configuration you build, the Tailwind Config Generator outputs three things:

  1. tailwind.config.js — CommonJS, compatible with any Node toolchain
  2. tailwind.config.ts — TypeScript, typed with satisfies Config for full IntelliSense
  3. CSS custom properties — a :root { } block for use outside Tailwind utilities

All three are kept in sync; change an input and all three update instantly.

Setting up custom colours

Each colour needs a name (the Tailwind class stem) and a value (CSS hex or function). The colour picker lets you choose visually while the hex input gives precision. Examples:

NameValueGenerated class
brand#6366f1bg-brand, text-brand
accent#f59e0bbg-accent, text-accent
surface#f8fafcbg-surface

In extend mode, these join Tailwind’s existing palette. In replace mode, only your colours exist.

Custom font families

Enter a name (Tailwind font- stem) and a stack (comma-separated CSS font families). Examples:

sans → Inter, system-ui, -apple-system, sans-serif
mono → JetBrains Mono, Fira Code, monospace
display → Fraunces, Georgia, serif

These map to font-sans, font-mono, font-display classes.

Custom breakpoints

Add breakpoints with a name and a value including the unit (px, em, rem). Common additions:

NameValueUse case
xs480pxSmall phones
3xl1920pxUltra-wide screens
4xl2560px4K monitors

The generator warns if a value is missing a unit (e.g. 768 instead of 768px).

Dark mode strategies

class — set darkMode: 'class' and add .dark to <html> via JavaScript to toggle. Most common in custom dark mode implementations.

media — automatic. Follows OS preference (prefers-color-scheme: dark). No JavaScript needed, but you cannot toggle independently of OS.

selector — Tailwind v3.4+. Use a custom selector like [data-theme="dark"] for maximum flexibility.

Using the output

Copy the JS or TS config and drop it at your project root as tailwind.config.js or tailwind.config.ts. If using CSS variables, paste the :root { } block into your global stylesheet. No build step is required for the config itself — it takes effect the next time your bundler restarts.

Advertisement

Try Tailwind Config Generator — Free

Apply what you just learned with our free tool. No sign-up required.

Try Tailwind Config Generator

Frequently Asked Questions

Should I use extend or replace?
Use 'Extend defaults' (recommended). This keeps Tailwind's built-in utilities (slate, gray, zinc colours, default breakpoints) and adds your custom values on top. 'Replace' removes all defaults — only do this if you want complete control and will define every utility yourself.
Which dark mode strategy should I use?
'class' is the most common: it activates dark mode when the .dark class is present on an ancestor element (usually <html>). 'media' uses the OS prefers-color-scheme setting. 'selector' is a Tailwind v3.4+ option for custom selectors.
What is the CSS Variables output used for?
The CSS block defines :root { --color-brand: #6366f1; ... } so you can reference your design tokens in plain CSS outside of Tailwind utilities. Useful for third-party component libraries that use CSS variables.
What format should color values be in?
Standard CSS hex values (#6366f1), RGB, HSL, or named colours. Spaces in values are allowed. The generator warns on values that don't start with # or a CSS function if they look malformed.

Was this guide helpful?

Your feedback helps us improve our content.

Continue Reading

All Design Tools Guides

Get the best Design Tools tips & guides in your inbox

Join 25,000+ users who get our weekly design tools insights.