navbar.less 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. //
  2. // Misago Navbar
  3. // --------------------------------------------------
  4. // Navbar scaffold
  5. .navbar-spacer {
  6. margin-bottom: @line-height-computed;
  7. .navbar-primary {
  8. .shadow-4dp();
  9. border-bottom: none;
  10. margin: 0px;
  11. padding: @navbar-inner-margin 0px;
  12. &.affix {
  13. .shadow-8dp();
  14. width: 100%;
  15. top: 0px;
  16. }
  17. }
  18. }
  19. // Navbar brand
  20. .navbar-primary {
  21. .navbar-brand {
  22. font-size: @font-size-large * 1.2;
  23. font-weight: @navbar-link-weight;
  24. img {
  25. display: inline-block;
  26. height: @navbar-brand-height;
  27. margin: ((@navbar-padding-vertical - @navbar-brand-height) / 2) 0px;
  28. position: relative;
  29. bottom: 3px;
  30. }
  31. }
  32. }
  33. // Navbar navs
  34. .navbar-primary {
  35. .navbar-nav {
  36. float: left;
  37. &>li {
  38. float: left;
  39. margin-right: @navbar-link-spacing;
  40. &:last-child {
  41. margin-right: 0px;
  42. }
  43. &>a {
  44. // Border radius
  45. border-radius: @navbar-link-radius;
  46. // Scale links up
  47. font-size: @navbar-link-size;
  48. font-weight: @navbar-link-weight;
  49. // We don't use .active states in navbar
  50. &:active, &:focus {
  51. background-color: @navbar-default-link-active-bg;
  52. color: @navbar-default-link-active-color;
  53. }
  54. }
  55. &.icon {
  56. &>a {
  57. height: @navbar-height;
  58. padding: (@navbar-height - @navbar-icon-size) / 2 @navbar-padding-horizontal;
  59. padding-bottom: 0px;
  60. &>.material-icons {
  61. .opacity(1);
  62. font-size: @navbar-icon-size;
  63. line-height: @navbar-icon-size;
  64. }
  65. // Align badges to glyhps
  66. &>.badge {
  67. vertical-align: top;
  68. position: relative;
  69. bottom: (@navbar-icon-size - (6px + @font-size-small)) / -2;
  70. }
  71. }
  72. }
  73. }
  74. }
  75. }
  76. // User Menu
  77. .navbar-primary {
  78. .navbar-user-nav {
  79. float: right;
  80. }
  81. .btn-start-thread {
  82. background: @navbar-start-thread-bg;
  83. height: @navbar-height;
  84. padding: (@navbar-height - @navbar-icon-size) / 2;
  85. padding-bottom: 0px;
  86. color: @navbar-start-thread-color;
  87. .material-icons {
  88. top: -1px;
  89. font-size: @navbar-icon-size;
  90. line-height: @navbar-icon-size;
  91. }
  92. &:hover, &:focus {
  93. background: @navbar-start-thread-hover-bg;
  94. color: @navbar-start-thread-hover-color;
  95. }
  96. &:active {
  97. background: @navbar-start-thread-active-bg;
  98. color: @navbar-start-thread-active-color;
  99. }
  100. }
  101. .user-menu {
  102. .dropdown-toggle {
  103. height: @navbar-height;
  104. padding: (@navbar-height - @navbar-avatar-height) / 2;
  105. padding-bottom: 0px;
  106. line-height: 0px;
  107. img {
  108. border-radius: @avatar-radius-small;
  109. width: @navbar-avatar-height;
  110. height: @navbar-avatar-height;
  111. }
  112. &:hover, &:focus {
  113. img {
  114. .shadow-2dp();
  115. }
  116. }
  117. }
  118. }
  119. }
  120. // Guest Menu
  121. .navbar-primary {
  122. .navbar-guest-nav {
  123. float: right;
  124. .btn-sign-in, .btn-join {
  125. margin-left: @navbar-link-spacing;
  126. }
  127. .btn-sign-in {
  128. background: @navbar-sign-in-bg;
  129. color: @navbar-sign-in-color;
  130. &:hover, &:focus {
  131. background: @navbar-sign-in-hover-bg;
  132. color: @navbar-sign-in-hover-color;
  133. }
  134. &:active {
  135. background: @navbar-sign-in-active-bg;
  136. color: @navbar-sign-in-active-color;
  137. }
  138. }
  139. .btn-join {
  140. background: @navbar-join-bg;
  141. color: @navbar-join-color;
  142. &:hover, &:focus {
  143. background: @navbar-join-hover-bg;
  144. color: @navbar-join-hover-color;
  145. }
  146. &:active {
  147. background: @navbar-join-active-bg;
  148. color: @navbar-join-active-color;
  149. }
  150. }
  151. }
  152. }
  153. // Navbar Buttons
  154. .navbar-primary {
  155. .navbar-btn {
  156. .btn-reset-styles();
  157. margin-top: 0px;
  158. margin-bottom: 0px;
  159. padding-top: 11px;
  160. padding-bottom: 11px;
  161. font-size: @navbar-link-size;
  162. &, &:hover, &:focus, &:active {
  163. border-color: transparent;
  164. }
  165. }
  166. }
  167. // Icons in buttons
  168. .navbar-primary {
  169. &>.navbar-btn {
  170. .material-icons {
  171. font-size: @font-size-large;
  172. }
  173. }
  174. }
  175. // Dropdowns
  176. .navbar-static-top {
  177. & .navbar-nav > li > .dropdown-menu {
  178. border-radius: @dropdown-border-radius;
  179. }
  180. }
  181. // Compact nav
  182. @media (max-width: @screen-sm-max) {
  183. .navbar-primary {
  184. min-height: @navbar-compact-height;
  185. }
  186. }
  187. .navbar-primary {
  188. .navbar-compact-nav {
  189. margin: 0px;
  190. float: none;
  191. width: 100%;
  192. &>li {
  193. margin: 0px;
  194. &>a, &>.dropdown-toggle {
  195. padding: 0px;
  196. padding-top: (@navbar-compact-height - @navbar-compact-item-height) / 2;
  197. height: @navbar-compact-height;
  198. text-align: center;
  199. // Align images
  200. img {
  201. width: @navbar-compact-item-height;
  202. height: @navbar-compact-item-height;
  203. position: static;
  204. }
  205. // Align and de-opac icons
  206. .material-icons {
  207. .opacity(1);
  208. font-size: @navbar-compact-item-height;
  209. line-height: @navbar-compact-item-height;
  210. }
  211. // Custom touched style
  212. &:active {
  213. background-color: @navbar-compact-link-active-bg;
  214. color: @navbar-compact-link-active-color;
  215. }
  216. }
  217. }
  218. // Even widths
  219. &.with-4-links {
  220. &>li {
  221. width: 25%;
  222. }
  223. }
  224. &.with-5-links {
  225. &>li {
  226. width: 20%;
  227. }
  228. }
  229. &.with-6-links {
  230. &>li {
  231. width: 16%;
  232. &:first-child, &:last-child {
  233. width: 18%;
  234. }
  235. }
  236. }
  237. &.with-7-links {
  238. &>li {
  239. width: 14%;
  240. &:first-child, &:last-child {
  241. width: 15%;
  242. }
  243. }
  244. }
  245. }
  246. }
  247. // Compact dropdown
  248. .compact-navbar-dropdown {
  249. margin-top: @line-height-computed * -1;
  250. margin-bottom: @line-height-computed;
  251. .dropdown-menu {
  252. border-radius: 0px;
  253. display: block;
  254. position: static;
  255. width: 100%;
  256. .shadow-6dp();
  257. }
  258. }