summaryrefslogtreecommitdiffstats
path: root/less/patternfly/dropdowns.less
blob: 02147e87dcbfa8c55b45f889beca31ab8f960610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
//
// Dropdowns
// --------------------------------------------------


// Dropdown arrow/caret
// Modified to use Font Awesome's angle-down icon
.caret {
  font-family: @icon-font-name-fa;
  font-weight: normal;
  height: @font-size-base - 3;
  position: relative;
  vertical-align: baseline;
  width: @font-size-base;
  &:before {
    bottom: 0;
    content: @fa-var-angle-down;
    left: 0;
    line-height: @font-size-base;
    position: absolute;
    text-align: center;
    top: -1px;
    right: 0;
  }
}

// The dropdown menu (ul)
.dropdown-menu {
  // Dividers (basically an hr) within the dropdown
  .divider {
    .nav-divider(@dropdown-divider-bg, @dropdown-divider-margin);
  }
  // Links within the dropdown menu
  > li > a {
    border-color: transparent;
    border-style: solid;
    border-width: 1px 0;
    padding: 1px 10px;
  }
}

// Hover/Focus state
.dropdown-menu > li > a {
  &:hover {
    border-color: #b3d3e7;
    .reset-filter();
  }
  &:focus,
  &:active {
    background-color: @dropdown-link-focus-bg;
    border-color: #0076b7;
    color: @dropdown-link-focus-color !important;
    .reset-filter();
  }
}

// Active state
.dropdown-menu > .active > a {
  &,
  &:hover,
  &:focus {
    background-color: @dropdown-link-active-bg !important;
    border-color: #0076b7 !important;
    .reset-filter();
  }
}

// Disabled state
.dropdown-menu > .disabled > a {
  &,
  &:hover,
  &:focus {
    border-color: transparent;
  }
}
// Nuke hover/focus effects
.dropdown-menu > .disabled > a {
  &:hover,
  &:focus {
    border-color: transparent;
  }
}

// Dropdown section headers
.dropdown-header {
  padding-left: 10px;
  padding-right: 10px;
  text-transform: uppercase;
}

// Position Menu closer to button
.btn-group, .input-group-btn {
  > .dropdown-menu {
    margin-top: -1px;
  }
}

// Position Menu closer to button (dropup-menu)
.dropup .dropdown-menu {
  margin-bottom: -1px;
}

// Add back styles for dropdown-submenu
.dropdown-submenu {
  position:relative;
  &:hover {
    > a {
      background-color: @dropdown-link-hover-bg;
      border-color: #b3d3e7;
    }
    > .dropdown-menu {
      display: block;
    }
  }
  &.pull-left {
    float: none !important;
    > .dropdown-menu {
      left: auto;
      margin-left: 10px;
      right: 100%;
    }
  }
  > a {
    padding-right: 20px !important;
    &:after {
      content: @fa-var-angle-right;
      font-family: @icon-font-name-fa;
      display: block;
      position: absolute;
      right: 10px;
      top: 2px;
    }
  }
  > .dropdown-menu {
    left: 100%;
    margin-top: 0;
    top: -6px;
  }
  .dropup & > .dropdown-menu {
    bottom: -5px;
    top: auto;
  }
  .open &.active > .dropdown-menu {
    display: block;
  }
}