Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion scss/_dropdown.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// The dropdown wrapper (`<div>`)
.dropup,
.dropdown {
.dropright,
.dropdown,
.dropleft {
position: relative;
}

Expand Down Expand Up @@ -31,10 +33,17 @@
@include box-shadow($dropdown-box-shadow);
}

.dropdown-menu-right {
right: 0;
left: auto;
}

// Allow for dropdowns to go bottom up (aka, dropup-menu)
// Just add .dropup after the standard .dropdown class and you're set.
.dropup {
.dropdown-menu {
top: auto;
bottom: 100%;
margin-top: 0;
margin-bottom: $dropdown-spacer;
}
Expand All @@ -46,6 +55,9 @@

.dropright {
.dropdown-menu {
top: 0;
right: auto;
left: 100%;
margin-top: 0;
margin-left: $dropdown-spacer;
}
Expand All @@ -60,6 +72,9 @@

.dropleft {
.dropdown-menu {
top: 0;
right: 100%;
left: auto;
margin-top: 0;
margin-right: $dropdown-spacer;
}
Expand All @@ -72,6 +87,19 @@
}
}

// When enabled Popper.js, reset basic dropdown position
// stylelint-disable no-duplicate-selectors
.dropdown-menu {
&[x-placement^="top"],
&[x-placement^="right"],
&[x-placement^="bottom"],
&[x-placement^="left"] {
right: auto;
bottom: auto;
}
}
// stylelint-enable no-duplicate-selectors

// Dividers (basically an `<hr>`) within the dropdown
.dropdown-divider {
@include nav-divider($dropdown-divider-bg);
Expand Down
12 changes: 0 additions & 12 deletions scss/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,6 @@
position: absolute;
}

.dropdown-menu-right {
right: 0;
left: auto; // Reset the default from `.dropdown-menu`
}

.nav-link {
padding-right: $navbar-nav-link-padding-x;
padding-left: $navbar-nav-link-padding-x;
Expand All @@ -189,13 +184,6 @@
.navbar-toggler {
display: none;
}

.dropup {
.dropdown-menu {
top: auto;
bottom: 100%;
}
}
}
}
}
Expand Down