A Pen by Evan Lovely on CodePen.
Created
May 24, 2014 01:03
-
-
Save EvanLovely/e9d7bd8b0915f14f2807 to your computer and use it in GitHub Desktop.
A Pen by Evan Lovely.
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
<h2>Arrow</h2> | |
<span class="arrow"></span> | |
<hr /> | |
<h2>Special Arrow</h2> | |
<span class="special-arrow"></span> |
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 arrow($color: black, $direction: down, $width: 8px, $height: 7px) { | |
display: inline-block; | |
border-style: solid; | |
border-color: transparent; | |
@if $direction == left { | |
border-top-width: round($height / 2); | |
border-bottom-width: round($height / 2); | |
border-left-width: 0; | |
border-right-width: $width; | |
border-right-color: $color; | |
} | |
@else if $direction == right { | |
border-top-width: round($height / 2); | |
border-bottom-width: round($height / 2); | |
border-right-width: 0; | |
border-left-width: $width; | |
border-left-color: $color; | |
} | |
@else if $direction == up { | |
border-left-width: round($width / 2); | |
border-right-width: round($width / 2); | |
border-top-width: 0; | |
border-bottom-width: $height; | |
border-bottom-color: $color; | |
} | |
@else {// $direction == down | |
border-left-width: round($width / 2); | |
border-right-width: round($width / 2); | |
border-top-width: $height; | |
border-bottom-width: 0; | |
border-top-color: $color; | |
} | |
} | |
.arrow { | |
@include arrow(); | |
} | |
.special-arrow { | |
@include arrow($color: red, $direction: left, $width: 25px, $height: 18px); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment