horizontal.less 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. @h-sidebar-background: @nav-item-background;
  2. @h-sidebar-preground: #E4E4E4;
  3. @h-sidebar-preshadow: ~"0 -1px 1px 0 rgba(0, 0, 0, 0.05) inset";
  4. @h-nav-item-border-active: #79B0CE;
  5. @h-nav-item-border-hover: #CEDDE5;
  6. @h-navbar-shadow: ~"0 2px 4px 0 rgba(0, 0, 0, 0.25)";
  7. .enable_horizontal_menu() when (@enable-horizontal-menu = true) {
  8. @media only screen and (min-width: @grid-float-breakpoint) {
  9. .navbar.h-navbar {
  10. .box-shadow(@h-navbar-shadow);
  11. }
  12. .sidebar.h-sidebar {
  13. position: relative;
  14. float: none !important;
  15. width: auto;// !important;
  16. margin-top: 17px;
  17. border-width: 0 !important;
  18. box-shadow: none;
  19. &.menu-min, &.compact {
  20. width: auto;
  21. }
  22. &.sidebar-fixed {
  23. position: fixed;
  24. }
  25. &.no-gap {
  26. margin-top: auto;
  27. .nav-list {
  28. padding-top: 3px;
  29. }
  30. }
  31. &:before {
  32. display: block;
  33. position: absolute;
  34. z-index: -1;
  35. left:0 !important;
  36. right: 0 !important;
  37. top: -17px;
  38. bottom: auto;
  39. height: 17px;
  40. width: auto;
  41. border-width: 0;
  42. border-bottom: 1px solid;
  43. border-bottom-color: inherit;
  44. }
  45. &.lower-highlight .nav-list > li:before {
  46. top: 0;
  47. }
  48. .main-content & .nav-list > li:before {
  49. top: 0;
  50. }
  51. .nav-list {
  52. border-width: 0;
  53. border-bottom: 2px solid @h-nav-item-border-active;
  54. }
  55. .nav-list > li {
  56. float: left;
  57. border-width: 0 0 0 1px;
  58. margin-left: 0;
  59. &:last-child {
  60. border-right-width: 1px;
  61. }
  62. //the hover highlight line
  63. &:before {
  64. left: -1px;
  65. right: -1px;
  66. bottom: auto;
  67. top: -2px;
  68. max-width: none;
  69. width: auto;
  70. height: 2px;
  71. border-width: 0;
  72. }
  73. &.active:before {
  74. display: block;
  75. }
  76. &.active:after {
  77. display: none;
  78. }
  79. //&:hover, &.hover-show {
  80. //z-index: @zindex-submenu;
  81. //}
  82. //&.active {
  83. //z-index: @zindex-submenu + 1;
  84. //}
  85. }
  86. .nav-list > li:first-child {
  87. border-left-width: 0;
  88. margin-left: 0
  89. }
  90. .sidebar-shortcuts + .nav-list > li:first-child {
  91. border-left-width: 1px;
  92. margin-left: -1px;
  93. }
  94. //!importants are for overriding .menu-min and .compact
  95. .nav-list > li > a {
  96. line-height: 22px;
  97. height: auto;
  98. padding: 10px 14px;
  99. > .menu-icon {
  100. display: block;
  101. margin: 1px 0 4px;
  102. line-height: inherit;
  103. width: auto;
  104. }
  105. > .arrow {
  106. display: none;
  107. }
  108. }
  109. //hover submenu
  110. .nav-list > li.hover {
  111. &.pull_right {
  112. float: none !important;
  113. }
  114. > .submenu {
  115. top: 100%;
  116. left: 1px;
  117. margin-top: auto;
  118. margin-left: -2px;
  119. width: @sidebar-width;
  120. z-index: @zindex-submenu;
  121. }
  122. &.pull_right > .submenu {
  123. left: auto;
  124. right: 1px;
  125. }
  126. //-li > .arrow
  127. > .arrow {
  128. right: auto;
  129. top: auto;
  130. left: 24px;
  131. bottom: 7px;
  132. }
  133. &.pull_right > .arrow {
  134. left: auto;
  135. right: 24px;
  136. }
  137. > .arrow:before, > .arrow:after {
  138. border-width: 0 8px 8px !important;
  139. }
  140. > .arrow:after {
  141. border-color: transparent;
  142. //!importants are for overriding .menu-min+.rtl
  143. border-left-color: transparent !important;
  144. border-right-color: transparent !important;
  145. -moz-border-right-colors: none !important;
  146. -moz-border-left-colors: none !important;
  147. -moz-border-top-colors: none;
  148. -moz-border-bottom-colors: none;
  149. left: -10px !important;
  150. right: auto !important;
  151. }
  152. > .arrow:before {
  153. border-color: transparent;
  154. //!importants are for overriding .menu-min+.rtl
  155. border-left-color: transparent !important;
  156. border-right-color: transparent !important;
  157. -moz-border-right-colors: none !important;
  158. -moz-border-left-colors: none !important;
  159. -moz-border-top-colors: none;
  160. -moz-border-bottom-colors: none;
  161. right: auto !important;
  162. left: -10px !important;
  163. top: -1px !important;
  164. }
  165. &:hover > a ~ .arrow , &.hover-show > a ~ .arrow {
  166. display: none;
  167. }
  168. &:hover > a.dropdown-toggle ~ .arrow , &.hover-show > a.dropdown-toggle ~ .arrow {
  169. display: block;
  170. }
  171. }
  172. //hover flip is when horizontal menu is shown on opposite direction so that it doesn't go out of window!
  173. .nav-list > li.hover-flip > .submenu {
  174. left: auto;
  175. right: 1px;
  176. margin-left: auto;
  177. margin-right: -2px;
  178. }
  179. .nav-list > li.hover-flip > .arrow {
  180. left: auto;
  181. right: 24px;
  182. }
  183. .nav-list li li.hover-flip > .submenu {
  184. left: auto;
  185. right: 100%;
  186. margin-left: auto;
  187. margin-right: -2px;
  188. }
  189. .nav-list li li.hover-flip > .arrow {
  190. filter: ~"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";
  191. .transform(~"scale(-1, 1)");
  192. left: 0;
  193. right: auto;
  194. }
  195. //add an arrow to shortcuts dropdown like //-li > .arrow
  196. .sidebar-shortcuts-large {
  197. &:before, &:after {
  198. display: block;
  199. content: "";
  200. position: absolute;
  201. left: 50%;
  202. margin-left: -8px;
  203. border: 1px solid transparent;
  204. border-width: 0 8px 8px;
  205. }
  206. }
  207. .sidebar-shortcuts-large:after {
  208. //border-bottom-color: #FFF;
  209. border-right-color: transparent;
  210. //-moz-border-bottom-colors: #FFF;
  211. -moz-border-right-colors: none;
  212. top: -8px;
  213. }
  214. .sidebar-shortcuts-large:before {
  215. -moz-border-bottom-colors: #CCC;
  216. border-bottom-color: #CCC;
  217. top: -9px;
  218. }
  219. .sidebar-toggle {
  220. position: absolute;
  221. top: 12px;
  222. right: 6px;
  223. background-color: transparent;
  224. border-width: 0;
  225. }
  226. .sidebar-shortcuts {
  227. float: left;
  228. display: block;
  229. overflow: visible;
  230. position: relative;
  231. margin: 0;
  232. padding: 12px 8px 9px;
  233. max-height: none !important;
  234. background-color: transparent;
  235. &:hover .sidebar-shortcuts-large, &.hover-show .sidebar-shortcuts-large {
  236. display: block;
  237. }
  238. }
  239. .sidebar-shortcuts-large {
  240. display: none;
  241. width: 52px;
  242. height: auto;
  243. position: absolute;
  244. z-index: @zindex-submenu - 1;
  245. top: 100%;
  246. margin-top: -5px;
  247. left: 10px;
  248. padding: 3px 2px;
  249. border: 1px solid;
  250. }
  251. .sidebar-shortcuts-mini {
  252. width:auto;
  253. max-width: 52px;
  254. display: block;
  255. background-color: transparent;
  256. padding-top: 3px;
  257. padding-bottom: 5px; // for .sidebar-shortcuts-large:"margin-top: -5px" to work, so that as soon as mouse is inside .sidebar-shortcuts, ".sidebar-shortcuts-large" is displayed
  258. > .btn {
  259. padding: 9px;
  260. }
  261. }
  262. .nav-list a .badge, .nav-list a .label {
  263. position: absolute;
  264. top: 11px;
  265. right: auto !important;
  266. left: 50%;
  267. margin-left: 10px;
  268. }
  269. + .main-content {
  270. margin-left: 0;
  271. .breadcrumbs {
  272. margin: 6px 9px;
  273. border: 1px solid;
  274. //.no-skin & {
  275. border-color: #E5E5E5;
  276. //}
  277. @media (max-width: @grid-float-breakpoint-max) {
  278. & {
  279. margin: 0;
  280. border-width: 0 0 1px;
  281. }
  282. }
  283. }
  284. }
  285. }//.h-sidebar
  286. .h-sidebar.sidebar-fixed {
  287. //z-index: 1000;
  288. top: auto;
  289. width: 100%;
  290. left:0;
  291. right: 0;
  292. &:before {
  293. z-index: auto;
  294. }
  295. & , .nav-list {
  296. border-right-width: 0;
  297. border-left-width: 0;
  298. }
  299. .sidebar-shortcuts {
  300. border-width: 0;
  301. }
  302. }
  303. .h-sidebar.sidebar-fixed {
  304. + .main-content {
  305. padding-top: 88px;
  306. }
  307. &.no-gap + .main-content {
  308. padding-top: 74px;
  309. }
  310. &.menu-min + .main-content {
  311. padding-top: 63px;
  312. }
  313. &.menu-min.no-gap + .main-content {
  314. padding-top: 49px;
  315. }
  316. }
  317. }//@media
  318. .enable_container_horizontal_menu() when(@enable-container = true) {
  319. //inside .container
  320. .main-container.container .h-sidebar.sidebar-fixed {
  321. left: 0;// !important;
  322. right: 0;// !important;
  323. width: auto;// !important;
  324. }
  325. @media (min-width: @screen-sm-min) {
  326. .main-container.container .h-sidebar.sidebar-fixed {
  327. left: auto !important;
  328. right: auto !important;
  329. width: @container-sm;// !important;
  330. }
  331. }
  332. @media (min-width: @screen-md-min) {
  333. .main-container.container .h-sidebar.sidebar-fixed {
  334. width: @container-md;// !important;
  335. }
  336. }
  337. @media (min-width: @screen-lg-min) {
  338. .main-container.container .h-sidebar.sidebar-fixed {
  339. width: @container-lg;// !important;
  340. }
  341. }
  342. /**
  343. @media (min-width: @screen-sm-min) and (max-width: @grid-float-breakpoint-max) {
  344. .main-container.container .sidebar.sidebar-fixed
  345. {
  346. left: auto;// !important;
  347. right: auto;// !important;
  348. width: @container-sm;// !important;
  349. }
  350. }
  351. @media (max-width: @grid-float-breakpoint-max) {
  352. .main-container.container .sidebar.sidebar-fixed {
  353. .sidebar-shortcuts {
  354. max-height: none;
  355. border-bottom-width: 0;
  356. }
  357. }
  358. }
  359. */
  360. }
  361. .enable_container_horizontal_menu();
  362. @media (min-width: @grid-float-breakpoint) {
  363. .sidebar.h-sidebar {
  364. &.menu-min {
  365. &, &.compact {//compact here to override RTL's
  366. .nav.nav-list > li > a {
  367. padding: 9px 12px;
  368. }
  369. }
  370. .nav-list > li > a > .menu-text {
  371. left: -1px;
  372. top: 100%;
  373. width: @hover-submenu-width;
  374. }
  375. .nav-list > li > a > .menu-icon {
  376. margin: 2px 0;
  377. }
  378. .nav-list > li.hover > .submenu {
  379. top: 100%;
  380. margin-top: @sidebar-menu-min-text-height;
  381. }
  382. .nav-list > li.hover {
  383. &:hover > a ~ .arrow , &.hover-show > a ~ .arrow {
  384. display: block;
  385. }
  386. }
  387. .sidebar-toggle {
  388. top: 6px;
  389. }
  390. .sidebar-shortcuts {
  391. padding: 0;
  392. }
  393. .sidebar-shortcuts-mini {
  394. padding-bottom: 4px;
  395. padding-top: 4px;
  396. > .btn {
  397. padding: 8px;
  398. }
  399. }
  400. .sidebar-shortcuts-large {
  401. left: 1px;
  402. margin-top: 4px;
  403. }
  404. }
  405. &.compact {
  406. .nav-list > li > a > .menu-icon {
  407. font-size: @nav-item-icon-size;
  408. height: auto;
  409. }
  410. &.menu-min .nav-list > li > a {
  411. height: auto;
  412. line-height: 22px;
  413. }
  414. }
  415. }
  416. }
  417. }
  418. .enable_horizontal_menu();
  419. /**
  420. @media only screen and (max-width: @grid-float-breakpoint-max) {
  421. .menu-toggler + .sidebar.h-sidebar {
  422. margin-top: (@breadcrumb-height - 1) !important;
  423. }
  424. .sidebar.h-sidebar.responsive-min , .sidebar.h-sidebar.navbar-collapse {
  425. margin-top: auto !important;
  426. }
  427. }
  428. */