SVG Long Shadow - html

So I've got this svg of a code symbol on my website and I want to add a long shadow to the svg. I've tried using filter: drop-shadow() but that only allows for one offset, I'm looking for the same feature as box-shadow where I can add multiple offsets to make a long shadow.
I'm using Sass for my styling and have made a function that makes long shadows for boxes and then is called with a mixin but unfortunately I can't find how to do the same with svg.
Anyone got any work arounds?

Not entirely sure what you mean by a long shadow - but I'm assuming that you're looking for an extrusion? You can do that by doing multiple offsets and in a SVG filter - and then referencing that filter from CSS.
.icon {
width: 50px;
height: 50px;
filter: url(#long-shadow);
}
<img class="icon" src="https://material.io/tools/icons/static/ic_icons_192px_light.svg">
<svg width="0px" height="0px">
<defs>
<filter id="long-shadow" x="0%" width="130%" y="0%" height="130%">
<feOffset dx="1" dy="1" result="layer1" in="SourceAlpha"/>
<feOffset dx="1" dy="1" result="layer2" />
<feOffset dx="1" dy="1" result="layer3" />
<feOffset dx="1" dy="1" result="layer4" />
<feOffset dx="1" dy="1" result="layer5" />
<feOffset dx="1" dy="1" result="layer6" />
<feOffset dx="1" dy="1" result="layer7" />
<feMerge>
<feMergeNode in="layer1"/>
<feMergeNode in="layer2"/>
<feMergeNode in="layer3"/>
<feMergeNode in="layer4"/>
<feMergeNode in="layer5"/>
<feMergeNode in="layer6"/>
<feMergeNode in="layer7"/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
</defs>
</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>

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.

SVG used as image is blury on iphone

I am using an SVG based 64 as an image source.
This looks fine on a desktop, but when I view on my mobile (Iphone XS MAX - Safari), this looks really blury.
See below fiddle which has two images, one is just the raw SVG, and the second is the SVG base 64 used as source.
https://jsfiddle.net/t0e4sjw3/
You can see from the screenshot below, that the one used as an image is very blury and the filter seems to be a lot bigger than on the first image.
Is there any way to stop this?
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
width="110"
height="110"
>
<defs>
<filter id="dropShadow">
<feGaussianBlur in="SourceAlpha" stdDeviation="1" />
<feOffset dx="0" dy="0" result="offsetblur" />
<feFlood flood-color="black" />
<feComposite in2="offsetblur" operator="in" />
<feMerge>
<feMergeNode />
<feMergeNode in="SourceGraphic" />
</feMerge>
</filter>
</defs>
<image
xmlns="http://www.w3.org/2000/svg"
width="110"
height="110"
filter="url(#dropShadow)"
preserveAspectRatio="none"
xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2NCIgaGVpZ2h0PSI2NCI+PHBhdGggZmlsbD0iI0VEQkE2RiIgZD0iTTU0Ljk1NSAxOC4yMTZjLjIxNi0yLjU3MiA4LjQ0Ni0xLjg0IDQuNDYzLTEuMTQzLTMuMjY3LjU3Mi00LjY3MiAzLjYyLTQuNDYzIDEuMTQzek00OS4yMTIgMjEuNDMyYzUuMTctMS4zNjcgMS40MDgtMjMuODg2IDEuMDkzLTEyLjY3OC0uMjYgOS4yMDItNi4wNjggMTMuOTk1LTEuMDkzIDEyLjY3OHoiLz48bGluZWFyR3JhZGllbnQgaWQ9ImEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMjQuMzY1IiB5MT0iMjEuODk5IiB4Mj0iMzguMjk2IiB5Mj0iNjMuNDA3Ij48c3RvcCBvZmZzZXQ9Ii4yNDgiIHN0b3AtY29sb3I9IiNlZGJhNmYiLz48c3RvcCBvZmZzZXQ9Ii40OSIgc3RvcC1jb2xvcj0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RJZ05Ea3VPVEV5WXk0eU9ESXRMakkzTlMweUxqRXdPUzQ1TlRjdE5DNDBNVGd1TXprNUlERXVNall5TGpjMklETXVOemd1TWpJMUlEUXVOREU0TFM0ek9UbDZUVFl1TWpZMklEUTVMakl4TkdNdU1UUXlMUzR5TWprdE1TNHhPRGt1TmpRM0xUSXVOamc0TFM0eE9ESXVPRGMyTGpnNUlESXVNemN1TmprM0lESXVOamc0TGpFNE1ucE5NVFF1TkRBeUlEVTNMamswTW1NdU5UVXRMakkxT0MwekxqRTROUzB1TVRnMExUVXVNek16TFRNdU5ETTVMamM1TnlBeUxqWTBOaUEwTGpBNU5DQTBMakF4T1NBMUxqTXpNeUF6TGpRek9YcE5PQzQyTkRZZ05UTXVOVEEzWXk0ek5qa3RMakUzTWkweUxqRXpOeTB1TVRJeUxUTXVOVGM0TFRJdU16QTNMalV6TlNBeExqYzNOaUF5TGpjME5pQXlMalk1TnlBekxqVTNPQ0F5TGpNd04zcE5Nell1TVRRMElETTFMamcwTjJNdE1pNDRNaklnTmk0eE16TXRNVEl1TkRjNUlEa3VOVFE1TFRFMExqUTVNeUF4Tnk0eU9ETWdOUzQ0TVMwM0xqVTRNaUF4TlM0d01ERXRNVEF1T0RRNElERTBMalE1TXkweE55NHlPRE42VFRJd0xqYzNOeUF5Tnk0d01qUmpNUzR4TlRRdU1UZzRMVFV1TXpVMElESXVNVEl0Tmk0ME1UUWdPUzQxTlRndExqYzNOaTAxTGpVeU1TQXpMamM1T1MwNUxqazROQ0EyTGpReE5DMDVMalUxT0hwTk1URXVOVGsySURJNUxqYzJPV011TnpNeUxqQXhPUzB5TGpVME5pQXhMamN0TVM0d05UWWdOaTR5TXpJdE1pNHdNalV0TXk0eU16Z3RMall3TXkwMkxqSTNOU0F4TGpBMU5pMDJMakl6TW5vaUx6NDhMM04yWno0PSINCiAgICBpZD0idnNnRHlwIg0KICAvPg0KPC9zdmc+DQo=" alt="snail" />

SVG filter with variable?

I have an SVG glow filter implemented like so:
<filter id="outline">
<feMorphology in="SourceAlpha" operator="dilate" radius="2"></feMorphology>
<feGaussianBlur stdDeviation="1" result="dilated"></feGaussianBlur>
<feFlood style="flood-color: #RRGGBB"></feFlood>
<feComposite in2="dilated" operator="in"></feComposite>
<feMerge>
<feMergeNode></feMergeNode>
<feMergeNode in="SourceGraphic"></feMergeNode>
</feMerge>
</filter>
This works nicely, but only for one specific glow colour.
I would like to be able to have an arbitrary glow colour, in some way passing a variable in to the flood-color property.
I have tried using currentColor, but this seems to be the colour as it is when the filter is defined, not when it is applied.
I could define a filter for each colour (there will be a limited number of them) but it would be nicer - and certainly more space-efficient - to only need to define it once. Is this possible and if so how?
In the next example the flood-color is the current color. If you click the svg element you toggle the class "blue". The color of the svg element is red the color of the .blue is blue.
When you toggle the class blue the filter is changing the flood color.
test.addEventListener("click",()=>{
test.classList.toggle("blue")
})
svg {
border: 1px solid;
font-size: 40px;
text-anchor: middle;
dominant-baseline: middle;
width:100px;
color:red;
}
.blue{color:blue;}
<svg id="test" viewBox="0 0 100 70">
<filter id="outline">
<feMorphology in="SourceAlpha" operator="dilate" radius="2"></feMorphology>
<feGaussianBlur stdDeviation="1" result="dilated"></feGaussianBlur>
<feFlood style="flood-color: currentcolor"></feFlood>
<feComposite in2="dilated" operator="in"></feComposite>
<feMerge>
<feMergeNode></feMergeNode>
<feMergeNode in="SourceGraphic"></feMergeNode>
</feMerge>
</filter>
<text x="50" y="40" filter="url(#outline)">click</text>
</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?