2023-10-23 13:48:44 +04:00
|
|
|
// scss-docs-start caret-mixins
|
2023-11-02 21:33:55 +04:00
|
|
|
@mixin caret-down($width: $caret-width) {
|
|
|
|
border-top: $width solid;
|
|
|
|
border-right: $width solid transparent;
|
2023-10-23 13:48:44 +04:00
|
|
|
border-bottom: 0;
|
2023-11-02 21:33:55 +04:00
|
|
|
border-left: $width solid transparent;
|
2023-10-23 13:48:44 +04:00
|
|
|
}
|
|
|
|
|
2023-11-02 21:33:55 +04:00
|
|
|
@mixin caret-up($width: $caret-width) {
|
2023-10-23 13:48:44 +04:00
|
|
|
border-top: 0;
|
2023-11-02 21:33:55 +04:00
|
|
|
border-right: $width solid transparent;
|
|
|
|
border-bottom: $width solid;
|
|
|
|
border-left: $width solid transparent;
|
2023-10-23 13:48:44 +04:00
|
|
|
}
|
|
|
|
|
2023-11-02 21:33:55 +04:00
|
|
|
@mixin caret-end($width: $caret-width) {
|
|
|
|
border-top: $width solid transparent;
|
2023-10-23 13:48:44 +04:00
|
|
|
border-right: 0;
|
2023-11-02 21:33:55 +04:00
|
|
|
border-bottom: $width solid transparent;
|
|
|
|
border-left: $width solid;
|
2023-10-23 13:48:44 +04:00
|
|
|
}
|
|
|
|
|
2023-11-02 21:33:55 +04:00
|
|
|
@mixin caret-start($width: $caret-width) {
|
|
|
|
border-top: $width solid transparent;
|
|
|
|
border-right: $width solid;
|
|
|
|
border-bottom: $width solid transparent;
|
2023-10-23 13:48:44 +04:00
|
|
|
}
|
|
|
|
|
2023-11-02 21:33:55 +04:00
|
|
|
@mixin caret(
|
|
|
|
$direction: down,
|
|
|
|
$width: $caret-width,
|
|
|
|
$spacing: $caret-spacing,
|
|
|
|
$vertical-align: $caret-vertical-align
|
|
|
|
) {
|
2023-10-23 13:48:44 +04:00
|
|
|
@if $enable-caret {
|
|
|
|
&::after {
|
|
|
|
display: inline-block;
|
2023-11-02 21:33:55 +04:00
|
|
|
margin-left: $spacing;
|
|
|
|
vertical-align: $vertical-align;
|
2023-10-23 13:48:44 +04:00
|
|
|
content: "";
|
|
|
|
@if $direction == down {
|
2023-11-02 21:33:55 +04:00
|
|
|
@include caret-down($width);
|
2023-10-23 13:48:44 +04:00
|
|
|
} @else if $direction == up {
|
2023-11-02 21:33:55 +04:00
|
|
|
@include caret-up($width);
|
2023-10-23 13:48:44 +04:00
|
|
|
} @else if $direction == end {
|
2023-11-02 21:33:55 +04:00
|
|
|
@include caret-end($width);
|
2023-10-23 13:48:44 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@if $direction == start {
|
|
|
|
&::after {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
display: inline-block;
|
2023-11-02 21:33:55 +04:00
|
|
|
margin-right: $spacing;
|
|
|
|
vertical-align: $vertical-align;
|
2023-10-23 13:48:44 +04:00
|
|
|
content: "";
|
2023-11-02 21:33:55 +04:00
|
|
|
@include caret-start($width);
|
2023-10-23 13:48:44 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:empty::after {
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// scss-docs-end caret-mixins
|