navbar.less 4.47 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// NAVBAR (FIXED AND STATIC)
// -------------------------

// Navbar variables
@navBarHeight: 40px;
@navBarBgStart: #333;
@navBarBgEnd: #222;

// Common styles
.navbar {
  overflow: visible;
}
// gradient is applied to it's own element because overflow visible is not honored by ie when filter is present
.navbar-inner {
  background-color: @navBarBgEnd;
  #gradient > .vertical(@navBarBgStart, @navBarBgEnd);
  @shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);
  .box-shadow(@shadow);
}
// Text and links
.navbar {
  // Hover and active states
23
  .brand:hover,
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
  ul .active > a {
    color: @white;
    text-decoration: none;
    background-color: @navBarBgStart;
    background-color: rgba(255,255,255,.05);
  }
  // Website or project name
  .brand {
    float: left;
    display: block;
    padding: 8px 20px 12px;
    margin-left: -20px; // negative indent to left-align the text down the page
    font-size: 20px;
    font-weight: 200;
    line-height: 1;
    color: @white;
  }
  // Plain text in topbar
  p {
    margin: 0;
    line-height: 40px;
    a:hover {
      color: @white;
      background-color: transparent;
    }
  }
  // Buttons in navbar
  .btn {
    margin-top: 5px; // make buttons vertically centered in navbar
  }
}

56
57
58
// Navbar forms
.navbar-form {
  margin-bottom: 0; // remove default bottom margin
59
60
61
62
63
  input,
  select {
    display: inline-block;
    margin-bottom: 0;
  }
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
// Navbar search
.navbar-search {
  position: relative;
  float: left;
  margin-top: 6px;
  margin-bottom: 0;
  .search-query {
    padding: 4px 9px;
    #font > .sans-serif(13px, normal, 1);
    color: @white;
    color: rgba(255,255,255,.75);
    background-color: #444;
    background-color: rgba(255,255,255,.3);
    border: 1px solid #111;
    @shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15);
    .box-shadow(@shadow);
    .transition(none);

    // Placeholder text gets special styles; can't be bundled together though for some reason
    &:-moz-placeholder {
      color: @grayLighter;
    }
    &::-webkit-input-placeholder {
      color: @grayLighter;
    }
    // Hover states
    &:hover {
      color: @white;
      background-color: @grayLight;
      background-color: rgba(255,255,255,.5);
    }
    // Focus states (we use .focused since IE8 and down doesn't support :focus)
    &:focus,
    &.focused {
      padding: 5px 10px;
      color: @grayDark;
      text-shadow: 0 1px 0 @white;
      background-color: @white;
      border: 0;
      .box-shadow(0 0 3px rgba(0,0,0,.15));
      outline: 0;
    }
  }
}


// Static navbar
.navbar-static {
  margin-bottom: @baseLineHeight;
}
.navbar-static .navbar-inner {
  padding-left:  20px;
  padding-right: 20px;
  .border-radius(4px);
}

// Fixed navbar
.navbar-fixed {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
128
  z-index: @zindexFixedNavbar;
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
}



// NAVIGATION
// ----------

// Nav for navbar and topbar
// ul.nav for all topbar based navigation to avoid inheritance issues and over-specificity
.nav {
  position: relative;
  left: 0;
  display: block;
  float: left;
  margin: 0 10px 0 0;
  > li {
    display: block;
    float: left;
  }
  a {
    display: block;
    float: none;
    padding: 10px 10px 11px;
    line-height: 19px;
    color: @grayLight;
    text-decoration: none;
    text-shadow: 0 -1px 0 rgba(0,0,0,.25);
    &:hover {
      color: @white;
      text-decoration: none;
    }
  }
  .active > a {
    background-color: #222;
    background-color: rgba(0,0,0,.5);
  }
  // Dividers (basically a vertical hr)
166
  .vertical-divider {
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
    height: 40px;
    width: 1px;
    margin: 0 5px;
    overflow: hidden;
    background-color: #222;
    border-right: 1px solid #444;
  }

  // Secondary (floated right) nav in topbar
  &.secondary-nav {
    float: right;
    margin-left: 10px;
    margin-right: 0;
    .dropdown-menu {
      right: 0;
      border: 0;
    }
  }
  // Dropdowns within the .nav
  .dropdown-toggle:hover,
  .dropdown.open .dropdown-toggle {
    background: #444;
    background: rgba(255,255,255,.05);
  }
  .dropdown-menu {
    background-color: #333;
    .dropdown-toggle {
      color: @white;
      &.open {
        background: #444;
        background: rgba(255,255,255,.05);
      }
    }
    li a {
201
      padding: 4px 15px;
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
      color: #999;
      text-shadow: 0 1px 0 rgba(0,0,0,.5);
      &:hover {
        #gradient > .vertical(#292929,#191919);
        color: @white;
      }
    }
    .active a {
      color: @white;
    }
    .divider {
      background-color: #222;
      border-color: #444;
    }
  }
}