-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathless-triangle.less
34 lines (34 loc) · 1.13 KB
/
less-triangle.less
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.triangle-base() {
content: '';
display: block;
width: 0;
height: 0;
-moz-transform: scale(.9999);
}
.triangle(@direction, @size, @color) {
.triangle(@direction, @size * 2, @size, @color);
}
.triangle(@direction, @width, @height, @color) when (@direction = up) {
.triangle-base();
border-left: (@width / 2) solid transparent;
border-right: (@width / 2) solid transparent;
border-bottom: @height solid @color;
}
.triangle(@direction, @width, @height, @color) when (@direction = down) {
.triangle-base();
border-left: (@width / 2) solid transparent;
border-right: (@width / 2) solid transparent;
border-top: @height solid @color;
}
.triangle(@direction, @width, @height, @color) when (@direction = left) {
.triangle-base();
border-top: (@width / 2) solid transparent;
border-bottom: (@width / 2) solid transparent;
border-right: @height solid @color;
}
.triangle(@direction, @width, @height, @color) when (@direction = right) {
.triangle-base();
border-top: (@width / 2) solid transparent;
border-bottom: (@width / 2) solid transparent;
border-left: @height solid @color;
}