Why does a drop-shadow get cutoff when applying it to the path of an svg?

I have two identical svgs. One having a drop-shadow applied to the <svg> element and another with the same drop-shadow applied to the <path> element inside the <svg> element. The svg with the drop-shadow applied to the <svg> element is fine. The other however get's cutoff. My question is why? I've fiddled with filter region, viewbox, and instead of css drop-shadow using feDropShadow/feGaussianBlur inside <filter>, but nothing quite works as desired. I'm quite new to working with svg's though. Here is the example on codepen. https://codepen.io/healspls/pen/bGXOKEy Thank you for taking the time.
No description
8 Replies
ἔρως
ἔρως7d ago
because that's where the svg ends
No description
Bighealspls
BighealsplsOP7d ago
Can the svg element dropshadow extend beyond the view-box while the path element dropshadow cannot?
ἔρως
ἔρως7d ago
no increase the viewbox and move the path that's all you can do
capt_uhu
capt_uhu7d ago
I remember getting something like this to work once by playing with CSS overflow on the SVG
ἔρως
ἔρως7d ago
if that works, sounds like a bug
capt_uhu
capt_uhu7d ago
Works across Chrome and Firefox. Not sure why this would be a bug. Default for SVG is overflow: hidden; just change it to visible to show the overflow. Here's the SVG overflow attribute article that also mentions CSS overflow: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/overflow
ἔρως
ἔρως7d ago
because it's showing stuff outside the viewbox
capt_uhu
capt_uhu6d ago
re-downloaded webkitForWindows last night for something so checked overflow quick on the pen and overflow was a no go. I'm not super confident that this means for sure it wont work on Safari on an actual apple device though. Probably worth confirming on real hardware if you're looking to use. Looks like overflow on SVG is part of SVG 2.1 which is in an editors draft so wouldn't a surprise if not everyone supported it yet: https://svgwg.org/svg2-draft/render.html#OverflowAndClipProperties
Want results from more Discord servers?
Add your server