I suspect that some trig calculations could make this very general.
Created
May 6, 2011 09:10
-
-
Save chriseppstein/958668 to your computer and use it in GitHub Desktop.
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
@mixin bendy-shadow($width, $angle: 5deg, $color: rgba(#333, 0.5)) { | |
position: relative; | |
z-index: 1; | |
@include box-shadow(0 10px 5px -5px $color); | |
&:before, &:after { | |
content: ""; | |
position: absolute; | |
bottom: 2px; | |
width: $width / 2; | |
height: 10px; | |
z-index: -1; | |
@include box-shadow(0 10px 10px 1px $color); | |
} | |
&:before { | |
left: 10px; | |
@include rotate(-$angle); | |
} | |
&:after { | |
right: 10px; | |
@include rotate($angle); | |
} | |
} |
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
#photo-widget { | |
.no-boxshadow &, .no-csstransforms & { | |
.viewport { | |
padding-bottom: image-height('local/provider/photo-shadow-left.png') + 1px; | |
background: transparent image-url('local/provider/photo-shadow-left.png') no-repeat bottom left; | |
} | |
.shadow { | |
background: transparent image-url('local/provider/photo-shadow-right.png') no-repeat bottom right; | |
height: image-height('local/provider/photo-shadow-right.png'); | |
width: image-width('local/provider/photo-shadow-right.png'); | |
position: absolute; | |
bottom: 0; | |
right: 0; | |
} | |
} | |
.boxshadow.csstransforms & { | |
.viewport { | |
@include bendy-shadow(250px); | |
} | |
.shadow { | |
display: none; | |
} | |
} | |
} |
OK, nm. I am using the indented syntax, so of course this won't work as-is.
This is sexy. Thanks for sharing boss!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shouldn't I just be able to copy/paste this mixin into my sass file and it work? I'm getting a syntax error on line 1: