# Ambient Color Shadow

> A shadow that takes its colors from the element itself, like the glow behind album art.

- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: colored, ambient, glow, blur, image, shadow
- Live preview: https://copy-css.com/snippets/ambient-shadow
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="ambient"></div>
```

## CSS

```css
.ambient {
  /* Works with images too: url("cover.jpg") */
  --art: linear-gradient(135deg, #f472b6, #8b5cf6 50%, #38bdf8);
  position: relative;
  isolation: isolate;
  width: 160px;
  height: 120px;
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: var(--art) center / cover;
}

/* A blurred copy sits behind and becomes the shadow */
.ambient::before {
  z-index: -1;
  inset: 14px 10px -14px;
  filter: blur(22px) saturate(1.4);
  opacity: 0.85;
}
```

## Notes

- This CSS Ambient Color Shadow is 25 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses linear gradients, filters and custom properties.
- Customize with: `--art`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
