Skip to content

Instantly share code, notes, and snippets.

@jonathanhudak
Created October 17, 2013 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanhudak/7033217 to your computer and use it in GitHub Desktop.
Save jonathanhudak/7033217 to your computer and use it in GitHub Desktop.
triangle mixins
@mixin triangle($direction:up, $color:#000, $size:100px) {
@if($direction == up) {
border-color: transparent transparent $color;
border-style: solid;
border-width: 0 $size $size;
height: 0;
width: 0;
}
@if($direction == down) {
border-color: $color transparent transparent transparent;
border-style: solid;
border-width: $size;
height:0;
width:0;
}
@if($direction == left) {
border-color: transparent $color transparent transparent;
border-style: solid;
border-width: $size $size $size 0;
height: 0;
width: 0;
}
@if($direction == right) {
border-color: transparent transparent transparent $color;
border-style: solid;
border-width: $size 0 $size $size;
height:0;
width:0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment