Created
May 30, 2012 00:25
-
-
Save darren131/2831662 to your computer and use it in GitHub Desktop.
CSS only arrows in LESS
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
// HOW TO USE | |
// | |
// @direction: up; | |
// .class { | |
// .arrow(@direction, #c00, 20px); | |
// } | |
// | |
.arrow(up, @color, @size) { | |
width: 0; | |
height: 0; | |
border-left: @size solid transparent; | |
border-right: @size solid transparent; | |
border-bottom: @size solid @color; | |
} | |
.arrow(down, @color, @size) { | |
width: 0; | |
height: 0; | |
border-left: @size solid transparent; | |
border-right: @size solid transparent; | |
border-top: @size solid @color; | |
} | |
.arrow(right, @color, @size) { | |
width: 0; | |
height: 0; | |
border-top: @size solid transparent; | |
border-bottom: @size solid transparent; | |
border-left: @size solid @color; | |
} | |
.arrow(left, @color, @size) { | |
width: 0; | |
height: 0; | |
border-top: @size solid transparent; | |
border-bottom: @size solid transparent; | |
border-right: @size solid @color; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment