Skip to content

Instantly share code, notes, and snippets.

@MaxGraey
Created September 10, 2017 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaxGraey/e51ce07a99f0105984c65fb1a6f36bfa to your computer and use it in GitHub Desktop.
Save MaxGraey/e51ce07a99f0105984c65fb1a6f36bfa to your computer and use it in GitHub Desktop.
Example of SVG and CSS Shadows comparision
<!--
SVG Filters supports by all browsers:
http://caniuse.com/#search=SVG%20filters
Advantages:
- Performance (CSS) Filters usually has GPU acceleration
- Support transpatent areas
Disantages:
- Hasn't inset shadows and Spread Radius
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SVG vs CSS Shadows</title>
<style>
div.triangle {
margin: 25px;
border: 50px solid transparent;
border-left-color: #f06;
}
div.triangle.drop {
-webkit-filter: drop-shadow(5px 5px 10px gray);
filter: drop-shadow(5px 5px 10px gray);
}
div.triangle.box {
box-shadow: 5px 5px 10px gray;
}
</style>
</head>
<body>
<div class="triangle drop"></div>
<div class="triangle box"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment