Skip to content

Instantly share code, notes, and snippets.

@manabuyasuda
Last active February 4, 2016 03:39
Show Gist options
  • Save manabuyasuda/825a918afaea8240f507 to your computer and use it in GitHub Desktop.
Save manabuyasuda/825a918afaea8240f507 to your computer and use it in GitHub Desktop.
box-shadowプロパティでブロックの上部に影をつくる
// @desc ブロック要素内の上部に影をつくります。
// e.g. scss
// .shadow {
// @include shadow();
// }
//
// e.g. html
// <div class="shadow">
// <img/>
// </div>
//
@mixin shadow($color: #000, $height: 10px, $blur: 20px, $spread: 0) {
position: relative;
overflow: hidden;
&:before {
content: "";
position: absolute;
bottom: 100%;
width: 100%;
height: $height;
box-shadow: 0 $height $blur $spread $color;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment