Created
June 13, 2017 14:34
-
-
Save jesders/963bc446605b34977f5f464c79b6b861 to your computer and use it in GitHub Desktop.
CSS Triangle Mixin
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 borderTrianlge($direction, $size, $color) | |
{ | |
$trans: $size solid transparent; | |
$color: $size solid $color; | |
width: 0; | |
height: 0; | |
@if $direction==up or $direction==down | |
{ | |
border-left: $trans; | |
border-right: $trans; | |
border-top: if($direction==up, none, $color); | |
border-bottom: if($direction==up, $color, none); | |
} | |
@elseif $direction==left or $direction==right | |
{ | |
border-top: $trans; | |
border-bottom: $trans; | |
border-left: if($direction==left, none, $color); | |
border-right: if($direction==left, $color, none); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment