Created
July 5, 2019 09:51
-
-
Save rolandcoops/77dfe5c3168812ca65e1c773abc7f173 to your computer and use it in GitHub Desktop.
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
/** | |
* Add an inset border (in a single direction) to an element | |
* Examples: | |
* @include inset-border(bottom) | |
* @include inset-border(right, 3px, red) | |
*/ | |
@mixin inset-border ($direction, $width: 1px, $color: black, $opacity: 0.05) { | |
$y: if($direction == bottom, -$width, if($direction == top, $width, 0)); | |
$x: if($direction == right, -$width, if($direction == left, $width, 0)); | |
box-shadow: inset #{$x} #{$y} 0 0 rgba($color, $opacity); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment