Inset shadow only on 3 sides SVG - html
I am trying to get an inset shadow only on 3 sides (top, left and right) using SVG filters. Please see the code below which adds inset shadow on all the four sides and see if you can help me modify it to get a shadow only on 3 sides. Thank you!
<svg>
<filter id="inset-shadow" x="-50%" y="-1" width="200%" height="205%">
<feComponentTransfer in=SourceAlpha>
<feFuncA type="table" tableValues="1 0 0 0 0 0 0" />
</feComponentTransfer>
<feGaussianBlur stdDeviation="5"/>
<feOffset dx="0" dy="0" result="offsetblur"/>
<feFlood flood-opacity="0.9" flood-color="rgb(20, 0, 0)" result="color"/>
<feComposite in2="offsetblur" operator="in"/>
<feComposite in2="SourceAlpha" operator="in"/>
<feMerge>
<feMergeNode in="SourceGraphic" />
<feMergeNode />
</feMerge>
</filter>
<filter id="inset-shadow1" x="-50%" y="0" width="200%" height="200%">
<feComponentTransfer in=SourceAlpha>
<feFuncA type="table" tableValues="1 0" />
</feComponentTransfer>
<feGaussianBlur stdDeviation="5"/>
<feOffset dx="0" dy="-1" result="offsetblur"/>
<feFlood flood-color="rgb(20, 0, 0)" result="color"/>
<feComposite in2="offsetblur" operator="in"/>
<feComposite in2="SourceAlpha" operator="in" />
<feMerge>
<feMergeNode in="SourceGraphic" />
<feMergeNode />
</feMerge>
</filter>
</svg>
Just adjust the filter region coordinates so that they line up with the left or top edges of the source graphic and adjust the width/height so that they're not clipping the right/bottom edge. Like so:
<svg width="800px" height="600px">
<defs>
<filter id="inset-shadow" x="0%" y="-100%" width="200%" height="205%">
<feComponentTransfer in=SourceAlpha>
<feFuncA type="table" tableValues="1 0 0 0 0 0 0" />
</feComponentTransfer>
<feGaussianBlur stdDeviation="5"/>
<feOffset dx="0" dy="0" result="offsetblur"/>
<feFlood flood-opacity="0.9" flood-color="rgb(20, 0, 0)" result="color"/>
<feComposite in2="offsetblur" operator="in"/>
<feComposite in2="SourceAlpha" operator="in"/>
<feMerge>
<feMergeNode in="SourceGraphic" />
<feMergeNode />
</feMerge>
</filter>
<filter id="inset-shadow1" x="-100%" y="0%" width="250%" height="200%">
<feComponentTransfer in=SourceAlpha>
<feFuncA type="table" tableValues="1 0" />
</feComponentTransfer>
<feGaussianBlur stdDeviation="5"/>
<feOffset dx="0" dy="-1" result="offsetblur"/>
<feFlood flood-color="rgb(20, 0, 0)" result="color"/>
<feComposite in2="offsetblur" operator="in"/>
<feComposite in2="SourceAlpha" operator="in" />
<feMerge>
<feMergeNode in="SourceGraphic" />
<feMergeNode />
</feMerge>
</filter>
</defs>
<rect filter="url(#inset-shadow)" fill="white" x="100" y="100" width="200" height="200"/>
<rect filter="url(#inset-shadow1)" fill="white" x="100" y="400" width="200" height="200"/>
</svg>
Related
How to add spread in inner shadow in svg?
I have svg rectangle, and I need to add an inset-shadow with spread, how it works in figma. rectangle with inner-shadow with spread Currently, I make a rectangle with blur and x, y position, but I don't know how to add spread for my filter for svg <defs> <filter id={`inset-shadow`} x="-50%" y="-50%" width="200%" height="200%" > <feComponentTransfer in="SourceAlpha"> <feFuncA type="table" tableValues="1 0" /> </feComponentTransfer> <feGaussianBlur stdDeviation={blur} /> <feOffset dx={x} dy={y} result="offsetblur" /> <feFlood flood-color={innerShadowColor} result="color" /> <feComposite in2="offsetblur" operator="in" /> <feComposite in2="SourceAlpha" operator="in" /> <feMerge> <feMergeNode in="SourceGraphic" /> <feMergeNode /> </feMerge> </filter> <defs> <rect x={0} y={0} width={100} height={100} fill="rgba(0,0,0,0)" stroke={'red'} strokeWidth={10} pointerEvents="none" rx={10} filter={`url(#inset-shadow)`} />
Adjust the spread by adding a feComponentTransfer to the alpha <feComponentTransfer> <feFuncA type="linear" slope="1.5"/> </feComponentTransfer> I wrote this tool to help people understand how to write filters that duplicate graphic tools shadow https://codepen.io/mullany/pen/xxPOoX
Just need add <feMorphology operator="dilate" radius={innerShadow.spread} /> <svg> <defs> <filter id={`inset-shadow`} x="-50%" y="-50%" width="200%" height="200%" > <feComponentTransfer in="SourceAlpha"> <feFuncA type="table" tableValues="1 0" /> </feComponentTransfer> <feGaussianBlur stdDeviation={0} /> <feMorphology operator="dilate" radius={10} /> <feOffset dx={0} dy={0} result="offsetblur" /> <feFlood flood-color={'red'} result="color" /> <feComposite in2="offsetblur" operator="in" /> <feComposite in2="SourceAlpha" operator="in" /> <feMerge> <feMergeNode in="SourceGraphic" /> <feMergeNode /> </feMerge> </filter> <defs> <rect x={0} y={0} width={100} height={100} fill="blue" pointerEvents="none" rx={10} filter={`url(#inset-shadow)`} /> </svg>
How to make svg sprite a regular picture?
I have such a picture for the background. It should be made normal and put in background <svg class="iphone-background__img" viewBox="0 0 991 828" fill="none" xmlns="http://www.w3.org/2000/svg"> <g filter="url(#filter0_f_479_2171)"> <path d="M726.689 447.055C636.6 301.175 399.748 283.135 292.584 292.35C204.911 229.864 267.12 198.986 369.452 84.6792C471.785 -29.6278 716.462 36.8959 857.979 37.8365C999.495 38.777 1120.33 339.695 1101.17 471.585C1082.02 603.476 839.301 629.405 726.689 447.055Z" fill="#FA00FF" fill-opacity="0.2" /> </g> <defs> <filter id="filter0_f_479_2171" x="0.806396" y="-232.258" width="1352.37" height="1059.42" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <feFlood flood-opacity="0" result="BackgroundImageFix" /> <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" /> <feGaussianBlur stdDeviation="125" result="effect1_foregroundBlur_479_2171" /> </filter> </defs> </svg>
Inset shadows on svg are just acting as an outline
I'm trying to add some inset shadows to my svg, to make it look more like this Instead of like this I tried adding an inset shadow to every path (filter="url(#inset-shadow)"), using the filter pattern I got from this answer and have listed below, but all it ends up doing is kind of giving each path an outline. You can check the code at this fiddle to see what I'm talking about. <filter id="inset-shadow"> <feComponentTransfer in="SourceAlpha" result="inset-selection"> <feFuncA type="discrete" tableValues="0 1 1 1 1 1" /> </feComponentTransfer> <feComponentTransfer in="SourceGraphic" result="original-no-fill"> <feFuncA type="discrete" tableValues="0 0 1" /> </feComponentTransfer> <feColorMatrix type="matrix" in="original-no-fill" result="new-source-alpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" /> <feGaussianBlur in="new-source-alpha" result="blur" stdDeviation="5" /> <feGaussianBlur in="new-source-alpha" result="blur2" stdDeviation="10" /> <feGaussianBlur in="new-source-alpha" result="blur3" stdDeviation="15" /> <feMerge result="blur"> <feMergeNode in="blur" mode="normal" /> <feMergeNode in="blur2" mode="normal" /> <feMergeNode in="blur3" mode="normal" /> </feMerge> <feComposite operator="in" in="inset-selection" in2="blur" result="inset-blur" /> <feComposite operator="over" in="original-no-fill" in2="inset-blur" /> </filter> How can I add inset shadows to my shapes, to make my svg look more like the image at the top of this post?
The one you are using may have been failing because it was intended for transparent paths. I didn't spend much time working out what is wrong. In any case, here's one I've created, that might be a bit easier to understand and tinker with. <svg viewBox="0 0 200 200" width="400"> <defs> <filter id="inset-shadow" x="-50%" y="-50%" width="200%" height="200%"> <!-- change this to desired inset blur colour --> <feFlood x="0%" y="0%" width="100%" height="100%" flood-color="black" result="flood"/> <!-- cut a hole out of the flood fill where out shape is --> <feComposite operator="out" in="flood" in2="SourceAlpha" result="outside" /> <!-- stack blurs to get a better effect --> <feGaussianBlur in="outside" result="blur" stdDeviation="5" /> <feGaussianBlur in="outside" result="blur2" stdDeviation="10" /> <feGaussianBlur in="outside" result="blur3" stdDeviation="15" /> <feMerge result="blur"> <feMergeNode in="blur" mode="normal" /> <feMergeNode in="blur2" mode="normal" /> <feMergeNode in="blur3" mode="normal" /> </feMerge> <!-- clip the full blur against the shape to retain just the part inside our shape --> <feComposite operator="in" in="blur" in2="SourceGraphic" result="inset-blur" /> <!-- blend with our original graphic to create the final result --> <feBlend in="SourceGraphic" in2="inset-blur" mode="multiply"/> </filter> </defs> <rect x="50" y="50" width="100" height="100" fill="linen" filter="url(#inset-shadow)"/> </svg> And here is a modified version of your fiddle with this filter applied. You may want to tinker with the stdDeviation values to adjust the size of your inset blur.
Add filter only to <image/> inside SVG, but not to the entire SVG
I have small problem with styling SVG and image inside. In SVG I have two filters. First effect (#innershadow) is to whole SVG object, second I want to apply only to image inside, because wave (#turbulance) effect spoils the whole svg object. The effect I want to achieve is sharp edges with shadows inside SVG and a blurred image inside. (SVG and #turbulance effect is animated) Is it possible? .svg { filter: url("#innershadow") url("#turbulence"); } <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 2100 1500" class="svg" x="0px" y="0px"> <filter id="innershadow" x="-50%" y="-50%" width="200%" height="200%"> <feGaussianBlur in="SourceAlpha" stdDeviation="10" result="blur"></feGaussianBlur> <feOffset dy="12" dx="12"></feOffset> <feComposite in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowDiff"></feComposite> <feFlood flood-color="#444444" flood-opacity="0.75"></feFlood> <feComposite in2="shadowDiff" operator="in"></feComposite> <feComposite in2="SourceGraphic" operator="over" result="firstfilter"></feComposite> <feGaussianBlur in="firstfilter" stdDeviation="10" result="blur2"></feGaussianBlur> <feOffset dy="-12" dx="-12"></feOffset> <feComposite in2="firstfilter" operator="arithmetic" k2="-1" k3="1" result="shadowDiff"></feComposite> <feFlood flood-color="#444444" flood-opacity="0.75"></feFlood> <feComposite in2="shadowDiff" operator="in"></feComposite> <feComposite in2="firstfilter" operator="over"></feComposite> </filter> <filter id="turbulence" x="0" y="0" width="100%" height="100%"> <feTurbulence id="sea-filter" numOctaves="0.1" seed="2" baseFrequency="0.02 0.05"></feTurbulence> <feDisplacementMap scale="20" in="SourceGraphic"></feDisplacementMap> <animate xlink:href="#sea-filter" attributeName="baseFrequency" dur="60s" keyTimes="0;0.5;1" values="0.02 0.06;0.04 0.08;0.02 0.06" repeatCount="indefinite"/> </filter> <defs> <pattern id="img1" patternUnits="userSpaceOnUse" x="0" y="0" height="100%" width="100%"> <image xlink:href="../../assets/images/backgrounds/wall-main.png" x="0" y="0" height="100%" width="100%" preserveAspectRatio="xMidYMid slice"/> </pattern> </defs> <path fill="url(#img1)" filter="url(#innershadow); url(#turbulence)" > <animate repeatCount="indefinite" attributeName="d" dur="5s" values="M382,118c100.383-77.825,276.671,59.258,448,34,65.577-9.668,196.57-94.87,294-58,83.39,31.556,92.13,116.309,174,136,108.23,26.031,207.9-110.974,286-74,61.42,29.075,37.81,132.343,110,186,47.83,35.547,81.23,14.642,132,52,51.7,38.043,88.14,109.739,82,176-6.17,66.5-50.93,79.125-60,144-10.14,72.489,46.43,113.009,26,170-29.24,81.6-166.19,63.417-218,148-53.48,87.31,29.83,209.23-26,264-44.42,43.57-141.41-7.81-226,14-93.36,24.07-100.33,81.2-194,104-111.76,27.2-217.186-20.32-268-52-70.153-43.73-98.14-121.36-180-146-83.052-25-141.572,21.65-252,46-131.847,29.08-259.955,29.4-324-40-85.126-92.25,17.341-275.707-12-436-23.665-129.279-80.6-204.706-36-294,33.223-66.508,93.383-72.786,138-128C349.1,273.539,310,173.817,382,118Z; M500,190c90.412-66.126,238.022,65.138,388,26,86.586-22.595,152.56-120.7,236-104,94.03,18.821,101.05,142.366,196,170,115.58,33.639,245.25-120.028,314-76,38.98,24.962,16.27,88.038,60,136,36.16,39.655,72.52,30.721,114,68,29.47,26.484,75.25,85.812,64,146-15.53,83.071-131.92,94.889-144,172-12.37,78.965,107.48,140.205,90,192-28.41,84.17-381.55,26.287-402,96-14.33,48.86,147.88,116.62,138,192-4.81,36.7-57.51,62.76-150,102-79.12,33.57-154.38,62.03-210,70-115.07,16.49-217.716-1.22-252-18-104.652-51.21-150.906-194.87-242-198-73.985-2.54-105.059,84.42-190,98-112.843,18.04-211.468-78.6-246-120-83.04-99.54-53.27-201.986-90-356-36.055-151.181-93.562-237.142-48-288,55.26-61.683,186.476,13.989,268-52C476.816,378.965,421.53,247.392,500,190Z; M500,238C621.91,181.654,670.957,61.767,796,44c50.491-7.174,172,34.215,306,118,95.1,59.463,151.04,109.438,226,112,134.95,4.612,236.05-139.415,334-104,60.82,21.99,62.5,101.2,122,156,35.17,32.392,126.79,61.5,136,110,9.71,51.11-75.16,127.335-96,168-43.83,85.544-49.3,148.558-38,198,22.31,97.671,140.35,163.962,124,220-15.75,53.99-135.29,38.81-192,106-67.3,79.73-5.52,200.99-70,254-55.53,45.65-226.87-25.52-290-30-68.89-4.89-132.47,22.44-214-4-84.21-27.3-124.8-95.16-216-108-84.892-11.95-141.558,31.08-236,76-153.42,72.98-293.092,83.99-342,70-117.669-33.66-209.643-140.55-242-250-37.527-126.93,29.383-207.227,24-322C126.26,691.617,18.046,548.78,70,440c17.439-36.513,83.745-86.988,188-128C347.2,276.909,413.476,277.991,500,238Z; M382,118c100.383-77.825,276.671,59.258,448,34,65.577-9.668,196.57-94.87,294-58,83.39,31.556,92.13,116.309,174,136,108.23,26.031,207.9-110.974,286-74,61.42,29.075,37.81,132.343,110,186,47.83,35.547,81.23,14.642,132,52,51.7,38.043,88.14,109.739,82,176-6.17,66.5-50.93,79.125-60,144-10.14,72.489,46.43,113.009,26,170-29.24,81.6-166.19,63.417-218,148-53.48,87.31,29.83,209.23-26,264-44.42,43.57-141.41-7.81-226,14-93.36,24.07-100.33,81.2-194,104-111.76,27.2-217.186-20.32-268-52-70.153-43.73-98.14-121.36-180-146-83.052-25-141.572,21.65-252,46-131.847,29.08-259.955,29.4-324-40-85.126-92.25,17.341-275.707-12-436-23.665-129.279-80.6-204.706-36-294,33.223-66.508,93.383-72.786,138-128C349.1,273.539,310,173.817,382,118Z "/> </path> </svg>
Since the expected results has sharp edges the #turbolence filter must be applied only to the fill. To achieve this, shape and fill must be on separate layers: an easy solution is to create a <rect> filled with your image and an animated <mask> for the sharp edge. In the CSS, then, it is possible to assign each single filter to the right element. .svg { filter: url("#innershadow"); } .svg .myfill { filter: url("#turbulence"); } <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 2100 1500" class="svg" x="0px" y="0px"> <filter id="innershadow" x="-50%" y="-50%" width="200%" height="200%"> <feGaussianBlur in="SourceAlpha" stdDeviation="10" result="blur"></feGaussianBlur> <feOffset dy="12" dx="12"></feOffset> <feComposite in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowDiff"></feComposite> <feFlood flood-color="#444444" flood-opacity="0.75"></feFlood> <feComposite in2="shadowDiff" operator="in"></feComposite> <feComposite in2="SourceGraphic" operator="over" result="firstfilter"></feComposite> <feGaussianBlur in="firstfilter" stdDeviation="10" result="blur2"></feGaussianBlur> <feOffset dy="-12" dx="-12"></feOffset> <feComposite in2="firstfilter" operator="arithmetic" k2="-1" k3="1" result="shadowDiff"></feComposite> <feFlood flood-color="#444444" flood-opacity="0.75"></feFlood> <feComposite in2="shadowDiff" operator="in"></feComposite> <feComposite in2="firstfilter" operator="over"></feComposite> </filter> <filter id="turbulence" x="0" y="0" width="100%" height="100%"> <feTurbulence id="sea-filter" numOctaves="0.1" seed="2" baseFrequency="0.02 0.05"></feTurbulence> <feDisplacementMap scale="20" in="SourceGraphic"></feDisplacementMap> <animate xlink:href="#sea-filter" attributeName="baseFrequency" dur="60s" keyTimes="0;0.5;1" values="0.02 0.06;0.04 0.08;0.02 0.06" repeatCount="indefinite"/> </filter> <defs> <pattern id="img1" patternUnits="userSpaceOnUse" x="0" y="0" height="100%" width="100%"> <image xlink:href="../../assets/images/backgrounds/wall-main.png" x="0" y="0" height="100%" width="100%" preserveAspectRatio="xMidYMid slice"/> </pattern> <mask id="myMask"> <path fill="#fff"> <animate repeatCount="indefinite" attributeName="d" dur="5s" values="M382,118c100.383-77.825,276.671,59.258,448,34,65.577-9.668,196.57-94.87,294-58,83.39,31.556,92.13,116.309,174,136,108.23,26.031,207.9-110.974,286-74,61.42,29.075,37.81,132.343,110,186,47.83,35.547,81.23,14.642,132,52,51.7,38.043,88.14,109.739,82,176-6.17,66.5-50.93,79.125-60,144-10.14,72.489,46.43,113.009,26,170-29.24,81.6-166.19,63.417-218,148-53.48,87.31,29.83,209.23-26,264-44.42,43.57-141.41-7.81-226,14-93.36,24.07-100.33,81.2-194,104-111.76,27.2-217.186-20.32-268-52-70.153-43.73-98.14-121.36-180-146-83.052-25-141.572,21.65-252,46-131.847,29.08-259.955,29.4-324-40-85.126-92.25,17.341-275.707-12-436-23.665-129.279-80.6-204.706-36-294,33.223-66.508,93.383-72.786,138-128C349.1,273.539,310,173.817,382,118Z; M500,190c90.412-66.126,238.022,65.138,388,26,86.586-22.595,152.56-120.7,236-104,94.03,18.821,101.05,142.366,196,170,115.58,33.639,245.25-120.028,314-76,38.98,24.962,16.27,88.038,60,136,36.16,39.655,72.52,30.721,114,68,29.47,26.484,75.25,85.812,64,146-15.53,83.071-131.92,94.889-144,172-12.37,78.965,107.48,140.205,90,192-28.41,84.17-381.55,26.287-402,96-14.33,48.86,147.88,116.62,138,192-4.81,36.7-57.51,62.76-150,102-79.12,33.57-154.38,62.03-210,70-115.07,16.49-217.716-1.22-252-18-104.652-51.21-150.906-194.87-242-198-73.985-2.54-105.059,84.42-190,98-112.843,18.04-211.468-78.6-246-120-83.04-99.54-53.27-201.986-90-356-36.055-151.181-93.562-237.142-48-288,55.26-61.683,186.476,13.989,268-52C476.816,378.965,421.53,247.392,500,190Z; M500,238C621.91,181.654,670.957,61.767,796,44c50.491-7.174,172,34.215,306,118,95.1,59.463,151.04,109.438,226,112,134.95,4.612,236.05-139.415,334-104,60.82,21.99,62.5,101.2,122,156,35.17,32.392,126.79,61.5,136,110,9.71,51.11-75.16,127.335-96,168-43.83,85.544-49.3,148.558-38,198,22.31,97.671,140.35,163.962,124,220-15.75,53.99-135.29,38.81-192,106-67.3,79.73-5.52,200.99-70,254-55.53,45.65-226.87-25.52-290-30-68.89-4.89-132.47,22.44-214-4-84.21-27.3-124.8-95.16-216-108-84.892-11.95-141.558,31.08-236,76-153.42,72.98-293.092,83.99-342,70-117.669-33.66-209.643-140.55-242-250-37.527-126.93,29.383-207.227,24-322C126.26,691.617,18.046,548.78,70,440c17.439-36.513,83.745-86.988,188-128C347.2,276.909,413.476,277.991,500,238Z; M382,118c100.383-77.825,276.671,59.258,448,34,65.577-9.668,196.57-94.87,294-58,83.39,31.556,92.13,116.309,174,136,108.23,26.031,207.9-110.974,286-74,61.42,29.075,37.81,132.343,110,186,47.83,35.547,81.23,14.642,132,52,51.7,38.043,88.14,109.739,82,176-6.17,66.5-50.93,79.125-60,144-10.14,72.489,46.43,113.009,26,170-29.24,81.6-166.19,63.417-218,148-53.48,87.31,29.83,209.23-26,264-44.42,43.57-141.41-7.81-226,14-93.36,24.07-100.33,81.2-194,104-111.76,27.2-217.186-20.32-268-52-70.153-43.73-98.14-121.36-180-146-83.052-25-141.572,21.65-252,46-131.847,29.08-259.955,29.4-324-40-85.126-92.25,17.341-275.707-12-436-23.665-129.279-80.6-204.706-36-294,33.223-66.508,93.383-72.786,138-128C349.1,273.539,310,173.817,382,118Z "/> </path> </mask> </defs> <rect class="myfill" fill="url(#img1)" filter="url(#innershadow) url(#turbulence)" mask="url(#myMask)" width="2100" height="1500" ></rect> </svg>
SVG filter loses colour when the SVG is hidden or external
<svg style="display:none"> <defs> <filter id="blue-glow-display-none"> <feMorphology in="SourceAlpha" operator="dilate" radius="2" /> <feGaussianBlur stdDeviation="1" result="dilated" /> <feFlood flood-color="#33ccff" /> <feComposite in2="dilated" operator="in" /> <feOffset dy="-1" /> <feMerge> <feMergeNode /> <feMergeNode in="SourceGraphic" /> </feMerge> </filter> </defs> </svg> <svg style="position: absolute; left: -9999px;"> <defs> <filter id="blue-glow-position-absolute"> <feMorphology in="SourceAlpha" operator="dilate" radius="2" /> <feGaussianBlur stdDeviation="1" result="dilated" /> <feFlood flood-color="#33ccff" /> <feComposite in2="dilated" operator="in" /> <feOffset dy="-1" /> <feMerge> <feMergeNode /> <feMergeNode in="SourceGraphic" /> </feMerge> </filter> </defs> </svg> <img src="https://www.gravatar.com/avatar/6801bf30e40c9f7972987d67e2d5e4f2?s=48&d=identicon&r=PG" style="filter: url(#blue-glow-display-none)" /> <img src="https://www.gravatar.com/avatar/6801bf30e40c9f7972987d67e2d5e4f2?s=48&d=identicon&r=PG" style="filter: url(#blue-glow-position-absolute)" /> The contents of the two SVGs are identical (save for a different ID), the only thing different is that one is hidden with display:none while the other uses position:absolute to remove it from view. display:none causes the filter to not get its colour, resulting in black. This also applies when the SVG is loaded from an external file with filter:url('/path/to/file.svg#blue-glow-external'). What's going on here, and how can I fix this issue?