Docs / Mix Blend Mode

Mix Blend Mode

vel-src: effects.css

Utilities for controlling how an element's content blends with its background.

ClassProperties
vel-mix-normalmix-blend-mode: normal
vel-mix-multiplymix-blend-mode: multiply
vel-mix-screenmix-blend-mode: screen
vel-mix-overlaymix-blend-mode: overlay
vel-mix-darkenmix-blend-mode: darken
vel-mix-lightenmix-blend-mode: lighten
vel-mix-color-dodgemix-blend-mode: color-dodge
vel-mix-color-burnmix-blend-mode: color-burn
vel-mix-hard-lightmix-blend-mode: hard-light
vel-mix-soft-lightmix-blend-mode: soft-light
vel-mix-differencemix-blend-mode: difference
vel-mix-exclusionmix-blend-mode: exclusion

Examples

Blend modes on overlapping elements

screen

multiply

difference

overlay

example.html
<div style="display:flex;gap:16px;padding:1rem;background:#060b17;flex-wrap:wrap;">
  <div style="position:relative;width:80px;height:80px;text-align:center;">
    <div style="position:absolute;width:60px;height:60px;border-radius:50%;background:#7c5cfc;top:0;left:0;"></div>
    <div class="vel-mix-screen" style="position:absolute;width:60px;height:60px;border-radius:50%;background:#38bdf8;top:20px;left:20px;"></div>
    <p style="position:absolute;bottom:-20px;left:0;right:0;color:#64748b;font-size:0.65rem;">screen</p>
  </div>
  <div style="position:relative;width:80px;height:80px;text-align:center;">
    <div style="position:absolute;width:60px;height:60px;border-radius:50%;background:#7c5cfc;top:0;left:0;"></div>
    <div class="vel-mix-multiply" style="position:absolute;width:60px;height:60px;border-radius:50%;background:#f97316;top:20px;left:20px;"></div>
    <p style="position:absolute;bottom:-20px;left:0;right:0;color:#64748b;font-size:0.65rem;">multiply</p>
  </div>
  <div style="position:relative;width:80px;height:80px;text-align:center;">
    <div style="position:absolute;width:60px;height:60px;border-radius:50%;background:#7c5cfc;top:0;left:0;"></div>
    <div class="vel-mix-difference" style="position:absolute;width:60px;height:60px;border-radius:50%;background:#34d399;top:20px;left:20px;"></div>
    <p style="position:absolute;bottom:-20px;left:0;right:0;color:#64748b;font-size:0.65rem;">difference</p>
  </div>
  <div style="position:relative;width:80px;height:80px;text-align:center;">
    <div style="position:absolute;width:60px;height:60px;border-radius:50%;background:#7c5cfc;top:0;left:0;"></div>
    <div class="vel-mix-overlay" style="position:absolute;width:60px;height:60px;border-radius:50%;background:#ec4899;top:20px;left:20px;"></div>
    <p style="position:absolute;bottom:-20px;left:0;right:0;color:#64748b;font-size:0.65rem;">overlay</p>
  </div>
</div>