theme
: Customize colors, spacing, fonts, breakpoints, etc.
Example:
theme: {
extend: {
colors: {
'custom-blue': '#123456',
}
}
}
A concise cheat sheet for Tailwind CSS, covering installation, configuration, core concepts, and essential utilities to accelerate your web development workflow.
Example:
|
Example:
|
(Deprecated in Tailwind CSS v3.0+; use the |
Example:
|
Example:
|
Example:
|
Example:
|
Example:
|
Example:
|
|
Apply a sans-serif font family. |
|
Apply a serif font family. |
|
Apply a monospace font family. |
|
Extra small text size ( |
|
Small text size ( |
|
Base text size ( |
|
Large text size ( |
|
Extra large text size ( |
|
Font weight 100. |
|
Font weight 200. |
|
Font weight 300. |
|
Font weight 400 (normal). |
|
Font weight 500 (medium). |
|
Font weight 600 (semi-bold). |
|
Font weight 700 (bold). |
|
Font weight 800 (extra-bold). |
|
Font weight 900 (black). |
|
Set font style to italic. |
|
Set font style to normal (non-italic). |
|
Transform text to uppercase. |
|
Transform text to lowercase. |
|
Transform text to capitalize. |
Tailwind CSS uses a utility-first approach, meaning you compose styles by applying pre-defined utility classes directly in your HTML. Example:
|
Responsive Design: Use breakpoint prefixes like Example:
|
Hover, Focus, and Other States: Use prefixes like Example:
|
Dark Mode: Use the Example:
|
Typography:
|
Background:
|
Spacing (Margin & Padding):
|
Flexbox & Grid:
|
Border:
|
Positioning:
|
Display:
|
Effects:
|
While Tailwind encourages utility classes, you can add custom CSS:
|
|
|
|
|
|
|
Several AI tools can help you generate Tailwind CSS code, including:
|
|
|