Skip to content

Instantly share code, notes, and snippets.

@Ch00by
Created August 16, 2011 15:32
Show Gist options
  • Save Ch00by/1149369 to your computer and use it in GitHub Desktop.
Save Ch00by/1149369 to your computer and use it in GitHub Desktop.
Triangle Shape Mixin for Scss
@mixin triangle($direction-h, $direction-w, $color, $width, $height) {
width: 0;
height: 0;
@if $direction-h == top {
border-top: $height solid $color;
border-bottom: $height solid transparent;
} @else {
border-bottom: $height solid $color;
border-top: $height solid transparent;
}
@if $direction-w == right {
border-right: $width solid $color;
border-left: $width solid transparent;
} @else {
border-left: $width solid $color;
border-right: $width solid transparent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment