tailwind-gradient-builder
Creates modern CSS gradients using Tailwind CSS including linear, radial, conic, mesh gradients, animated gradients, glassmorphism, and gradient text effects. Use when users request "gradient background", "tailwind gradient", "modern gradient", "mesh gradient", or "animated gradient".
What this skill does
# Tailwind Gradient Builder
Create stunning modern gradients with Tailwind CSS for backgrounds, text, borders, and animations.
## Core Workflow
1. **Choose gradient type**: Linear, radial, conic, or mesh
2. **Select color palette**: Define color stops and positions
3. **Add direction/angle**: Configure gradient orientation
4. **Apply effects**: Blur, animation, glassmorphism
5. **Optimize**: Ensure performance and accessibility
## Basic Linear Gradients
### Simple Two-Color Gradient
```html
<!-- Left to Right -->
<div class="bg-gradient-to-r from-blue-500 to-purple-600"></div>
<!-- Top to Bottom -->
<div class="bg-gradient-to-b from-cyan-400 to-blue-600"></div>
<!-- Diagonal -->
<div class="bg-gradient-to-br from-pink-500 to-orange-400"></div>
```
### Direction Classes
| Class | Direction |
|-------|-----------|
| `bg-gradient-to-t` | Bottom to Top |
| `bg-gradient-to-tr` | Bottom-left to Top-right |
| `bg-gradient-to-r` | Left to Right |
| `bg-gradient-to-br` | Top-left to Bottom-right |
| `bg-gradient-to-b` | Top to Bottom |
| `bg-gradient-to-bl` | Top-right to Bottom-left |
| `bg-gradient-to-l` | Right to Left |
| `bg-gradient-to-tl` | Bottom-right to Top-left |
### Three-Color Gradients
```html
<!-- With via for middle color -->
<div class="bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500"></div>
<!-- Sunset gradient -->
<div class="bg-gradient-to-r from-orange-500 via-red-500 to-pink-500"></div>
<!-- Ocean gradient -->
<div class="bg-gradient-to-r from-cyan-500 via-blue-500 to-indigo-500"></div>
```
## Modern Gradient Presets
### Aurora Borealis
```html
<div class="bg-gradient-to-r from-green-300 via-blue-500 to-purple-600"></div>
```
### Sunset Vibes
```html
<div class="bg-gradient-to-r from-amber-200 via-rose-400 to-violet-500"></div>
```
### Neon Glow
```html
<div class="bg-gradient-to-r from-pink-500 via-purple-500 to-indigo-500"></div>
```
### Forest Mist
```html
<div class="bg-gradient-to-br from-emerald-400 via-teal-500 to-cyan-600"></div>
```
### Midnight City
```html
<div class="bg-gradient-to-b from-gray-900 via-purple-900 to-violet-600"></div>
```
### Peach Sunset
```html
<div class="bg-gradient-to-r from-rose-100 via-pink-300 to-orange-200"></div>
```
## Gradient Text
```html
<!-- Gradient text effect -->
<h1 class="bg-gradient-to-r from-purple-600 via-pink-600 to-blue-600 bg-clip-text text-transparent">
Gradient Text
</h1>
<!-- Animated gradient text -->
<h1 class="animate-gradient bg-gradient-to-r from-purple-500 via-pink-500 to-red-500 bg-[length:200%_auto] bg-clip-text text-transparent">
Animated Gradient
</h1>
```
### Tailwind Config for Animated Gradient Text
```javascript
// tailwind.config.js
module.exports = {
theme: {
extend: {
animation: {
gradient: 'gradient 3s ease infinite',
},
keyframes: {
gradient: {
'0%, 100%': { backgroundPosition: '0% 50%' },
'50%': { backgroundPosition: '100% 50%' },
},
},
},
},
};
```
## Radial Gradients
```html
<!-- Custom radial gradient with arbitrary values -->
<div class="bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-purple-900 via-indigo-800 to-slate-900"></div>
<!-- Radial from top -->
<div class="bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-amber-200 via-violet-600 to-sky-900"></div>
<!-- Circle gradient -->
<div class="bg-[radial-gradient(circle_at_center,_var(--tw-gradient-stops))] from-white to-gray-300"></div>
```
### Radial Position Variants
```html
<!-- Top center -->
<div class="bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-sky-400 to-indigo-900"></div>
<!-- Bottom right -->
<div class="bg-[radial-gradient(ellipse_at_bottom_right,_var(--tw-gradient-stops))] from-rose-400 to-orange-300"></div>
<!-- Custom position -->
<div class="bg-[radial-gradient(ellipse_at_30%_70%,_var(--tw-gradient-stops))] from-emerald-300 to-cyan-800"></div>
```
## Conic Gradients
```html
<!-- Color wheel -->
<div class="bg-[conic-gradient(from_0deg,_red,_yellow,_lime,_aqua,_blue,_magenta,_red)] rounded-full"></div>
<!-- Subtle sweep -->
<div class="bg-[conic-gradient(at_top_right,_var(--tw-gradient-stops))] from-yellow-200 via-emerald-200 to-yellow-200"></div>
<!-- Pie chart effect -->
<div class="bg-[conic-gradient(from_45deg,_#3b82f6_0deg_120deg,_#10b981_120deg_240deg,_#f59e0b_240deg_360deg)] rounded-full"></div>
```
## Mesh Gradients
### CSS Mesh Gradient (Multiple Radials)
```html
<div class="relative min-h-screen overflow-hidden">
<!-- Base layer -->
<div class="absolute inset-0 bg-slate-950"></div>
<!-- Mesh gradient layers -->
<div class="absolute inset-0 bg-[radial-gradient(at_40%_20%,hsla(240,100%,70%,0.3)_0px,transparent_50%)]"></div>
<div class="absolute inset-0 bg-[radial-gradient(at_80%_0%,hsla(189,100%,56%,0.3)_0px,transparent_50%)]"></div>
<div class="absolute inset-0 bg-[radial-gradient(at_0%_50%,hsla(355,100%,66%,0.3)_0px,transparent_50%)]"></div>
<div class="absolute inset-0 bg-[radial-gradient(at_80%_50%,hsla(340,100%,70%,0.3)_0px,transparent_50%)]"></div>
<div class="absolute inset-0 bg-[radial-gradient(at_0%_100%,hsla(269,100%,70%,0.3)_0px,transparent_50%)]"></div>
</div>
```
### Reusable Mesh Component
```tsx
// MeshGradient.tsx
interface MeshGradientProps {
colors?: string[];
className?: string;
}
export function MeshGradient({
colors = [
'hsla(240,100%,70%,0.3)',
'hsla(189,100%,56%,0.3)',
'hsla(355,100%,66%,0.3)',
'hsla(340,100%,70%,0.3)',
],
className = ''
}: MeshGradientProps) {
const positions = ['40%_20%', '80%_0%', '0%_50%', '80%_50%'];
return (
<div className={`relative ${className}`}>
<div className="absolute inset-0 bg-slate-950" />
{colors.map((color, i) => (
<div
key={i}
className="absolute inset-0"
style={{
background: `radial-gradient(at ${positions[i]}, ${color} 0px, transparent 50%)`
}}
/>
))}
</div>
);
}
```
## Animated Gradients
### Flowing Gradient Animation
```html
<div class="animate-gradient-x bg-gradient-to-r from-purple-500 via-pink-500 to-red-500 bg-[length:200%_auto]"></div>
```
```javascript
// tailwind.config.js
module.exports = {
theme: {
extend: {
animation: {
'gradient-x': 'gradient-x 3s ease infinite',
'gradient-y': 'gradient-y 3s ease infinite',
'gradient-xy': 'gradient-xy 3s ease infinite',
},
keyframes: {
'gradient-x': {
'0%, 100%': {
'background-size': '200% 200%',
'background-position': 'left center',
},
'50%': {
'background-size': '200% 200%',
'background-position': 'right center',
},
},
'gradient-y': {
'0%, 100%': {
'background-size': '200% 200%',
'background-position': 'center top',
},
'50%': {
'background-size': '200% 200%',
'background-position': 'center bottom',
},
},
'gradient-xy': {
'0%, 100%': {
'background-size': '400% 400%',
'background-position': 'left top',
},
'50%': {
'background-size': '400% 400%',
'background-position': 'right bottom',
},
},
},
},
},
};
```
### Breathing/Pulsing Gradient
```html
<div class="animate-pulse-gradient bg-gradient-to-r from-blue-500 to-purple-600"></div>
```
```javascript
// Add to tailwind.config.js
{
animation: {
'pulse-gradient': 'pulse-gradient 4s ease-in-out infinite',
},
keyframes: {
'pulse-gradient': {
'0%, 100%': { opacity: '1' },
'50%': { opacity: '0.7' },
},
},
}
```
## Glassmorphism
### Basic Glass Effect
```html
<div class="backdrop-blur-md bg-white/10 border border-white/20 rounded-2xl shadow-xl">
<!-- Content -->
</div>
```
### GRelated in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.