Course contentsShow
← Web Development
Lesson 626 of 2,98211. Utility-First CSS with TailwindFree lesson

Effects: Shadow, Opacity, and Blend Modes

Add depth with shadow-*, control transparency with opacity-*, and use mix-blend-* for creative effects.

Effects: Shadow, Opacity, and Blend Modes

You'll learn how Tailwind's visual effect utilities add depth, transparency, and creative layering to your designs.

Visual effects separate flat designs from polished, professional interfaces. Tailwind provides utility classes that handle shadows, transparency, and how elements blend with content beneath them—all without writing custom CSS.

Shadow Utilities

Shadows create the illusion of depth and elevation. Tailwind offers a scale of shadow utilities:

  • shadow-sm - Subtle shadow for slight elevation
  • shadow - Default shadow (medium depth)
  • shadow-md, shadow-lg, shadow-xl, shadow-2xl - Progressively deeper shadows
  • shadow-inner - Inset shadow effect
  • shadow-none - Remove shadows

Example: A button might use shadow-lg to appear raised, then shadow-xl on hover to simulate lifting closer to you.

Opacity Utilities

Control transparency with opacity-* classes ranging from opacity-0 (invisible) to opacity-100 (fully opaque), in increments of 5 or 10:

opacity-0, opacity-25, opacity-50, opacity-75, opacity-100

Think of it like: Adjusting the transparency slider in photo editing software—0% means see-through, 100% means solid.

Blend Modes

The mix-blend-* utilities control how an element's colors interact with layers behind it—similar to Photoshop blend modes:

  • mix-blend-normal - Default (no blending)
  • mix-blend-multiply, mix-blend-screen, mix-blend-overlay - Color blending effects
  • mix-blend-difference - Inverts based on background

These create artistic effects when overlaying text on images or combining graphic elements.

Key Takeaway: Use shadow-* to add depth, opacity-* to control transparency levels, and mix-blend-* to create sophisticated color interactions—all with single utility classes that keep your markup clean and predictable.