Generator
Presets
Examples
Syntax Guide
Tips

🎨 Gradient Generator

🖼️ Live Preview

🎨 CSS Gradient Preview

Customize using controls →

⚙️ Gradient Controls

45°
background: linear-gradient(45deg, #667eea, #764ba2);

🎨 Gradient Presets

💡 Gradient Examples

🌅 Linear Gradients

/* Basic linear gradient */ background: linear-gradient(45deg, #ff6b6b, #4ecdc4); /* Multiple colors */ background: linear-gradient( to right, #ff6b6b 0%, #feca57 50%, #48dbfb 100% );

Linear gradients create smooth transitions between colors along a straight line. Perfect for backgrounds, buttons, and modern UI elements.

🔴 Radial Gradients

/* Basic radial gradient */ background: radial-gradient(circle, #ff6b6b, #4ecdc4); /* Positioned radial */ background: radial-gradient( ellipse at center top, #ff9a9e 0%, #fecfef 100% );

Radial gradients emanate from a center point. Great for creating spotlight effects, buttons, and artistic backgrounds.

🌀 Conic Gradients

/* Basic conic gradient */ background: conic-gradient(#ff6b6b, #4ecdc4); /* Color wheel effect */ background: conic-gradient( from 0deg, red, orange, yellow, green, blue, purple, red );

Conic gradients rotate around a center point. Perfect for creating pie charts, progress rings, and unique design elements.

🔁 Repeating Gradients

/* Repeating linear */ background: repeating-linear-gradient( 45deg, #ff6b6b 0px, #ff6b6b 10px, #4ecdc4 10px, #4ecdc4 20px );

Repeating gradients create pattern effects. Useful for stripes, textures, and decorative backgrounds.

🎨 Advanced Techniques

/* Layered gradients */ background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.2) 70%), radial-gradient(circle, #ff6b6b, #4ecdc4); /* Gradient borders */ border: 2px solid transparent; background: linear-gradient(white, white) padding-box, linear-gradient(45deg, #ff6b6b, #4ecdc4) border-box;

Combine multiple gradients for complex effects. Create gradient borders, overlays, and sophisticated designs.

📱 Responsive Gradients

/* Mobile-first gradient */ background: linear-gradient(to bottom, #ff6b6b, #4ecdc4); @media (min-width: 768px) { background: linear-gradient( 135deg, #ff6b6b 0%, #feca57 50%, #4ecdc4 100% ); }

Adapt gradients for different screen sizes. Use media queries to optimize gradient appearance across devices.

📖 CSS Gradient Syntax

📐 Linear Gradient Syntax

linear-gradient( [direction | angle], color-stop1 [position], color-stop2 [position], ... )
  • Direction: to top, to right, to bottom, to left, to top right, etc.
  • Angle: 0deg (to top), 90deg (to right), 180deg (to bottom), 270deg (to left)
  • Color stops: Colors with optional position (0% to 100% or px values)

🔴 Radial Gradient Syntax

radial-gradient( [shape size at position], color-stop1 [position], color-stop2 [position], ... )
  • Shape: circle, ellipse (default)
  • Size: closest-side, farthest-side, closest-corner, farthest-corner
  • Position: center (default), top, bottom, left, right, or % values

🌀 Conic Gradient Syntax

conic-gradient( [from angle] [at position], color-stop1 [position], color-stop2 [position], ... )
  • From angle: Starting angle (0deg default)
  • Position: Center point of rotation
  • Color stops: Colors with angle positions (0deg to 360deg)

🔄 Repeating Gradients

repeating-linear-gradient(...) repeating-radial-gradient(...) repeating-conic-gradient(...)
  • Same syntax as regular gradients
  • Pattern repeats based on color stop positions
  • Infinite repetition creates seamless patterns

🎨 Color Stop Formats

/* Named colors */ red, blue, green /* Hex colors */ #ff0000, #0000ff, #00ff00 /* RGB/RGBA */ rgb(255, 0, 0), rgba(255, 0, 0, 0.5) /* HSL/HSLA */ hsl(0, 100%, 50%), hsla(0, 100%, 50%, 0.5)
  • Position values: %, px, em, rem
  • Multiple positions: red 20% 30% (color from 20% to 30%)
  • Transparency: Use rgba() or hsla() for alpha channel

📏 Browser Support

  • Linear gradients: All modern browsers
  • Radial gradients: All modern browsers
  • Conic gradients: Chrome 69+, Firefox 83+, Safari 12.1+
  • Vendor prefixes: -webkit-, -moz-, -o- (legacy support)
  • Fallbacks: Always provide solid color fallback

💡 Design Tips & Best Practices

🎨 Color Theory

  • Complementary colors: Use opposite colors on color wheel for vibrant gradients
  • Analogous colors: Adjacent colors create harmonious, subtle gradients
  • Monochromatic: Different shades of same color for elegant effects
  • Color temperature: Warm to cool transitions are visually appealing
  • Contrast: Ensure sufficient contrast for text readability

⚡ Performance Tips

  • Minimize color stops: Use fewer colors for better performance
  • Avoid complex gradients: Simple gradients render faster
  • Use CSS over images: Gradients are lighter than image files
  • Optimize for mobile: Test performance on mobile devices
  • Hardware acceleration: Use transform3d() for GPU acceleration

📱 Responsive Design

  • Test on devices: Gradients may look different on various screens
  • Adjust for orientation: Consider landscape vs portrait modes
  • Scalable gradients: Use percentage values instead of fixed pixels
  • Media queries: Adapt gradients for different screen sizes
  • Dark mode support: Provide alternative gradients for dark themes

♿ Accessibility

  • Contrast ratios: Ensure WCAG compliance for text over gradients
  • Color blindness: Test gradients with color vision simulators
  • Motion sensitivity: Avoid animated gradients that may cause issues
  • Alternative text: Provide descriptions for decorative gradients
  • Focus indicators: Ensure visible focus states over gradients

🎯 Use Cases

  • Buttons: Add depth and visual appeal to interactive elements
  • Backgrounds: Create engaging hero sections and page backgrounds
  • Cards: Enhance card designs with subtle gradient borders
  • Text effects: Apply gradients to text for striking typography
  • Loading states: Use animated gradients for skeleton screens

🛠️ Advanced Techniques

  • Gradient masks: Use gradients to create fade-out effects
  • CSS animations: Animate gradient positions for dynamic effects
  • Pseudo-elements: Layer gradients using ::before and ::after
  • Blend modes: Combine gradients with mix-blend-mode
  • SVG integration: Use gradients within SVG elements