2021-02-11 04:29:59 +01:00
|
|
|
// scss-docs-start caret-mixins
|
2022-06-06 06:47:51 +02:00
|
|
|
@mixin caret-down($width: $caret-width) {
|
|
|
|
border-top: $width solid;
|
|
|
|
border-right: $width solid transparent;
|
2017-06-28 21:34:07 +02:00
|
|
|
border-bottom: 0;
|
2022-06-06 06:47:51 +02:00
|
|
|
border-left: $width solid transparent;
|
2017-06-28 21:34:07 +02:00
|
|
|
}
|
|
|
|
|
2022-06-06 06:47:51 +02:00
|
|
|
@mixin caret-up($width: $caret-width) {
|
2017-06-28 21:34:07 +02:00
|
|
|
border-top: 0;
|
2022-06-06 06:47:51 +02:00
|
|
|
border-right: $width solid transparent;
|
|
|
|
border-bottom: $width solid;
|
|
|
|
border-left: $width solid transparent;
|
2017-06-28 21:34:07 +02:00
|
|
|
}
|
|
|
|
|
2022-06-06 06:47:51 +02:00
|
|
|
@mixin caret-end($width: $caret-width) {
|
|
|
|
border-top: $width solid transparent;
|
2018-03-12 17:51:00 +01:00
|
|
|
border-right: 0;
|
2022-06-06 06:47:51 +02:00
|
|
|
border-bottom: $width solid transparent;
|
|
|
|
border-left: $width solid;
|
2017-10-29 23:29:13 +01:00
|
|
|
}
|
|
|
|
|
2022-06-06 06:47:51 +02:00
|
|
|
@mixin caret-start($width: $caret-width) {
|
|
|
|
border-top: $width solid transparent;
|
|
|
|
border-right: $width solid;
|
|
|
|
border-bottom: $width solid transparent;
|
2017-10-29 23:29:13 +01:00
|
|
|
}
|
|
|
|
|
2022-06-06 06:47:51 +02:00
|
|
|
@mixin caret(
|
|
|
|
$direction: down,
|
|
|
|
$width: $caret-width,
|
|
|
|
$spacing: $caret-spacing,
|
|
|
|
$vertical-align: $caret-vertical-align
|
|
|
|
) {
|
2017-06-28 21:34:07 +02:00
|
|
|
@if $enable-caret {
|
|
|
|
&::after {
|
|
|
|
display: inline-block;
|
2022-06-06 06:47:51 +02:00
|
|
|
margin-left: $spacing;
|
|
|
|
vertical-align: $vertical-align;
|
2017-06-28 21:34:07 +02:00
|
|
|
content: "";
|
|
|
|
@if $direction == down {
|
2022-06-06 06:47:51 +02:00
|
|
|
@include caret-down($width);
|
2017-06-28 21:34:07 +02:00
|
|
|
} @else if $direction == up {
|
2022-06-06 06:47:51 +02:00
|
|
|
@include caret-up($width);
|
2020-06-26 16:06:20 +02:00
|
|
|
} @else if $direction == end {
|
2022-06-06 06:47:51 +02:00
|
|
|
@include caret-end($width);
|
2017-10-29 23:29:13 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-26 16:06:20 +02:00
|
|
|
@if $direction == start {
|
2017-10-29 23:29:13 +01:00
|
|
|
&::after {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
display: inline-block;
|
2022-06-06 06:47:51 +02:00
|
|
|
margin-right: $spacing;
|
|
|
|
vertical-align: $vertical-align;
|
2017-10-29 23:29:13 +01:00
|
|
|
content: "";
|
2022-06-06 06:47:51 +02:00
|
|
|
@include caret-start($width);
|
2017-06-28 21:34:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:empty::after {
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-02-11 04:29:59 +01:00
|
|
|
// scss-docs-end caret-mixins
|