Created
September 16, 2013 22:14
-
-
Save zenman/6587331 to your computer and use it in GitHub Desktop.
Super fancy SCSS mixin for super fancy shadows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*------------------------------------*\ | |
//Curled Drop Shadow | |
\*------------------------------------*/ | |
//Usage: Requires parent element and then attach @mixin fancy-box-shadow($args); | |
//Descript: WARNING!!!!!!!!!!! If you use this attach z-index 0 to your body. For whatever reason if you don't attach a z-index to the body the shadow refuses to show up. | |
@mixin fancy-box-shadow($type, $params: 0px 10px 15px, $color: #000){ | |
@if $type == lifted { | |
padding:1em; | |
margin:2em 10px 4em; | |
background:#fff; | |
&:before, | |
&:after { | |
content:""; | |
position:absolute; | |
z-index:-2; | |
bottom:15px; | |
left:10px; | |
width:50%; | |
height:20%; | |
max-width:300px; | |
max-height:100px; | |
-webkit-box-shadow:$params $color; | |
-moz-box-shadow:$params $color; | |
box-shadow:$params $color; | |
@include transform(rotate(-3deg)); | |
} | |
&:after { | |
right:10px; | |
left:auto; | |
@include transform(rotate(3deg)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment