Skip to content

Commit 28ea06d

Browse files
andresgalanteJohann-S
authored andcommitted
moves drop left arrow to the left
1 parent 53940af commit 28ea06d

File tree

3 files changed

+51
-35
lines changed

3 files changed

+51
-35
lines changed

docs/4.0/components/dropdowns.md

+24-20
Original file line numberDiff line numberDiff line change
@@ -489,49 +489,53 @@ Trigger dropdown menus at the left of the elements by adding `.dropleft` to the
489489
</div>
490490
</div>
491491

492-
<div class="btn-group dropleft">
492+
<div class="btn-group">
493+
<div class="btn-group dropleft" role="group">
494+
<button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
495+
<span class="sr-only">Toggle Dropleft</span>
496+
</button>
497+
<div class="dropdown-menu">
498+
<a class="dropdown-item" href="#">Action</a>
499+
<a class="dropdown-item" href="#">Another action</a>
500+
<a class="dropdown-item" href="#">Something else here</a>
501+
<div class="dropdown-divider"></div>
502+
<a class="dropdown-item" href="#">Separated link</a>
503+
</div>
504+
</div>
493505
<button type="button" class="btn btn-secondary">
494506
Split dropleft
495507
</button>
496-
<button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
497-
<span class="sr-only">Toggle Dropleft</span>
498-
</button>
499-
<div class="dropdown-menu">
500-
<a class="dropdown-item" href="#">Action</a>
501-
<a class="dropdown-item" href="#">Another action</a>
502-
<a class="dropdown-item" href="#">Something else here</a>
503-
<div class="dropdown-divider"></div>
504-
<a class="dropdown-item" href="#">Separated link</a>
505-
</div>
506508
</div>
507509
</div>
508510

509511
{% highlight html %}
510512
<!-- Default dropleft button -->
511513
<div class="btn-group dropleft">
512-
<button type="button" class="btn btn-secondary">Dropleft</button>
513514
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
514-
<span class="sr-only">Toggle Dropleft</span>
515+
Dropleft
515516
</button>
516517
<div class="dropdown-menu">
517518
<!-- Dropdown menu links -->
518519
</div>
519520
</div>
520521

521522
<!-- Split dropleft button -->
522-
<div class="btn-group dropleft">
523+
<div class="btn-group">
524+
<div class="btn-group dropleft" role="group">
525+
<button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
526+
<span class="sr-only">Toggle Dropleft</span>
527+
</button>
528+
<div class="dropdown-menu">
529+
<!-- Dropdown menu links -->
530+
</div>
531+
</div>
523532
<button type="button" class="btn btn-secondary">
524533
Split dropleft
525534
</button>
526-
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
527-
<span class="sr-only">Toggle Dropleft</span>
528-
</button>
529-
<div class="dropdown-menu">
530-
<!-- Dropdown menu links -->
531-
</div>
532535
</div>
533536
{% endhighlight %}
534537

538+
535539
## Menu items
536540

537541
Historically dropdown menu contents *had* to be links, but that's no longer the case with v4. Now you can optionally use `<button>` elements in your dropdowns instead of just `<a>`s.

scss/_dropdown.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666

6767
.dropdown-toggle {
6868
@include caret(left);
69-
&::after {
69+
&::before {
7070
vertical-align: 0;
7171
}
7272
}

scss/mixins/_caret.scss

+26-14
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,32 @@
2626

2727
@mixin caret($direction: down) {
2828
@if $enable-caret {
29-
&::after {
30-
display: inline-block;
31-
width: 0;
32-
height: 0;
33-
margin-left: $caret-width * .85;
34-
vertical-align: $caret-width * .85;
35-
content: "";
36-
@if $direction == down {
37-
@include caret-down;
38-
} @else if $direction == up {
39-
@include caret-up;
40-
} @else if $direction == right {
41-
@include caret-right;
42-
} @else if $direction == left {
29+
@if $direction != left {
30+
&::after {
31+
display: inline-block;
32+
width: 0;
33+
height: 0;
34+
margin-left: $caret-width * .85;
35+
vertical-align: $caret-width * .85;
36+
content: "";
37+
@if $direction == down {
38+
@include caret-down;
39+
} @else if $direction == up {
40+
@include caret-up;
41+
} @else if $direction == right {
42+
@include caret-right;
43+
}
44+
}
45+
}
46+
47+
@if $direction == left {
48+
&::before {
49+
display: inline-block;
50+
width: 0;
51+
height: 0;
52+
margin-right: $caret-width * .85;
53+
vertical-align: $caret-width * .85;
54+
content: "";
4355
@include caret-left;
4456
}
4557
}

0 commit comments

Comments
 (0)