Skip to content

Instantly share code, notes, and snippets.

@minsu
Created March 3, 2019 13:32
Show Gist options
  • Save minsu/1e9e9dc70629a5bc14eaf2f95c27d773 to your computer and use it in GitHub Desktop.
Save minsu/1e9e9dc70629a5bc14eaf2f95c27d773 to your computer and use it in GitHub Desktop.
dropshadow (SVG)
<filter id="dropshadow" height="130%">
<feGaussianBlur in="SourceAlpha" stdDeviation="3"/> <!-- stdDeviation is how much to blur -->
<feOffset dx="2" dy="2" result="offsetblur"/> <!-- how much to offset -->
<feComponentTransfer>
<feFuncA type="linear" slope="0.5"/> <!-- slope is the opacity of the shadow -->
</feComponentTransfer>
<feMerge>
<feMergeNode/> <!-- this contains the offset blurred image -->
<feMergeNode in="SourceGraphic"/> <!-- this contains the element that the filter is applied to -->
</feMerge>
</filter>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment