Created
December 23, 2015 21:44
-
-
Save juanbrujo/af1c6ff254f20af8af1c to your computer and use it in GitHub Desktop.
Easy creation of CSS-only directional 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
// Arrow SCSS Mixin | |
// | |
// Easy creation of CSS-only directional arrows | |
// | |
// .arrow { | |
// @include arrow(100px, #f60, up); | |
// } | |
@mixin arrow($size: 10px, $color: inherit, $direction: down) { | |
display: inline-block; | |
width: 0; | |
height: 0; | |
$size: $size/2; | |
border: $size solid transparent; | |
@if $direction == down { | |
$direction: 'top'; | |
} @elseif $direction == up { | |
$direction: 'bottom'; | |
} @elseif $direction == left { | |
$direction: 'right'; | |
} @elseif $direction == right { | |
$direction: 'left'; | |
} @else { | |
$direction: "top"; | |
} | |
border-#{$direction}-color: $color; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment