1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-31 17:11:48 +02:00

Add option to disable carets on dropdowns through $enable-caret

This commit is contained in:
Patrick Yeo
2017-06-28 12:34:07 -07:00
parent 7de266d4dd
commit e6042e6f44
4 changed files with 39 additions and 19 deletions

35
scss/mixins/_caret.scss Normal file
View File

@@ -0,0 +1,35 @@
@mixin caret-down {
border-top: $caret-width solid;
border-right: $caret-width solid transparent;
border-bottom: 0;
border-left: $caret-width solid transparent;
}
@mixin caret-up {
border-top: 0;
border-right: $caret-width solid transparent;
border-bottom: $caret-width solid;
border-left: $caret-width solid transparent;
}
@mixin caret($direction: down) {
@if $enable-caret {
&::after {
display: inline-block;
width: 0;
height: 0;
margin-left: $caret-width * .85;
vertical-align: $caret-width * .85;
content: "";
@if $direction == down {
@include caret-down;
} @else if $direction == up {
@include caret-up;
}
}
&:empty::after {
margin-left: 0;
}
}
}