Last active
December 17, 2015 11:59
-
-
Save thamas/5606884 to your computer and use it in GitHub Desktop.
SCSS mixin to display inner shadow on hover an image link
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
// http://bavotasan.com/2011/adding-inset-shadow-to-image-css3/ | |
@mixin img-link-inner-shadow { | |
a { | |
float: left; | |
position: relative; | |
max-width: 100%; | |
@include border-radius(10px); | |
} | |
a:hover::before, | |
a:active::before { | |
content: ""; | |
position: absolute; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
@include single-box-shadow(rgba(0, 0, 0, .5), 0px, 0px, 1px, 6px, true); | |
@include border-radius(10px); | |
} | |
img { | |
display: block; | |
float: left; | |
} | |
} | |
// It could be more sophisticated adding some parameters | |
// But somtime it could be overkill, here is a simpler solution | |
// http://trentwalton.com/2010/11/22/css-box-shadowinset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment