METABYTE
Back to articles

Colored Shadow Penumbra: When Shadows Get a Glow-Up

A CSS-only trick to create colorful, gradient shadows without JavaScript — perfect for adding that neon vibe.

7 mai 20262 min read
Colored Shadow Penumbra: When Shadows Get a Glow-Up

Designers who've always wanted to ditch boring gray shadows but thought "that's not physically accurate" — rejoice. Colored Shadow Penumbra is a technique that lets you create colorful shadows with smooth penumbra transitions using nothing but CSS. No JS, no canvas, just pseudo-elements and gradients.

Here's the gist: you stack multiple shadows with different colors and blur amounts, and use mix-blend-mode to blend them. The result? A shadow that looks like it's been dipped in a rainbow. Change the gradient — the shadow updates automatically. It's like having a chameleon for a shadow, minus the awkward silence when it changes color mid-conversation.

Of course, you could just use a PNG, but where's the fun in that? This method is great for accent elements: hero sections, call-to-action buttons, or anything that needs a bit of "wow." Just don't go overboard — too many blurred layers and your browser will start sweating. Use it like hot sauce: a little goes a long way.

.shadow::after {
  content: '';
  position: absolute;
  width: 100%; height: 100%;
  background: linear-gradient(45deg, red, blue);
  filter: blur(20px);
  opacity: 0.5;
  z-index: -1;
}

Now your element casts a purple-red glow, perfect for a cyberpunk landing page or just to annoy the "realistic shadows only" crowd.

METABYTE studio comment: Colored shadows are eye candy, but remember: accessibility first. If your text gets lost in the glow, users won't stick around to admire your CSS wizardry.

NEXT STEP

Liked the approach?

We apply the same principles to client projects: AI, automation, products that don't die after launch.