Created
February 7, 2013 09:03
-
-
Save colegeissinger/4729693 to your computer and use it in GitHub Desktop.
Fancy CSS3 Box Shadows with SCSS. Requires SASS and Compass to be installed.
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
// Import some requiredness from compass | |
@import "compass/reset"; | |
@import "compass/css3/box-shadow"; | |
@import "compass/css3/transform"; | |
// Define our mixin | |
@mixin fancy-box-shadow($color:rgba(0,0,0,.5), $left_shadow:-4deg, $right_shadow:4deg, $bottom:8px) { | |
position:relative; | |
background:#fff; | |
&:before, &:after { | |
position:absolute; | |
width:47%; | |
max-width:50%; | |
top:80%; | |
left:10px; | |
bottom:$bottom; | |
content:''; | |
z-index:-1; | |
@include single-box-shadow($color, 0, 15px, 15px); | |
@include rotate($left_shadow); | |
} | |
&:after { | |
right:10px; | |
left:auto; | |
@include rotate($right_shadow); | |
} | |
} | |
// Working example. Not required, just here for show. | |
#featured-video { | |
width:420px; | |
height:308px; | |
margin:5% auto; | |
@include fancy-box-shadow(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment