dropdowns.less 2.16 KB
Newer Older
1
2
3
// DROPDOWN MENUS
// --------------

4
5
6
7
// Use the .menu class on any <li> element within the topbar or ul.tabs and you'll get some superfancy dropdowns
.dropdown {
  position: relative;
}
8
9
// Dropdown arrow/caret
.caret {
10
11
12
13
14
  display: inline-block;
  width: 0;
  height: 0;
  text-indent: -99999px;
  vertical-align: top;
15
  border-left:  4px solid transparent;
16
  border-right: 4px solid transparent;
17
  border-top:   4px solid #000;
18
  .opacity(30);
19
  content: "\2193";
20
}
21
22
23
.dropdown .caret {
  margin-top: 8px;
  margin-left: 2px;
24
  *margin-top: 7px;
25
}
26
27
.dropdown:hover .caret,
.open.dropdown .caret {
28
29
30
31
32
33
  .opacity(100);
}
// The dropdown menu (ul)
.dropdown-menu {
  position: absolute;
  top: 40px;
34
  z-index: @zindexDropdown;
35
  float: left;
36
  display: none; // none by default, but block on "open" of the menu
37
38
39
  min-width: 160px;
  max-width: 220px;
  _width: 160px;
40
  padding: 4px 0;
41
42
  margin: 0; // override default ul
  list-style: none;
43
  background-color: @white;
44
  border-color: #ccc;
45
  border-color: rgba(0,0,0,.2);
46
  border-style: solid;
47
48
49
50
51
52
  border-width: 1px;
  .border-radius(0 0 5px 5px);
  .box-shadow(0 5px 10px rgba(0,0,0,.2));
  -webkit-background-clip: padding-box;
     -moz-background-clip: padding;
          background-clip: padding-box;
53
  zoom: 1; // do we need this?
54
55
  *border-right-width: 2px;
  *border-bottom-width: 2px;
56
57
58
59

  // Dividers (basically an hr) within the dropdown
  .divider {
    height: 1px;
60
    margin: 5px 1px;
61
    overflow: hidden;
62
    background-color: #e5e5e5;
63
64
65
66
67
68
    border-bottom: 1px solid @white;
  }

  // Links within the dropdown menu
  a {
    display: block;
69
    padding: 3px 15px;
70
71
72
73
    clear: both;
    font-weight: normal;
    line-height: 18px;
    color: @gray;
74
    white-space: nowrap;
75
  }
76
}
77

78
// Hover state
79
.dropdown-menu li > a:hover,
80
81
82
.dropdown-menu .active > a,
.dropdown-menu .active > a:hover {
  color: #fff;
83
84
  text-decoration: none;
  background-color: @linkColor;
85
86
}

87
88
89
90
91
92
93
94
95
96
97
// Open state for the dropdown
.dropdown.open {
  .dropdown-toggle {
    color: @white;
    background: #ccc;
    background: rgba(0,0,0,.3);
  }
  .dropdown-menu {
    display: block;
  }
}
98
99
100
101
102
103

// Typeahead
.typeahead {
  margin-top: 2px; // give it some space to breathe
  .border-radius(4px);
}