Created
July 15, 2014 21:51
-
-
Save wehrhaus/4081a1c59625ccebcc51 to your computer and use it in GitHub Desktop.
Stylus Triangle Generator
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
triangle(orientation, width, height, color) | |
if orientation == top | |
border-width 0 unit(width/2, px) unit(height, px) unit(width/2, px) | |
border-color transparent transparent color transparent | |
else if orientation == left | |
border-width unit(height/2, px) unit(width, px) unit(height/2, px) 0 | |
border-color transparent color transparent transparent | |
else if orientation == bottom | |
border-width unit(height, px) unit(width/2, px) 0 unit(width/2, px) | |
border-color color transparent transparent transparent | |
else if orientation == right | |
border-width unit(height/2, px) 0 unit(height/2, px) unit(width, px) | |
border-color transparent transparent transparent color | |
else | |
error('triangle mixin expected an orientation of top/right/bottom/left') | |
width 0 | |
height 0 | |
border-style solid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment