Last active
August 29, 2015 14:13
-
-
Save mohamnag/e60ccbe3ee93432e7ca0 to your computer and use it in GitHub Desktop.
Adds a shadowy border on top of the element using the :before pseudo element, you may apply the last three lines directly to the element itself if you dont need additional background on the same element.
This file contains hidden or 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
@mixin shadow-border-top($size: 10px) { | |
&:before { | |
content: ""; | |
width: 100%; | |
height: $size; | |
display: block; | |
top: 0; | |
position: absolute; | |
background: linear-gradient(to top, transparent 0%, rgba(0, 0, 0, 0.09) 75%, white 88%, white 100%) no-repeat; | |
background-position: 0 -$size / 2; | |
background-size: 100% $size; | |
} | |
} | |
@mixin shadow-border-bottom($size: 10px) { | |
&:after { | |
content: ""; | |
width: 100%; | |
height: $size; | |
display: block; | |
bottom: 0; | |
position: absolute; | |
background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.09) 75%, white 88%, white 100%) no-repeat; | |
background-position: 0 $size / 2; | |
background-size: 100% $size; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment