Skip to content

Instantly share code, notes, and snippets.

@d3signerd
Created February 21, 2014 15:57
Show Gist options
  • Save d3signerd/9136871 to your computer and use it in GitHub Desktop.
Save d3signerd/9136871 to your computer and use it in GitHub Desktop.
SCSS Arrow Mixins
/*
*
* Arrow Mixins
*
*/
/* Settings */
$arrow-color: $FFFFFF;
$arrow-up: 'up';
$arrow-right: 'right';
$arrow-down: 'down';
$arrow-left: 'left';
$arrow-width: 5px;
/* Mixins */
@mixin arrow ( $direction: $arrow-right , $width: $arrow-width , $color: $arrow-color ) {
width: 0;
height: 0;
// Up
@if $direction == $arrow-up {
border-left: $width solid transparent;
border-right: $width solid transparent;
border-bottom: $width solid $color;
// Right
} @else if $direction == $arrow-right {
border-top: $width solid transparent;
border-bottom: $width solid transparent;
border-left: $width solid $color;
// Down
} @else if $direction == $arrow-down {
border-left: $width solid transparent;
border-right: $width solid transparent;
border-top: $width solid $color;
// Left
} @else if $direction == $arrow-left {
border-top: $width solid transparent;
border-bottom: $widthpx solid transparent;
border-right:10$width solid $color;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment