responsive-navbar.less 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. //
  2. // Responsive: Navbar
  3. // --------------------------------------------------
  4. // TABLETS AND BELOW
  5. // -----------------
  6. @media (max-width: @navbarCollapseWidth) {
  7. // UNFIX THE TOPBAR
  8. // ----------------
  9. // Remove any padding from the body
  10. body {
  11. padding-top: 0;
  12. }
  13. // Unfix the navbars
  14. .navbar-fixed-top,
  15. .navbar-fixed-bottom {
  16. position: static;
  17. }
  18. .navbar-fixed-top {
  19. margin-bottom: @baseLineHeight;
  20. }
  21. .navbar-fixed-bottom {
  22. margin-top: @baseLineHeight;
  23. }
  24. .navbar-fixed-top .navbar-inner,
  25. .navbar-fixed-bottom .navbar-inner {
  26. padding: 5px;
  27. }
  28. .navbar .container {
  29. width: auto;
  30. padding: 0;
  31. }
  32. // Account for brand name
  33. .navbar .brand {
  34. padding-left: 10px;
  35. padding-right: 10px;
  36. margin: 0 0 0 -5px;
  37. }
  38. // COLLAPSIBLE NAVBAR
  39. // ------------------
  40. // Nav collapse clears brand
  41. .nav-collapse {
  42. clear: both;
  43. }
  44. // Block-level the nav
  45. .nav-collapse .nav {
  46. float: none;
  47. margin: 0 0 (@baseLineHeight / 2);
  48. }
  49. .nav-collapse .nav > li {
  50. float: none;
  51. }
  52. .nav-collapse .nav > li > a {
  53. margin-bottom: 2px;
  54. }
  55. .nav-collapse .nav > .divider-vertical {
  56. display: none;
  57. }
  58. .nav-collapse .nav .nav-header {
  59. color: @navbarText;
  60. text-shadow: none;
  61. }
  62. // Nav and dropdown links in navbar
  63. .nav-collapse .nav > li > a,
  64. .nav-collapse .dropdown-menu a {
  65. padding: 9px 15px;
  66. font-weight: bold;
  67. color: @navbarLinkColor;
  68. .border-radius(3px);
  69. }
  70. // Buttons
  71. .nav-collapse .btn {
  72. padding: 4px 10px 4px;
  73. font-weight: normal;
  74. .border-radius(@baseBorderRadius);
  75. }
  76. .nav-collapse .dropdown-menu li + li a {
  77. margin-bottom: 2px;
  78. }
  79. .nav-collapse .nav > li > a:hover,
  80. .nav-collapse .nav > li > a:focus,
  81. .nav-collapse .dropdown-menu a:hover,
  82. .nav-collapse .dropdown-menu a:focus {
  83. background-color: @navbarBackground;
  84. }
  85. .navbar-inverse .nav-collapse .nav > li > a,
  86. .navbar-inverse .nav-collapse .dropdown-menu a {
  87. color: @navbarInverseLinkColor;
  88. }
  89. .navbar-inverse .nav-collapse .nav > li > a:hover,
  90. .navbar-inverse .nav-collapse .nav > li > a:focus,
  91. .navbar-inverse .nav-collapse .dropdown-menu a:hover,
  92. .navbar-inverse .nav-collapse .dropdown-menu a:focus {
  93. background-color: @navbarInverseBackground;
  94. }
  95. // Buttons in the navbar
  96. .nav-collapse.in .btn-group {
  97. margin-top: 5px;
  98. padding: 0;
  99. }
  100. // Dropdowns in the navbar
  101. .nav-collapse .dropdown-menu {
  102. position: static;
  103. top: auto;
  104. left: auto;
  105. float: none;
  106. display: none;
  107. max-width: none;
  108. margin: 0 15px;
  109. padding: 0;
  110. background-color: transparent;
  111. border: none;
  112. .border-radius(0);
  113. .box-shadow(none);
  114. }
  115. .nav-collapse .open > .dropdown-menu {
  116. display: block;
  117. }
  118. .nav-collapse .dropdown-menu:before,
  119. .nav-collapse .dropdown-menu:after {
  120. display: none;
  121. }
  122. .nav-collapse .dropdown-menu .divider {
  123. display: none;
  124. }
  125. .nav-collapse .nav > li > .dropdown-menu {
  126. &:before,
  127. &:after {
  128. display: none;
  129. }
  130. }
  131. // Forms in navbar
  132. .nav-collapse .navbar-form,
  133. .nav-collapse .navbar-search {
  134. float: none;
  135. padding: (@baseLineHeight / 2) 15px;
  136. margin: (@baseLineHeight / 2) 0;
  137. border-top: 1px solid @navbarBackground;
  138. border-bottom: 1px solid @navbarBackground;
  139. .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1)");
  140. }
  141. .navbar-inverse .nav-collapse .navbar-form,
  142. .navbar-inverse .nav-collapse .navbar-search {
  143. border-top-color: @navbarInverseBackground;
  144. border-bottom-color: @navbarInverseBackground;
  145. }
  146. // Pull right (secondary) nav content
  147. .navbar .nav-collapse .nav.pull-right {
  148. float: none;
  149. margin-left: 0;
  150. }
  151. // Hide everything in the navbar save .brand and toggle button */
  152. .nav-collapse,
  153. .nav-collapse.collapse {
  154. overflow: hidden;
  155. height: 0;
  156. }
  157. // Navbar button
  158. .navbar .btn-navbar {
  159. display: block;
  160. }
  161. // STATIC NAVBAR
  162. // -------------
  163. .navbar-static .navbar-inner {
  164. padding-left: 10px;
  165. padding-right: 10px;
  166. }
  167. }
  168. // DEFAULT DESKTOP
  169. // ---------------
  170. @media (min-width: @navbarCollapseDesktopWidth) {
  171. // Required to make the collapsing navbar work on regular desktops
  172. .nav-collapse.collapse {
  173. height: auto !important;
  174. overflow: visible !important;
  175. }
  176. }