Skip to content

Instantly share code, notes, and snippets.

@wereHamster
Created March 23, 2011 08:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wereHamster/882809 to your computer and use it in GitHub Desktop.
Save wereHamster/882809 to your computer and use it in GitHub Desktop.
/* Stupid compass box-shadow mixin doesn't support multiple shadows... */
@mixin box-shadow-2($first, $second) {
$full: $first, $second;
@include experimental(box-shadow, $full, -moz, -webkit, -o, not -ms, not -khtml, official);
}
@mixin curl-effect-shadow($corner) {
z-index: -1;
position: absolute;
background: transparent;
width: 40%;
height: 40%;
content: '';
bottom: 0;
#{$corner}: 0;
$mul: +1;
@if $corner == left { $mul: -1; }
@include apply-origin($corner bottom);
@include transform(1, $mul * 10deg, 0, 0, $mul * 20deg);
@include box-shadow(rgba(0, 0, 0, 0.3), 0, 8px, 16px);
}
@mixin curl-effect($background: #ffffff) {
position: relative;
background: $background;
border: 1px solid lighten($background, 10%);
@include box-shadow-2(
0 1px 4px rgba(0, 0, 0, 0.27),
0 0 60px rgba(0, 0, 0, 0.10) inset
);
&:before {
@include curl-effect-shadow(left);
}
&:after {
@include curl-effect-shadow(right);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment