# Dark Glass Card

> A smoky dark glass card with a light-catching gradient edge drawn with a masked pseudo-element.

- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: glassmorphism, dark mode, frosted, gradient border, mask, neon
- Live preview: https://copy-css.com/snippets/dark-glass-card
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<article class="glass-dark">
  <span class="glass-dark-icon" aria-hidden="true">✦</span>
  <h3>Night mode</h3>
  <p>Smoked glass that still lets the color glow through.</p>
</article>
```

## CSS

```css
.glass-dark {
  position: relative;
  width: 220px;
  padding: 22px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.45);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: #e2e8f0;
  font-family: system-ui, sans-serif;
}

.glass-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.05) 40%, rgba(255, 255, 255, 0.05) 60%, rgba(255, 255, 255, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

.glass-dark-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #67e8f9;
  font-size: 20px;
}

.glass-dark h3 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 17px;
}

.glass-dark p {
  margin: 0;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.5;
}
```

## Notes

- This CSS Dark Glass Card is 49 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses linear gradients, backdrop filters, masks and CSS Grid.
- backdrop filters: Includes the -webkit- prefix for older Safari.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
