/
_speech-bubble.scss
64 lines (60 loc) · 1.69 KB
/
_speech-bubble.scss
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
@mixin speech-bubble($bgcolor: #9cf, $round-size: 6px, $tail-size: 12px, $tail-position: 24px) {
position: relative;
background-color: $bgcolor;
-moz-border-radius: $round-size;
-webkit-border-radius: $round-size;
border-radius: $round-size;
&:before {
border-top-width: $tail-size;
border-right-width: $tail-size;
border-bottom-width: 0;
border-left-width: $tail-size;
border-color: $bgcolor transparent;
border-style: solid;
display: block;
position: absolute;
bottom: -$tail-size;
left: $tail-position;
width: 0;
height: 0;
content: "";
}
}
@mixin bordered-speech-bubble($background-color: #9cf, $border-color: #369, $border-size: 4px, $round-size: 8px, $tail-size: 16px, $tail-position: 16px) {
border: $border-size solid $border-color;
position: relative;
background-color: $background-color;
-moz-border-radius: $round-size;
-webkit-border-radius: $round-size;
border-radius: $round-size;
&:before {
border-top-width: $tail-size;
border-right-width: $tail-size;
border-bottom-width: 0;
border-left-width: $tail-size;
border-color: $border-color transparent;
border-style: solid;
display: block;
position: absolute;
bottom: (- $tail-size);
left: $tail-position;
width: 0;
height: 0;
content: "";
}
&:after {
border-top-width: $tail-size;
border-right-width: $tail-size;
border-bottom-width: 0;
border-left-width: $tail-size;
border-color: $background-color transparent;
border-style: solid;
display: block;
position: absolute;
bottom: (- $tail-size + $border-size * 1.5);
left: $tail-position;
width: 0;
height: 0;
content: "";
}
}