1 | // scss-docs-start caret-mixins
|
---|
2 | @mixin caret-down($width: $caret-width) {
|
---|
3 | border-top: $width solid;
|
---|
4 | border-right: $width solid transparent;
|
---|
5 | border-bottom: 0;
|
---|
6 | border-left: $width solid transparent;
|
---|
7 | }
|
---|
8 |
|
---|
9 | @mixin caret-up($width: $caret-width) {
|
---|
10 | border-top: 0;
|
---|
11 | border-right: $width solid transparent;
|
---|
12 | border-bottom: $width solid;
|
---|
13 | border-left: $width solid transparent;
|
---|
14 | }
|
---|
15 |
|
---|
16 | @mixin caret-end($width: $caret-width) {
|
---|
17 | border-top: $width solid transparent;
|
---|
18 | border-right: 0;
|
---|
19 | border-bottom: $width solid transparent;
|
---|
20 | border-left: $width solid;
|
---|
21 | }
|
---|
22 |
|
---|
23 | @mixin caret-start($width: $caret-width) {
|
---|
24 | border-top: $width solid transparent;
|
---|
25 | border-right: $width solid;
|
---|
26 | border-bottom: $width solid transparent;
|
---|
27 | }
|
---|
28 |
|
---|
29 | @mixin caret(
|
---|
30 | $direction: down,
|
---|
31 | $width: $caret-width,
|
---|
32 | $spacing: $caret-spacing,
|
---|
33 | $vertical-align: $caret-vertical-align
|
---|
34 | ) {
|
---|
35 | @if $enable-caret {
|
---|
36 | &::after {
|
---|
37 | display: inline-block;
|
---|
38 | margin-left: $spacing;
|
---|
39 | vertical-align: $vertical-align;
|
---|
40 | content: "";
|
---|
41 | @if $direction == down {
|
---|
42 | @include caret-down($width);
|
---|
43 | } @else if $direction == up {
|
---|
44 | @include caret-up($width);
|
---|
45 | } @else if $direction == end {
|
---|
46 | @include caret-end($width);
|
---|
47 | }
|
---|
48 | }
|
---|
49 |
|
---|
50 | @if $direction == start {
|
---|
51 | &::after {
|
---|
52 | display: none;
|
---|
53 | }
|
---|
54 |
|
---|
55 | &::before {
|
---|
56 | display: inline-block;
|
---|
57 | margin-right: $spacing;
|
---|
58 | vertical-align: $vertical-align;
|
---|
59 | content: "";
|
---|
60 | @include caret-start($width);
|
---|
61 | }
|
---|
62 | }
|
---|
63 |
|
---|
64 | &:empty::after {
|
---|
65 | margin-left: 0;
|
---|
66 | }
|
---|
67 | }
|
---|
68 | }
|
---|
69 | // scss-docs-end caret-mixins
|
---|