Skip to content

Instantly share code, notes, and snippets.

@darren131
Created July 5, 2012 05:06
Show Gist options
  • Save darren131/3051475 to your computer and use it in GitHub Desktop.
Save darren131/3051475 to your computer and use it in GitHub Desktop.
imageless arrows
// you can pass it only the following direction keywords:
// up, down, left, right
//
// HOW TO USE
//
// $direction: up;
// $color: #c00;
// $size: 20px;
// .class {
// $include arrow($direction, $color, $size);
// }
//
@mixin arrow($direction, $color, $size) {
display: inline-block;
width: 0;
height: 0;
@if $direction == up {
border-left: $size solid transparent;
border-right: $size solid transparent;
border-bottom: $size solid $color;
} @else if $direction == down {
border-left: $size solid transparent;
border-right: $size solid transparent;
border-top: $size solid $color;
} @else if $direction == right {
border-top: $size solid transparent;
border-bottom: $size solid transparent;
border-left: $size solid $color;
} @else if $direction == left {
border-top: $size solid transparent;
border-bottom: $size solid transparent;
border-right: $size solid $color;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment