navs.less 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. //
  2. // Navs
  3. // --------------------------------------------------
  4. // BASE CLASS
  5. // ----------
  6. .nav {
  7. margin-left: 0;
  8. margin-bottom: @baseLineHeight;
  9. list-style: none;
  10. }
  11. // Make links block level
  12. .nav > li > a {
  13. display: block;
  14. }
  15. .nav > li > a:hover,
  16. .nav > li > a:focus {
  17. text-decoration: none;
  18. background-color: @grayLighter;
  19. }
  20. // Prevent IE8 from misplacing imgs
  21. // See https://github.com/h5bp/html5-boilerplate/issues/984#issuecomment-3985989
  22. .nav > li > a > img {
  23. max-width: none;
  24. }
  25. // Redeclare pull classes because of specifity
  26. .nav > .pull-right {
  27. float: right;
  28. }
  29. // Nav headers (for dropdowns and lists)
  30. .nav-header {
  31. display: block;
  32. padding: 3px 15px;
  33. font-size: 11px;
  34. font-weight: bold;
  35. line-height: @baseLineHeight;
  36. color: @grayLight;
  37. text-shadow: 0 1px 0 rgba(255,255,255,.5);
  38. text-transform: uppercase;
  39. }
  40. // Space them out when they follow another list item (link)
  41. .nav li + .nav-header {
  42. margin-top: 9px;
  43. }
  44. // NAV LIST
  45. // --------
  46. .nav-list {
  47. padding-left: 15px;
  48. padding-right: 15px;
  49. margin-bottom: 0;
  50. }
  51. .nav-list > li > a,
  52. .nav-list .nav-header {
  53. margin-left: -15px;
  54. margin-right: -15px;
  55. text-shadow: 0 1px 0 rgba(255,255,255,.5);
  56. }
  57. .nav-list > li > a {
  58. padding: 3px 15px;
  59. }
  60. .nav-list > .active > a,
  61. .nav-list > .active > a:hover,
  62. .nav-list > .active > a:focus {
  63. color: @white;
  64. text-shadow: 0 -1px 0 rgba(0,0,0,.2);
  65. background-color: @linkColor;
  66. }
  67. .nav-list [class^="icon-"],
  68. .nav-list [class*=" icon-"] {
  69. margin-right: 2px;
  70. }
  71. // Dividers (basically an hr) within the dropdown
  72. .nav-list .divider {
  73. .nav-divider();
  74. }
  75. // TABS AND PILLS
  76. // -------------
  77. // Common styles
  78. .nav-tabs,
  79. .nav-pills {
  80. .clearfix();
  81. }
  82. .nav-tabs > li,
  83. .nav-pills > li {
  84. float: left;
  85. }
  86. .nav-tabs > li > a,
  87. .nav-pills > li > a {
  88. padding-right: 12px;
  89. padding-left: 12px;
  90. margin-right: 2px;
  91. line-height: 14px; // keeps the overall height an even number
  92. }
  93. // TABS
  94. // ----
  95. // Give the tabs something to sit on
  96. .nav-tabs {
  97. border-bottom: 1px solid #ddd;
  98. }
  99. // Make the list-items overlay the bottom border
  100. .nav-tabs > li {
  101. margin-bottom: -1px;
  102. }
  103. // Actual tabs (as links)
  104. .nav-tabs > li > a {
  105. padding-top: 8px;
  106. padding-bottom: 8px;
  107. line-height: @baseLineHeight;
  108. border: 1px solid transparent;
  109. .border-radius(4px 4px 0 0);
  110. &:hover,
  111. &:focus {
  112. border-color: @grayLighter @grayLighter #ddd;
  113. }
  114. }
  115. // Active state, and it's :hover/:focus to override normal :hover/:focus
  116. .nav-tabs > .active > a,
  117. .nav-tabs > .active > a:hover,
  118. .nav-tabs > .active > a:focus {
  119. color: @gray;
  120. background-color: @bodyBackground;
  121. border: 1px solid #ddd;
  122. border-bottom-color: transparent;
  123. cursor: default;
  124. }
  125. // PILLS
  126. // -----
  127. // Links rendered as pills
  128. .nav-pills > li > a {
  129. padding-top: 8px;
  130. padding-bottom: 8px;
  131. margin-top: 2px;
  132. margin-bottom: 2px;
  133. .border-radius(5px);
  134. }
  135. // Active state
  136. .nav-pills > .active > a,
  137. .nav-pills > .active > a:hover,
  138. .nav-pills > .active > a:focus {
  139. color: @white;
  140. background-color: @linkColor;
  141. }
  142. // STACKED NAV
  143. // -----------
  144. // Stacked tabs and pills
  145. .nav-stacked > li {
  146. float: none;
  147. }
  148. .nav-stacked > li > a {
  149. margin-right: 0; // no need for the gap between nav items
  150. }
  151. // Tabs
  152. .nav-tabs.nav-stacked {
  153. border-bottom: 0;
  154. }
  155. .nav-tabs.nav-stacked > li > a {
  156. border: 1px solid #ddd;
  157. .border-radius(0);
  158. }
  159. .nav-tabs.nav-stacked > li:first-child > a {
  160. .border-top-radius(4px);
  161. }
  162. .nav-tabs.nav-stacked > li:last-child > a {
  163. .border-bottom-radius(4px);
  164. }
  165. .nav-tabs.nav-stacked > li > a:hover,
  166. .nav-tabs.nav-stacked > li > a:focus {
  167. border-color: #ddd;
  168. z-index: 2;
  169. }
  170. // Pills
  171. .nav-pills.nav-stacked > li > a {
  172. margin-bottom: 3px;
  173. }
  174. .nav-pills.nav-stacked > li:last-child > a {
  175. margin-bottom: 1px; // decrease margin to match sizing of stacked tabs
  176. }
  177. // DROPDOWNS
  178. // ---------
  179. .nav-tabs .dropdown-menu {
  180. .border-radius(0 0 6px 6px); // remove the top rounded corners here since there is a hard edge above the menu
  181. }
  182. .nav-pills .dropdown-menu {
  183. .border-radius(6px); // make rounded corners match the pills
  184. }
  185. // Default dropdown links
  186. // -------------------------
  187. // Make carets use linkColor to start
  188. .nav .dropdown-toggle .caret {
  189. border-top-color: @linkColor;
  190. border-bottom-color: @linkColor;
  191. margin-top: 6px;
  192. }
  193. .nav .dropdown-toggle:hover .caret,
  194. .nav .dropdown-toggle:focus .caret {
  195. border-top-color: @linkColorHover;
  196. border-bottom-color: @linkColorHover;
  197. }
  198. /* move down carets for tabs */
  199. .nav-tabs .dropdown-toggle .caret {
  200. margin-top: 8px;
  201. }
  202. // Active dropdown links
  203. // -------------------------
  204. .nav .active .dropdown-toggle .caret {
  205. border-top-color: #fff;
  206. border-bottom-color: #fff;
  207. }
  208. .nav-tabs .active .dropdown-toggle .caret {
  209. border-top-color: @gray;
  210. border-bottom-color: @gray;
  211. }
  212. // Active:hover/:focus dropdown links
  213. // -------------------------
  214. .nav > .dropdown.active > a:hover,
  215. .nav > .dropdown.active > a:focus {
  216. cursor: pointer;
  217. }
  218. // Open dropdowns
  219. // -------------------------
  220. .nav-tabs .open .dropdown-toggle,
  221. .nav-pills .open .dropdown-toggle,
  222. .nav > li.dropdown.open.active > a:hover,
  223. .nav > li.dropdown.open.active > a:focus {
  224. color: @white;
  225. background-color: @grayLight;
  226. border-color: @grayLight;
  227. }
  228. .nav li.dropdown.open .caret,
  229. .nav li.dropdown.open.active .caret,
  230. .nav li.dropdown.open a:hover .caret,
  231. .nav li.dropdown.open a:focus .caret {
  232. border-top-color: @white;
  233. border-bottom-color: @white;
  234. .opacity(100);
  235. }
  236. // Dropdowns in stacked tabs
  237. .tabs-stacked .open > a:hover,
  238. .tabs-stacked .open > a:focus {
  239. border-color: @grayLight;
  240. }
  241. // TABBABLE
  242. // --------
  243. // COMMON STYLES
  244. // -------------
  245. // Clear any floats
  246. .tabbable {
  247. .clearfix();
  248. }
  249. .tab-content {
  250. overflow: auto; // prevent content from running below tabs
  251. }
  252. // Remove border on bottom, left, right
  253. .tabs-below > .nav-tabs,
  254. .tabs-right > .nav-tabs,
  255. .tabs-left > .nav-tabs {
  256. border-bottom: 0;
  257. }
  258. // Show/hide tabbable areas
  259. .tab-content > .tab-pane,
  260. .pill-content > .pill-pane {
  261. display: none;
  262. }
  263. .tab-content > .active,
  264. .pill-content > .active {
  265. display: block;
  266. }
  267. // BOTTOM
  268. // ------
  269. .tabs-below > .nav-tabs {
  270. border-top: 1px solid #ddd;
  271. }
  272. .tabs-below > .nav-tabs > li {
  273. margin-top: -1px;
  274. margin-bottom: 0;
  275. }
  276. .tabs-below > .nav-tabs > li > a {
  277. .border-radius(0 0 4px 4px);
  278. &:hover,
  279. &:focus {
  280. border-bottom-color: transparent;
  281. border-top-color: #ddd;
  282. }
  283. }
  284. .tabs-below > .nav-tabs > .active > a,
  285. .tabs-below > .nav-tabs > .active > a:hover,
  286. .tabs-below > .nav-tabs > .active > a:focus {
  287. border-color: transparent #ddd #ddd #ddd;
  288. }
  289. // LEFT & RIGHT
  290. // ------------
  291. // Common styles
  292. .tabs-left > .nav-tabs > li,
  293. .tabs-right > .nav-tabs > li {
  294. float: none;
  295. }
  296. .tabs-left > .nav-tabs > li > a,
  297. .tabs-right > .nav-tabs > li > a {
  298. min-width: 74px;
  299. margin-right: 0;
  300. margin-bottom: 3px;
  301. }
  302. // Tabs on the left
  303. .tabs-left > .nav-tabs {
  304. float: left;
  305. margin-right: 19px;
  306. border-right: 1px solid #ddd;
  307. }
  308. .tabs-left > .nav-tabs > li > a {
  309. margin-right: -1px;
  310. .border-radius(4px 0 0 4px);
  311. }
  312. .tabs-left > .nav-tabs > li > a:hover,
  313. .tabs-left > .nav-tabs > li > a:focus {
  314. border-color: @grayLighter #ddd @grayLighter @grayLighter;
  315. }
  316. .tabs-left > .nav-tabs .active > a,
  317. .tabs-left > .nav-tabs .active > a:hover,
  318. .tabs-left > .nav-tabs .active > a:focus {
  319. border-color: #ddd transparent #ddd #ddd;
  320. *border-right-color: @white;
  321. }
  322. // Tabs on the right
  323. .tabs-right > .nav-tabs {
  324. float: right;
  325. margin-left: 19px;
  326. border-left: 1px solid #ddd;
  327. }
  328. .tabs-right > .nav-tabs > li > a {
  329. margin-left: -1px;
  330. .border-radius(0 4px 4px 0);
  331. }
  332. .tabs-right > .nav-tabs > li > a:hover,
  333. .tabs-right > .nav-tabs > li > a:focus {
  334. border-color: @grayLighter @grayLighter @grayLighter #ddd;
  335. }
  336. .tabs-right > .nav-tabs .active > a,
  337. .tabs-right > .nav-tabs .active > a:hover,
  338. .tabs-right > .nav-tabs .active > a:focus {
  339. border-color: #ddd #ddd #ddd transparent;
  340. *border-left-color: @white;
  341. }
  342. // DISABLED STATES
  343. // ---------------
  344. // Gray out text
  345. .nav > .disabled > a {
  346. color: @grayLight;
  347. }
  348. // Nuke hover/focus effects
  349. .nav > .disabled > a:hover,
  350. .nav > .disabled > a:focus {
  351. text-decoration: none;
  352. background-color: transparent;
  353. cursor: default;
  354. }