navbar.less 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. // NAVBAR (FIXED AND STATIC)
  2. // -------------------------
  3. // COMMON STYLES
  4. // -------------
  5. .navbar {
  6. overflow: visible;
  7. margin-bottom: @baseLineHeight;
  8. }
  9. // Gradient is applied to it's own element because overflow visible is not honored by IE when filter is present
  10. .navbar-inner {
  11. padding-left: 20px;
  12. padding-right: 20px;
  13. #gradient > .vertical(@navbarBackgroundHighlight, @navbarBackground);
  14. .border-radius(4px);
  15. @shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);
  16. .box-shadow(@shadow);
  17. }
  18. // Navbar button for toggling navbar items in responsive layouts
  19. .btn-navbar {
  20. display: none;
  21. float: right;
  22. padding: 7px 10px;
  23. margin-left: 5px;
  24. margin-right: 5px;
  25. .buttonBackground(@navbarBackgroundHighlight, @navbarBackground);
  26. @shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);
  27. .box-shadow(@shadow);
  28. }
  29. .btn-navbar .icon-bar {
  30. display: block;
  31. width: 18px;
  32. height: 2px;
  33. background-color: #f5f5f5;
  34. .border-radius(1px);
  35. .box-shadow(0 1px 0 rgba(0,0,0,.25));
  36. }
  37. .btn-navbar .icon-bar + .icon-bar {
  38. margin-top: 3px;
  39. }
  40. // Override the default collapsed state
  41. .nav-collapse.collapse {
  42. height: auto;
  43. }
  44. // Brand, links, text, and buttons
  45. .navbar {
  46. // Hover and active states
  47. .brand:hover {
  48. text-decoration: none;
  49. }
  50. // Website or project name
  51. .brand {
  52. float: left;
  53. display: block;
  54. padding: 8px 20px 12px;
  55. margin-left: -20px; // negative indent to left-align the text down the page
  56. font-size: 20px;
  57. font-weight: 200;
  58. line-height: 1;
  59. color: @white;
  60. }
  61. // Plain text in topbar
  62. .navbar-text {
  63. margin-bottom: 0;
  64. line-height: 40px;
  65. color: @navbarText;
  66. a:hover {
  67. color: @white;
  68. background-color: transparent;
  69. }
  70. }
  71. // Buttons in navbar
  72. .btn,
  73. .btn-group {
  74. margin-top: 5px; // make buttons vertically centered in navbar
  75. }
  76. .btn-group .btn {
  77. margin-top: 0;
  78. }
  79. }
  80. // Navbar forms
  81. .navbar-form {
  82. margin-bottom: 0; // remove default bottom margin
  83. .clearfix();
  84. input,
  85. select {
  86. display: inline-block;
  87. margin-top: 5px;
  88. margin-bottom: 0;
  89. }
  90. .radio,
  91. .checkbox {
  92. margin-top: 5px;
  93. }
  94. input[type="image"],
  95. input[type="checkbox"],
  96. input[type="radio"] {
  97. margin-top: 3px;
  98. }
  99. }
  100. // Navbar search
  101. .navbar-search {
  102. position: relative;
  103. float: left;
  104. margin-top: 6px;
  105. margin-bottom: 0;
  106. .search-query {
  107. padding: 4px 9px;
  108. #font > .sans-serif(13px, normal, 1);
  109. color: @white;
  110. color: rgba(255,255,255,.75);
  111. background: #666;
  112. background: rgba(255,255,255,.3);
  113. border: 1px solid #111;
  114. @shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15);
  115. .box-shadow(@shadow);
  116. .transition(none);
  117. // Placeholder text gets special styles; can't be bundled together though for some reason
  118. .placeholder(@grayLighter);
  119. // Hover states
  120. &:hover {
  121. color: @white;
  122. background-color: @grayLight;
  123. background-color: rgba(255,255,255,.5);
  124. }
  125. // Focus states (we use .focused since IE8 and down doesn't support :focus)
  126. &:focus,
  127. &.focused {
  128. padding: 5px 10px;
  129. color: @grayDark;
  130. text-shadow: 0 1px 0 @white;
  131. background-color: @white;
  132. border: 0;
  133. .box-shadow(0 0 3px rgba(0,0,0,.15));
  134. outline: 0;
  135. }
  136. }
  137. }
  138. // FIXED NAVBAR
  139. // ------------
  140. .navbar-fixed-top {
  141. position: fixed;
  142. top: 0;
  143. right: 0;
  144. left: 0;
  145. z-index: @zindexFixedNavbar;
  146. }
  147. .navbar-fixed-top .navbar-inner {
  148. padding-left: 0;
  149. padding-right: 0;
  150. .border-radius(0);
  151. }
  152. // NAVIGATION
  153. // ----------
  154. .navbar .nav {
  155. position: relative;
  156. left: 0;
  157. display: block;
  158. float: left;
  159. margin: 0 10px 0 0;
  160. }
  161. .navbar .nav.pull-right {
  162. float: right; // redeclare due to specificity
  163. }
  164. .navbar .nav > li {
  165. display: block;
  166. float: left;
  167. }
  168. // Links
  169. .navbar .nav > li > a {
  170. float: none;
  171. padding: 10px 10px 11px;
  172. line-height: 19px;
  173. color: @navbarLinkColor;
  174. text-decoration: none;
  175. text-shadow: 0 -1px 0 rgba(0,0,0,.25);
  176. }
  177. // Hover
  178. .navbar .nav > li > a:hover {
  179. background-color: transparent;
  180. color: @navbarLinkColorHover;
  181. text-decoration: none;
  182. }
  183. // Active nav items
  184. .navbar .nav .active > a,
  185. .navbar .nav .active > a:hover {
  186. color: @navbarLinkColorHover;
  187. text-decoration: none;
  188. background-color: @navbarBackground;
  189. }
  190. // Dividers (basically a vertical hr)
  191. .navbar .divider-vertical {
  192. height: @navbarHeight;
  193. width: 1px;
  194. margin: 0 9px;
  195. overflow: hidden;
  196. background-color: @navbarBackground;
  197. border-right: 1px solid @navbarBackgroundHighlight;
  198. }
  199. // Secondary (floated right) nav in topbar
  200. .navbar .nav.pull-right {
  201. margin-left: 10px;
  202. margin-right: 0;
  203. }
  204. // Dropdown menus
  205. // --------------
  206. // Menu position and menu carets
  207. .navbar .dropdown-menu {
  208. margin-top: 1px;
  209. .border-radius(4px);
  210. &:before {
  211. content: '';
  212. display: inline-block;
  213. border-left: 7px solid transparent;
  214. border-right: 7px solid transparent;
  215. border-bottom: 7px solid #ccc;
  216. border-bottom-color: rgba(0,0,0,.2);
  217. position: absolute;
  218. top: -7px;
  219. left: 9px;
  220. }
  221. &:after {
  222. content: '';
  223. display: inline-block;
  224. border-left: 6px solid transparent;
  225. border-right: 6px solid transparent;
  226. border-bottom: 6px solid @white;
  227. position: absolute;
  228. top: -6px;
  229. left: 10px;
  230. }
  231. }
  232. // Dropdown toggle caret
  233. .navbar .nav .dropdown-toggle .caret,
  234. .navbar .nav .open.dropdown .caret {
  235. border-top-color: @white;
  236. }
  237. .navbar .nav .active .caret {
  238. .opacity(100);
  239. }
  240. // Remove background color from open dropdown
  241. .navbar .nav .open > .dropdown-toggle,
  242. .navbar .nav .active > .dropdown-toggle,
  243. .navbar .nav .open.active > .dropdown-toggle {
  244. background-color: transparent;
  245. }
  246. // Dropdown link on hover
  247. .navbar .nav .active > .dropdown-toggle:hover {
  248. color: @white;
  249. }
  250. // Right aligned menus need alt position
  251. .navbar .nav.pull-right .dropdown-menu {
  252. left: auto;
  253. right: 0;
  254. &:before {
  255. left: auto;
  256. right: 12px;
  257. }
  258. &:after {
  259. left: auto;
  260. right: 13px;
  261. }
  262. }