Created
August 16, 2011 15:32
-
-
Save Ch00by/1149369 to your computer and use it in GitHub Desktop.
Triangle Shape Mixin for Scss
This file contains 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-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