Created
October 20, 2013 03:10
-
-
Save ZellSnippets/7064528 to your computer and use it in GitHub Desktop.
SCSS: Triangle Mixin
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
@mixin triangle($direction, $color, $size) { | |
@if $direction == "left" { | |
border-bottom: $size solid transparent; | |
border-right: $size solid $color; | |
border-top: $size solid transparent; | |
} | |
@else if $direction == "right" { | |
border-bottom: $size solid transparent; | |
border-left: $size solid $color; | |
border-top: $size solid transparent; | |
} | |
@else if $direction == "up" { | |
border-bottom: $size solid $color; | |
border-left: $size solid transparent; | |
border-right: $size solid transparent; | |
} | |
@else if $direction == "down" { | |
border-right: $size solid transparent; | |
border-left: $size solid transparent; | |
border-top: $size solid $color; | |
} | |
height: 0; | |
width: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment