Skip to content

Responsive dropdown-menu-right class #25019

@niftylettuce

Description

@niftylettuce

It'd be great if we could have responsive control over the dropdown menu opening either left or right aligned (as opposed to writing custom CSS).

Here's a quick demo of what the following sass does:

kapture 2017-12-15 at 18 10 07

// since .dropdown-menu-right is not responsive
// we need to make sure that the language dropdown
// is right aligned on < md screen sizes
// <https://github.com/twbs/bootstrap/blob/34d745540d690086cdfc4ce648963f9acdc56bdb/scss/_navbar.scss#L160-L163>
#navbar-dropdown-language-ul {
  right: 0;
  left: auto; // Reset the default from `.dropdown-menu`
}
@include media-breakpoint-up(md) {
  #navbar-dropdown-language-ul {
    left: 0;
    right: auto; // Reset the default from `.dropdown-menu`
  }
}

Not sure if it should be called dropdown-menu-right-$size-up or dropdown-menu-right-$size-down?

Thoughts @mdo?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions