navs.less 6.7 KB

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