Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>'mix-blend-mode' inside an &lt;svg&gt; flex item with 'z-index'</title>
<link rel="author" title="Nikolas Zimmermann" href="mailto:nzimmermann@igalia.com">
<link rel="match" href="blending-svg-root-flex-item-z-index-ref.html">
<meta name="assert" content="A non-auto 'z-index' makes a non-positioned 'svg' flex item a CSS stacking context, which creates an isolated group, so blending descendants do not blend with the content behind the 'svg' element.">
<div style="background: green">
<div>Expected: a black square on green background.</div>
<div style="display: flex">
<svg style="width: 200px; height: 200px; z-index: 0">
<rect width="200" height="200" fill="black" style="mix-blend-mode: difference"/>
</svg>
</div>
</div>