_arrows.scss
1.4 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// ==========================================================================
// Arrows
//
// Use this to generate most of the code for your CSS arrows.
//
//
// EXAMPLE
//
// .tooltip {
// &:before {
// @include arrow--up(7px, #333);
// left: 50%;
// margin-left: -7px;
// }
// }
//
// ==========================================================================
@mixin arrow--base(){
position: absolute;
content: '';
width: 0;
height: 0;
}
@mixin arrow--top($size: 10px, $color: #ccc){
@include arrow--base;
bottom: 100%;
border-left: $size solid transparent;
border-right: $size solid transparent;
border-bottom: $size solid $color;
}
@mixin arrow--up($size: 10px, $color: #ccc){
@include arrow--top($size, $color);
}
@mixin arrow--right($size: 10px, $color: #ccc){
@include arrow--base;
left: 100%;
border-top: $size solid transparent;
border-bottom: $size solid transparent;
border-left: $size solid $color;
}
@mixin arrow--bottom($size: 10px, $color: #ccc){
@include arrow--base;
top: 100%;
border-left: $size solid transparent;
border-right: $size solid transparent;
border-top: $size solid $color;
}
@mixin arrow--down($size: 10px, $color: #ccc){
@include arrow--bottom($size, $color);
}
@mixin arrow--left($size: 10px, $color: #ccc){
@include arrow--base;
right: 100%;
border-top: $size solid transparent;
border-bottom: $size solid transparent;
border-right:$size solid $color;
}