min.less 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. @sidebar-menu-min-text-height: (@nav-item-height + 2);
  2. .menu_min() {
  3. & , &.compact, &.navbar-collapse {
  4. width: @sidebar-min-width;
  5. }
  6. + .main-content {
  7. margin-left: (@sidebar-min-width);
  8. }
  9. .nav-list a {
  10. .badge , .label {
  11. position: relative;
  12. top: -1px;
  13. right: auto;
  14. left: 4px;
  15. }
  16. }
  17. .nav-list .submenu .submenu a {
  18. .badge , .label {
  19. top: 0;
  20. }
  21. }
  22. .nav-list > li {
  23. > a {
  24. position:relative;
  25. //first reset back to normal, to override things like .compact
  26. height: @nav-item-height;
  27. line-height: (@nav-item-height - 2);
  28. padding: 0;
  29. > .menu-icon {
  30. font-size: @nav-item-icon-size;
  31. height: auto;
  32. line-height: inherit;
  33. display: inline-block;
  34. vertical-align: sub;
  35. margin-right: 0;
  36. width: 44px;
  37. }
  38. > .menu-text {
  39. display: none;
  40. text-align: left;
  41. position: absolute;
  42. top: -1px;
  43. left: (@sidebar-min-width - 1);
  44. z-index: @zindex-submenu - 1;
  45. width: (@sidebar-width - 14);
  46. height: @sidebar-menu-min-text-height;
  47. line-height: (@nav-item-height - 1);
  48. padding-left: 12px;
  49. border: 1px solid;
  50. }
  51. &.dropdown-toggle > .menu-text {
  52. top:-1px;
  53. border-width: 1px 1px 0;
  54. }
  55. .arrow {
  56. display: none;
  57. }
  58. }
  59. &:hover > a > .menu-text,
  60. &.hover-show > a > .menu-text {
  61. display: block;
  62. }
  63. &.active > a:after {
  64. border-width: 10px 6px;
  65. top: 8px;
  66. }
  67. &.active.open > a:after {
  68. display: block;
  69. }
  70. &.active.open li.active > a:after {
  71. display: none;
  72. }
  73. > .submenu {
  74. position: absolute;
  75. z-index: @zindex-submenu;
  76. left: (@sidebar-min-width - 1);
  77. top: -1px;
  78. margin-top: 40px;
  79. padding-bottom: 2px;
  80. width: (@sidebar-width - 14);
  81. display: none !important;
  82. &:before {
  83. //hide the tree like submenu in minimized mode
  84. display: none;
  85. }
  86. &:after {
  87. //extra pixel
  88. //.submenu's border-top-color overlaps .submenu's border-right-color
  89. //so we add an extra pixel to change that point to border-right-color
  90. content: "";
  91. display: block;
  92. height: 1px;
  93. width: 1px;
  94. position: absolute;
  95. right: -1px;
  96. top: -1px;
  97. border-right: 1px solid;
  98. border-right-color: inherit;
  99. }
  100. li {
  101. &:before {
  102. display: none;
  103. }
  104. > a {
  105. margin-left: 0;
  106. padding-left: 22px;
  107. > .menu-icon {
  108. left: 4px;
  109. }
  110. }
  111. }
  112. }
  113. &.hover > .submenu {
  114. padding-bottom: 0;
  115. }
  116. &.open > .submenu {//submenu is shown in non-minimized mode
  117. display: none;
  118. }
  119. &:hover > .submenu,
  120. &.hover-show > .submenu {
  121. display: block !important;
  122. }
  123. }
  124. //-li > .arrow
  125. .nav-list > li > .arrow {
  126. top: 10px;
  127. &:after , &:before {
  128. border-width: 8px;
  129. left: -16px;
  130. }
  131. &:before {
  132. left: -17px;
  133. }
  134. }
  135. .nav-list li > .arrow {
  136. right: -1px;
  137. }
  138. .nav-list > li:hover > .arrow,
  139. .nav-list > li.hover-show > .arrow {
  140. display: block;
  141. }
  142. .nav-list > li.pull_up > .arrow {
  143. z-index: @zindex-submenu + 1;
  144. &:after , &:before {
  145. border-width: 10px;
  146. left: -20px;
  147. }
  148. &:before {
  149. left: -21px;
  150. }
  151. }
  152. //sidebar shortcuts
  153. .sidebar-shortcuts {
  154. position: relative;
  155. overflow: visible;
  156. z-index: 1;//to appear above breadcrumbs
  157. }
  158. .sidebar-shortcuts-mini {
  159. display: block;
  160. }
  161. .sidebar-shortcuts-large {
  162. display: none;
  163. position: absolute;
  164. top: 0;
  165. left: @sidebar-min-width - 1;
  166. width: (@sidebar-width - 8);
  167. padding: 0 2px 3px;
  168. border: 1px solid;
  169. border-top-width: 0;
  170. }
  171. .sidebar-shortcuts:hover .sidebar-shortcuts-large,
  172. .sidebar-shortcuts.hover-show .sidebar-shortcuts-large {
  173. display: block;
  174. }
  175. .sidebar-toggle { //minimized collapse button
  176. &:before {
  177. left: 5px;
  178. right: 5px;
  179. }
  180. > .@{icon} {
  181. font-size: @font-size-sidebar-toggle;
  182. padding: 0 4px;
  183. line-height: 15px;
  184. border-width: 1px;
  185. }
  186. }
  187. .nav-list > li > .submenu {
  188. li > .submenu > li {
  189. > a {
  190. //3rd level
  191. margin-left: 2px;// !important;
  192. padding-left: 30px;
  193. }
  194. > .submenu > li > a {
  195. //4th level
  196. margin-left: 2px;// !important;
  197. padding-left: 45px;
  198. }
  199. }
  200. li.active > a:after {
  201. display: none;
  202. }
  203. }
  204. .nav-list li.active.open > .submenu > li.active > a:after {
  205. display: none;
  206. }
  207. //hide the active menu indicator on hover (it goes behind the li > .arrow)
  208. .nav-list > li.active:hover > a:after,
  209. .nav-list > li.active.hover-show > a:after,
  210. .nav-list > li.active.open:hover > a:after {
  211. display: none;
  212. }
  213. .nav-list > li.active:hover:after {
  214. display: none;
  215. }
  216. }
  217. .enable_sidebar_collapse() when(@enable-sidebar-collapse = true) {
  218. .sidebar.menu-min {
  219. .menu_min();
  220. .enable_submenu_hover_min() when(@enable-submenu-hover = true) {
  221. @media (min-width: @screen-hover-menu) {
  222. .nav-list li.hover > .submenu {
  223. margin-left: 0;
  224. }
  225. .nav-list > li > .submenu li.hover > .submenu > li > a,
  226. .nav-list > li > .submenu li > .submenu > li.hover > .submenu > li > a {
  227. margin-left: 0 !important;
  228. }
  229. }
  230. }
  231. .enable_submenu_hover_min();
  232. .enable_compact_menu_min() when(@enable-compact-menu = true) {
  233. @media (min-width: @screen-compact-menu) {
  234. &.compact .nav-list > li > a {
  235. height: 39px;
  236. line-height: 37px;
  237. padding: 0 16px 0 7px;
  238. position: relative;
  239. }
  240. &.compact .nav-list > li > a > .menu-icon {
  241. font-size: @nav-item-icon-size;
  242. height: auto;
  243. line-height: inherit;
  244. display: inline-block;
  245. vertical-align: sub;
  246. width: auto;
  247. }
  248. }
  249. }
  250. .enable_compact_menu_min();
  251. }
  252. }
  253. .enable_sidebar_collapse();