Skip to content
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

Add disabled states to navs and dropdowns #2764

Closed
cnicodeme opened this issue Mar 23, 2012 · 6 comments
Closed

Add disabled states to navs and dropdowns #2764

cnicodeme opened this issue Mar 23, 2012 · 6 comments
Milestone

Comments

@cnicodeme
Copy link

Hey, I didn't find any style for disabled state of links in a nav, so here it is :

.nav-list>.disabled>a {
    color: #999;
    cursor: default;
}

.nav-list>.disabled>a:hover {
    background-color: transparent;
}

(update: changing .nav to .nav-list).

This also works for .nav-tabs & .nav-pills :

.nav-tabs>.disabled>a, .nav-pills>.disabled>a {
    color: #999;
    cursor: default;
    border: none; /** add this for tabs/pills **/
}

.nav-tabs>.disabled>a:hover, .nav-pills>.disabled>a:hover {
    background-color: transparent;
}
@mdo
Copy link
Member

mdo commented Mar 25, 2012

Edited title to tackle two items with one stone: disabled items in both navs and dropdowns.

@NelsonReis
Copy link

I've managed to add this feature on the sidebar with:

// Add disabled state for items in sidebar
.nav > li.disabled {
  .opacity(40);
  pointer-events: none;
}
.nav > li.disabled > a:hover {
  cursor: default;
  text-decoration: none;
  background-color: inherit;
}

Also had to include some JavaScript so that IE users could not click on the links:

$('ul.nav-list > li.disabled > a').click(function () { return false; });

@pixelyunicorn
Copy link

👍

@mdo
Copy link
Member

mdo commented Jun 19, 2012

Added to 2.1.0-wip.

@mdo mdo closed this as completed Jun 19, 2012
@ckizer
Copy link

ckizer commented Sep 28, 2012

This doesn't seem to work with button menus in 2.1.0-wip, can it be added?

@ckizer
Copy link

ckizer commented Sep 28, 2012

Since menu hover states have changed to a gradient background:

.dropdown-menu>.disabled>a:hover, 
.dropdown-menu>.disabled>a:hover {
    background-color: transparent;
}

Needs to be changed to this in source!

background: transparent;

stempler pushed a commit to stempler/bootstrap that referenced this issue Apr 11, 2014
stempler pushed a commit to stempler/bootstrap that referenced this issue Nov 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants