Skip to content

Instantly share code, notes, and snippets.

@darren131
Created May 30, 2012 00:25
Show Gist options
  • Save darren131/2831662 to your computer and use it in GitHub Desktop.
Save darren131/2831662 to your computer and use it in GitHub Desktop.
CSS only arrows in LESS
// 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