# Dark Mode Elevation

> Elevation for dark themes, where higher surfaces get lighter instead of relying on shadows alone.

- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: dark theme, surface, lighter, overlay, levels
- Live preview: https://copy-css.com/snippets/dark-mode-elevation
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="dm-surface dm-level-1">1</div>
<div class="dm-surface dm-level-2">2</div>
<div class="dm-surface dm-level-3">3</div>
<div class="dm-surface dm-level-4">4</div>
```

## CSS

```css
/* Page background: #121212 */
.dm-surface {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  color: #e0e0e0;
  font: 600 14px system-ui, sans-serif;
}

.dm-level-1 {
  background: #1e1e1e;
  box-shadow: 0 1px 2px #00000066;
}

.dm-level-2 {
  background: #242424;
  box-shadow: 0 2px 6px #00000080;
}

.dm-level-3 {
  background: #2c2c2c;
  box-shadow: 0 6px 14px #00000099;
}

.dm-level-4 {
  background: #383838;
  box-shadow: 0 12px 28px #000000b3;
}
```

## Notes

- This CSS Dark Mode Elevation is 30 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
