w-yfoa
Last Updated: February 25, 2016
·
3.027K
· stijnj
0d170893bc20df1fd28140f1d43f8f6d

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

Say Thanks
Respond