Skip to content

Instantly share code, notes, and snippets.

@maoizm
Last active November 10, 2016 18:55
Show Gist options
  • Save maoizm/6b0190c4ae044c594bceae1da10d43ec to your computer and use it in GitHub Desktop.
Save maoizm/6b0190c4ae044c594bceae1da10d43ec to your computer and use it in GitHub Desktop.
Inner shadow SVG Filter for Illustrator CC 2014. Step 1: Effects > Document Raster Effect Settings... > Resolution: 300+ dpi; Anti-alias: ON, Preserve spot colors: ON, Step 2: Effects > SVG Filters > Apply SVG Filter > New (file icon) > Paste in the Gist & Save, Step 3: Select your object > Effect > SVG Filters > "InnerShadow" (Original source: h…
<filter id="InnerShadow">
<!-- Shadow Offset, don't make vals lower or you'll break it -->
<feOffset
dx='2'
dy='3'
/>
<!-- Shadow Blur -->
<feGaussianBlur
stdDeviation='1'
result='offset-blur'
/>
<!-- Invert the drop shadow to create an inner shadow -->
<feComposite
operator='out'
in='SourceGraphic'
in2='offset-blur'
result='inverse'
/>
<!-- Color & Opacity -->
<feFlood
flood-color='black'
flood-opacity='0.40'
result='color'
/>
<!-- Clip color inside shadow -->
<feComposite
operator='in'
in='color'
in2='inverse'
result='shadow'
/>
<!-- Put shadow over original object -->
<feComposite
operator='over'
in='shadow'
in2='SourceGraphic'
/>
</filter>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment