Skip to content

if parent has class "open" every "dropdown-toggle" will be affected #13028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maggiben opened this issue Mar 12, 2014 · 1 comment
Closed

if parent has class "open" every "dropdown-toggle" will be affected #13028

maggiben opened this issue Mar 12, 2014 · 1 comment
Labels
Milestone

Comments

@maggiben
Copy link

Description:
"dropdown-toggle" style changes if parents have class "open"
File: mixins.less L:453
Versions affected: 3 and above
Replicate issue:

<body class="open">
<div class="btn-group">
      <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Default <span class="caret"></span></button>
      <ul class="dropdown-menu" role="menu">
        <li><a href="#">Action</a></li>
        <li><a href="#">Another action</a></li>
        <li><a href="#">Something else here</a></li>
        <li class="divider"></li>
        <li><a href="#">Separated link</a></li>
      </ul>
    </div>
</body>

More details: (mixins.less)

.open .dropdown-toggle& {
    color: @color;
    background-color: darken(@background, 8%);
        border-color: darken(@border, 12%);
  }

Targets all dropdown-toggle whos parents have class open, it should only do that for the first parent in my case the btn-group class.

@cvrebert cvrebert added the css label Mar 12, 2014
@cvrebert cvrebert added this to the v3.2.0 milestone Mar 12, 2014
@maggiben
Copy link
Author

I believe this can be fixed by doing this:

& ~ .open .dropdown-toggle& {
    color: @color;
    background-color: darken(@background, 8%);
        border-color: darken(@border, 12%);
  }
  &:active,
  &.active,
  & ~ .open .dropdown-toggle& {
    background-image: none;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants