Last active
December 1, 2017 15:51
-
-
Save kieran23101/2b169a8791f3e3923eb835e9f26bd7ad to your computer and use it in GitHub Desktop.
Mixin for CSS triangles
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 arrow($size, $color, $distanceFromLeft, $position, $InsideOrOut) { | |
&:after { | |
content: ""; | |
width: 0px; | |
height: 0px; | |
border-left: $size solid transparent; | |
border-right: $size solid transparent; | |
@if $position == top and $InsideOrOut == inside { | |
border-top: $size solid $color; | |
top: 0; | |
} | |
@else if $position == top and $InsideOrOut == outside { | |
border-bottom: $size solid $color; | |
top: -$size; | |
} | |
@else if $position == bottom and $InsideOrOut == inside { | |
border-bottom: $size solid $color; | |
bottom: 0; | |
} | |
@else if $position == bottom and $InsideOrOut == outside { | |
border-top: $size solid $color; | |
bottom: - $size; | |
} | |
position: absolute; | |
left: $distanceFromLeft; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment