Generator
Presets
Examples
Syntax Guide
Tips

🌟 Shadow Generator

🖼️ Live Preview
Shadow Demo

🎯 CSS Shadow Preview

Adjust shadows using controls →

⚙️ Shadow Controls

box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);

🎨 Shadow Presets

💡 Shadow Examples

🎯 Basic Drop Shadow

/* Simple drop shadow */ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Soft shadow */ box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);

Basic drop shadows add depth and elevation to elements. Use subtle shadows for modern, clean designs.

💎 Elevation Shadows

/* Material Design elevation 2 */ box-shadow: 0 1px 5px rgba(0,0,0,0.2), 0 2px 2px rgba(0,0,0,0.14); /* Material Design elevation 8 */ box-shadow: 0 5px 5px -3px rgba(0,0,0,0.2), 0 8px 10px 1px rgba(0,0,0,0.14), 0 3px 14px 2px rgba(0,0,0,0.12);

Material Design elevation system creates consistent depth hierarchy using multiple shadow layers.

🌈 Colored Shadows

/* Brand colored shadow */ box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3); /* Neon glow effect */ box-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff, 0 0 60px #00ffff;

Colored shadows add personality and brand identity. Perfect for buttons, cards, and accent elements.

📥 Inset Shadows

/* Inner shadow */ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1); /* Pressed button effect */ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 -2px 4px rgba(255, 255, 255, 0.1);

Inset shadows create pressed, recessed, or inner glow effects. Great for form inputs and interactive states.

🎭 Multiple Shadows

/* Layered shadows */ box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24), 0 0 0 1px rgba(0,0,0,0.05); /* Complex card shadow */ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.05);

Multiple shadows create sophisticated effects by combining different shadow types and intensities.

✨ Special Effects

/* Neumorphism effect */ box-shadow: 20px 20px 60px #d1d9e6, -20px -20px 60px #ffffff; /* Paper cut effect */ box-shadow: 0 4px 8px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.3);

Special shadow effects like neumorphism and paper cuts create unique visual textures and styles.

📖 CSS Box-Shadow Syntax

🔧 Basic Syntax

box-shadow: [inset] [offset-x] [offset-y] [blur-radius] [spread-radius] [color]; /* Example */ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  • inset: Optional. Creates inner shadow instead of outer
  • offset-x: Horizontal offset (positive = right, negative = left)
  • offset-y: Vertical offset (positive = down, negative = up)
  • blur-radius: Shadow blur amount (0 = sharp, higher = softer)
  • spread-radius: Shadow size expansion/contraction
  • color: Shadow color (rgba, hex, hsl, named colors)

📏 Value Details

/* All parameters */ box-shadow: inset 5px 10px 15px 2px rgba(0, 0, 0, 0.3); /* Minimum syntax */ box-shadow: 2px 2px #000;
  • Length units: px, em, rem, %, vw, vh
  • Color formats: hex (#000), rgb(0,0,0), rgba(0,0,0,0.5), hsl(), named colors
  • Multiple shadows: Separate with commas
  • Required values: offset-x, offset-y, color
  • Optional values: inset, blur-radius, spread-radius

🔄 Multiple Shadows

/* Multiple shadow layers */ box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24), inset 0 0 0 1px rgba(255,255,255,0.1); /* Order matters: first = top layer */
  • Comma separation: Each shadow separated by comma
  • Stacking order: First shadow = topmost layer
  • Performance: Limit to 3-4 shadows for best performance
  • Mix types: Combine inset and outset shadows

🎨 Color Options

/* Different color formats */ box-shadow: 0 4px 8px #000000; /* Hex */ box-shadow: 0 4px 8px rgb(0, 0, 0); /* RGB */ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* RGBA */ box-shadow: 0 4px 8px hsl(0, 0%, 0%); /* HSL */ box-shadow: 0 4px 8px hsla(0, 0%, 0%, 0.3); /* HSLA */ box-shadow: 0 4px 8px black; /* Named */
  • Transparency: Use rgba() or hsla() for opacity
  • Inherit: inherit, initial, unset keywords
  • Current color: currentColor keyword uses text color
  • Variables: CSS custom properties supported

📱 Browser Support

  • box-shadow: All modern browsers, IE9+
  • Multiple shadows: All modern browsers, IE9+
  • Inset shadows: All modern browsers, IE9+
  • Spread radius: All modern browsers, IE9+
  • Vendor prefixes: Not needed for modern browsers
  • Fallbacks: Provide solid borders for older browsers

⚡ Performance Notes

  • GPU acceleration: Use transform3d(0,0,0) for hardware acceleration
  • Blur optimization: Large blur values can impact performance
  • Animation: Animate shadow properties with care
  • Alternative: Consider filter: drop-shadow() for complex shapes
  • Mobile: Test performance on mobile devices

💡 Design Tips & Best Practices

🎨 Design Principles

  • Consistency: Use consistent shadow styles throughout your design
  • Hierarchy: Stronger shadows = higher elevation
  • Subtlety: Less is often more - avoid heavy shadows
  • Purpose: Every shadow should serve a functional purpose
  • Context: Consider lighting direction and environment
  • Brand alignment: Match shadow style to brand personality

🔧 Technical Tips

  • Performance: Limit to 3-4 shadow layers maximum
  • Blur radius: Start small (2-8px) for most use cases
  • Opacity: Use 0.1-0.3 alpha for subtle shadows
  • Color choice: Use dark grays instead of pure black
  • Animation: Transform shadows smoothly with transitions
  • Fallbacks: Provide border fallbacks for old browsers

📏 Elevation System

  • Level 0: No shadow (flush with surface)
  • Level 1: 0 1px 3px rgba(0,0,0,0.12) (slightly raised)
  • Level 2: 0 2px 6px rgba(0,0,0,0.15) (cards, buttons)
  • Level 3: 0 4px 12px rgba(0,0,0,0.15) (dialogs, popups)
  • Level 4: 0 8px 24px rgba(0,0,0,0.15) (modals, overlays)
  • Level 5: 0 16px 32px rgba(0,0,0,0.15) (highest elevation)

🎯 Use Cases

  • Cards: Subtle shadows for depth without distraction
  • Buttons: Hover state shadows for interactivity
  • Forms: Inset shadows for input fields
  • Navigation: Drop shadows for floating menus
  • Images: Frame shadows for photo galleries
  • Tooltips: Strong shadows for overlay elements

🌈 Color Guidelines

  • Natural shadows: Use dark gray (rgba(0,0,0,0.1-0.3))
  • Brand shadows: Subtle brand color with low opacity
  • Warm shadows: Slightly brown tint for warm designs
  • Cool shadows: Slightly blue tint for tech/modern designs
  • Colored elements: Shadow color should complement element color
  • High contrast: Darker shadows for better accessibility

♿ Accessibility

  • Focus states: Clear shadow outlines for keyboard navigation
  • Contrast: Ensure shadows don't reduce text readability
  • Motion sensitivity: Avoid animated shadows for sensitive users
  • High contrast mode: Test in high contrast browser modes
  • Screen readers: Shadows are decorative, don't affect content
  • Print styles: Consider shadow visibility in print media