Skip to content

Instantly share code, notes, and snippets.

@colegeissinger
Created February 7, 2013 09:03
Show Gist options
  • Save colegeissinger/4729693 to your computer and use it in GitHub Desktop.
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.
// 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