Last active
February 4, 2016 03:39
-
-
Save manabuyasuda/825a918afaea8240f507 to your computer and use it in GitHub Desktop.
box-shadowプロパティでブロックの上部に影をつくる
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
// @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