Last Updated: February 25, 2016
·
3.232K
· stijnj

Easily create triangles with CSS3 and LESS

I wrote a simple LESS mixin to create triangles with CSS3.

Usage

.triangle(@direction, @size, @color)
  • @direction defines the direction: 'up', 'down', 'left' or 'right'.
  • @size defines the size
  • @color defines the color

Example

.dropdown {
    &:after {
        .triangle(down, 5px, #fff);
    }
}

https://github.com/stijnj/less-triangle