Skip to content

Commit

Permalink
fix(dropdown): small enhancements (#1793)
Browse files Browse the repository at this point in the history
* Use `.nav-link` instead of `.btn` in a navbar.
* Remove the cut border on split-dropdown when shown.
* Remove border on `.nav-link` since we declare border on each nav.
  • Loading branch information
louismaximepiton authored Feb 7, 2023
1 parent d8310ad commit b948f04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scss/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
// Boosted mod
.btn-group:not(.dropstart) &,
.dropstart & ~ .btn {
&:not(:hover):not(:focus):not(:active) {
&:not(:hover):not(:focus):not(:active):not(.show) {
border-left-color: transparent;

&::before {
Expand Down
5 changes: 3 additions & 2 deletions scss/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
}

.nav-link {
display: flex; // Boosted mod
display: flex; // Boosted mod: instead of `block`
align-items: center; // Boosted mod
padding: var(--#{$prefix}nav-link-padding-y) var(--#{$prefix}nav-link-padding-x);
@include font-size(var(--#{$prefix}nav-link-font-size));
font-weight: var(--#{$prefix}nav-link-font-weight);
color: var(--#{$prefix}nav-link-color);
text-decoration: if($link-decoration == none, null, none);
background: none; // Boosted mod: Prevent dropdown's background to interfere
background: none;
border: 0;
@include transition($nav-link-transition);

// Boosted mod: no focus
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.2/components/dropdowns.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ And putting it to use in a navbar:
<div class="collapse navbar-collapse" id="navbarNavDarkDropdown">
<ul class="navbar-nav">
<li class="nav-item dropdown">
<button class="btn btn-dark dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<button class="nav-link dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</button>
<ul class="dropdown-menu dropdown-menu-dark">
Expand Down

0 comments on commit b948f04

Please sign in to comment.