# Material Elevation Levels

> Material-style elevation at 1, 3, 6 and 12dp, each built from umbra, penumbra and ambient shadows.

- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: material design, umbra, penumbra, ambient, dp
- Live preview: https://copy-css.com/snippets/material-elevation
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="md-surface md-elevation-1">1</div>
<div class="md-surface md-elevation-3">3</div>
<div class="md-surface md-elevation-6">6</div>
<div class="md-surface md-elevation-12">12</div>
```

## CSS

```css
.md-surface {
  --umbra: #00000033;
  --penumbra: #00000024;
  --ambient: #0000001f;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #ffffff;
  color: #616161;
  font: 500 14px system-ui, sans-serif;
}

.md-elevation-1 {
  box-shadow:
    0 2px 1px -1px var(--umbra),
    0 1px 1px 0 var(--penumbra),
    0 1px 3px 0 var(--ambient);
}

.md-elevation-3 {
  box-shadow:
    0 3px 3px -2px var(--umbra),
    0 3px 4px 0 var(--penumbra),
    0 1px 8px 0 var(--ambient);
}

.md-elevation-6 {
  box-shadow:
    0 3px 5px -1px var(--umbra),
    0 6px 10px 0 var(--penumbra),
    0 1px 18px 0 var(--ambient);
}

.md-elevation-12 {
  box-shadow:
    0 7px 8px -4px var(--umbra),
    0 12px 17px 2px var(--penumbra),
    0 5px 22px 4px var(--ambient);
}
```

## Notes

- This CSS Material Elevation Levels is 41 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses box shadows, CSS Grid and custom properties.
- Customize with: `--umbra`, `--penumbra`, `--ambient`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
