navbar.less 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. //
  2. // Misago Navbar
  3. // --------------------------------------------------
  4. // Affixed navbar
  5. .navbar-spacer {
  6. margin-bottom: @line-height-computed;
  7. .navbar-primary {
  8. border-bottom-width: 1px;
  9. margin: 0px;
  10. &.affix {
  11. .box-shadow(0px 0px 3px fadeOut(#333, 75%));
  12. width: 100%;
  13. top: 0px;
  14. }
  15. }
  16. }
  17. // Navbar brand
  18. .navbar-primary {
  19. .navbar-brand {
  20. font-size: @font-size-large * 1.2;
  21. font-weight: @weight-light;
  22. img {
  23. display: inline-block;
  24. height: @navbar-brand-height;
  25. margin: ((@line-height-computed - @navbar-brand-height) / 2) 0px;
  26. position: relative;
  27. bottom: 3px;
  28. }
  29. }
  30. }
  31. // Navbar navs
  32. .navbar-primary {
  33. .navbar-nav {
  34. float: left;
  35. &>li {
  36. float: left;
  37. &>a {
  38. // Scale links up
  39. font-size: @navbar-link-size;
  40. // We don't use .active states in navbar
  41. &:active, &:focus {
  42. color: @navbar-default-link-active-color;
  43. }
  44. // Align badges to glyhps
  45. &>.badge {
  46. vertical-align: inherit;
  47. margin: (@line-height-computed / -2) 0px;
  48. }
  49. &>.glyphicon {
  50. position: relative;
  51. top: 4px;
  52. }
  53. }
  54. }
  55. }
  56. }
  57. // User Menu
  58. .navbar-primary {
  59. .navbar-user-nav {
  60. float: right;
  61. .btn-success {
  62. position: relative;
  63. top: 1px;
  64. }
  65. }
  66. .user-menu {
  67. .dropdown-toggle {
  68. .fa {
  69. font-size: @font-size-base;
  70. }
  71. img {
  72. border-radius: @avatar-radius-small;
  73. margin: (@line-height-computed / -2) 0px;
  74. width: 28px;
  75. height: 28px;
  76. }
  77. }
  78. }
  79. }
  80. // Guest Menu
  81. .navbar-primary {
  82. .navbar-guest-nav {
  83. float: right;
  84. .btn {
  85. position: relative;
  86. top: 1px;
  87. }
  88. }
  89. }
  90. // Dropdowns
  91. .navbar-static-top {
  92. & .navbar-nav > li > .dropdown-menu {
  93. border-radius: @dropdown-border-radius;
  94. }
  95. }
  96. // Compact nav
  97. @media (max-width: @screen-sm-max) {
  98. .navbar-primary {
  99. min-height: @navbar-compact-height;
  100. }
  101. }
  102. .navbar-primary {
  103. .navbar-compact-nav {
  104. margin: 0px;
  105. float: none;
  106. width: 100%;
  107. &>li {
  108. &>a {
  109. padding: @navbar-compact-padding-vertical 0px;
  110. height: @navbar-compact-height;
  111. text-align: center;
  112. // Align glyphs to middle of height
  113. .glyphicon {
  114. position: static;
  115. font-size: 20px;
  116. }
  117. // Align images
  118. img {
  119. width: 28px;
  120. margin: ((@line-height-computed - 28) / 2) 0px;
  121. position: relative;
  122. bottom: 2px;
  123. }
  124. // Custom touched style
  125. &:active {
  126. background-color: @navbar-compact-link-active-bg;
  127. color: @navbar-compact-link-active-color;
  128. }
  129. }
  130. }
  131. .dropdown {
  132. &.open .dropdown-toggle {
  133. background-color: @navbar-compact-link-active-bg;
  134. color: @navbar-compact-link-active-color;
  135. }
  136. .dropdown-menu {
  137. position: absolute;
  138. float: right;
  139. width: 300px;
  140. margin-top: 2px;
  141. background-color: @dropdown-bg;
  142. border: 1px solid @dropdown-fallback-border; // IE8 fallback
  143. border: 1px solid @dropdown-border;
  144. border-radius: @dropdown-border-radius;
  145. .box-shadow(@dropdown-shadow);
  146. }
  147. }
  148. // Even widths
  149. &.with-4-links {
  150. &>li {
  151. width: 25%;
  152. }
  153. }
  154. &.with-5-links {
  155. &>li {
  156. width: 20%;
  157. }
  158. }
  159. &.with-6-links {
  160. &>li {
  161. width: 16%;
  162. &:first-child, &:last-child {
  163. width: 18%;
  164. }
  165. }
  166. }
  167. &.with-7-links {
  168. &>li {
  169. width: 14%;
  170. &:first-child, &:last-child {
  171. width: 15%;
  172. }
  173. }
  174. }
  175. }
  176. }