All effectsVisual styles

Vignette

暗角

Brightness gradually fades near the edges, drawing the eye toward the center.

Compare brightness in the center and corners

Where to use it

Draw focus to the subject of a cover or photo-led composition. Place the brightest area over the subject, accounting for off-center crops. Keep text and controls above the darkening layer.

Practical example

A museum event page uses a still from a silent film as its cover. The edges taper into shadow around the actor at the left, and the screening time stays bright in a separate caption.

AI prompt

Add a Vignette to [target image]. Overlay a transparent centered radial gradient that darkens only toward the edges. Use a soft transition and tune the center to the subject. Avoid dimming labels or interface controls over the image.

Example code

Save the standalone HTML as a file and open it in your browser. It uses the same code as the preview.

View HTML
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Vignette</title>
  <style>
    :root {
      color-scheme: dark;
      --demo-bg: #171629;
      --demo-ink: #f8f5ff;
      --demo-accent: #b9a6ff;
      --demo-muted: #bfbbd3;
      font-family: system-ui, sans-serif;
      color: var(--demo-ink);
      background: var(--demo-bg);
    }

    *, *::before, *::after { box-sizing: border-box; }
    body { margin: 0; min-width: 0; }
    button, input { font: inherit; }

    .demo {
      display: grid;
      place-items: center;
      align-content: center;
      min-height: 100vh;
      padding: 14px;
      overflow: hidden;
      background: radial-gradient(ellipse at 50% 24%, #28233f, var(--demo-bg) 78%);
    }

    .demo-button {
      border: 1px solid #ffffff3d;
      border-radius: 7px;
      background: #ffffff12;
      color: var(--demo-ink);
      padding: 6px 11px;
      font-size: 12px;
      cursor: pointer;
    }

    :focus-visible {
      outline: 2px solid var(--demo-accent);
      outline-offset: 3px;
    }

    .visual-specimen {
      width: min(100%, 290px);
      height: 124px;
      display: grid;
      place-items: center;
      position: relative;
      isolation: isolate;
    }
    .vignette {
      position: relative; width: min(100%, 230px); height: 103px; display: grid; place-items: center;
      border-radius: 10px; overflow: hidden;
      background: repeating-linear-gradient(88deg, #a96780 0 15px, #c17e83 15px 30px);
    }
    .vignette i { width: 52px; aspect-ratio: 1; border-radius: 50%; background: #ffc398; box-shadow: 0 0 24px #ffbf8d; }
    .vignette::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse, transparent 24%, #1c1438a8 64%, #100e24e8 96%); }
  </style>
</head>
<body>
  <main class="demo">
    <div class="visual-specimen" aria-hidden="true"><div class="vignette"><i></i></div></div>
  </main>
</body>
</html>

Original example by UI Skills