Created
November 2, 2016 14:59
-
-
Save Camwyn/88ee6b5a44185a3ade2716e2a86d69fa to your computer and use it in GitHub Desktop.
CSS triangle indicator arrows
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
/** | |
* Create css triangle indicators | |
* | |
* $direction: the direction to point TO | |
* $size: desired size of the borders (always creates an equilateral triangle) | |
* $color: desired color of triangle | |
* example: @include indicator-arrow(left, $color: '#000'); | |
*/ | |
@mixin indicator-arrow($direction: top, $size: .75rem, $color: #ffffff) { | |
border: $size solid transparent; | |
@if $direction == top { | |
border-bottom: $size solid $color; | |
border-top: 0; | |
} @elseif $direction == bottom { | |
border-bottom: 0; | |
border-top: $size solid $color; | |
} @elseif $direction == left { | |
border-left: 0; | |
border-right: $size solid $color; | |
} @elseif $direction == right { | |
border-left: $size solid $color; | |
border-right: 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment