sidebar.less 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. //side menu styling
  2. //some sidebar variables
  3. @sidebar-background: #F2F2F2;
  4. @sidebar-border: #CCC;
  5. @nav-item-color: #585858;
  6. @nav-item-background: #F8F8F8;
  7. @nav-item-border: #E5E5E5;
  8. @nav-item-color-hover: mix(#4B88B7 , @nav-item-color-focus , 25%);
  9. @nav-item-background-hover: #FFF;
  10. @nav-item-background-open: #FAFAFA;
  11. @nav-item-color-active: #2B7DBC;//#0B6CBC;
  12. @nav-item-background-active: #FFF;
  13. @nav-item-color-focus: #1963AA;
  14. @nav-item-icon-width: 30px;
  15. @nav-item-hover-indicator: #629CC9;
  16. @nav-item-arrow-color: #777;
  17. @nav-item-arrow-color-active: #4B88B7;
  18. @submenu-border: @nav-item-border;
  19. @submenu-background: #FFF;
  20. @submenu-item-background: #FFF;
  21. @submenu-item-color: #616161;
  22. @submenu-item-border: #E4E4E4;
  23. @submenu-item-icon-size: 18px;
  24. @submenu-item-color-hover: #4B88B7;
  25. @submenu-item-background-hover: #F1F5F9;
  26. @submenu-item-icon-active: #C86139;
  27. @submenu-item-background-active: #F5F7FA;
  28. @submenu-border-active: #83B6D1;
  29. @3rd-level-item-background-hover: @submenu-item-background-hover;
  30. @3rd-level-item-color-hover: @submenu-item-color-hover;
  31. @submenu-tree-line-style: dotted;
  32. @submenu-tree-line-color: mix(#BCCFE0 , #7EAACB);
  33. @submenu-tree-line-color-active: mix(mix(#BCCFE0 , #7EAACB) , #7EAACB);
  34. @menumin-text-background: #F5F5F5;
  35. @menumin-border: #CCC;
  36. @menumin-shadow1:~"2px 1px 2px 0 rgba(0,0,0,0.1)";//!ignore
  37. @menumin-shadow2:~"2px 2px 2px 0 rgba(0,0,0,0.1)";//!ignore
  38. @sidebar-toggle-background: #F3F3F3;
  39. @sidebar-toggle-border: #E0E0E0;
  40. @sidebar-toggle-icon-color: #AAA;
  41. @sidebar-toggle-icon-border: #BBB;
  42. @sidebar-toggle-icon-background: #FFF;
  43. @shortcuts-background: #FAFAFA;
  44. @shortcuts-border: #DDD;
  45. @hover-submenu-border: @menumin-border;
  46. @zindex-sidebar-fixed: @zindex-navbar-fixed - 3;
  47. @zindex-breadcrumbs-fixed: @zindex-sidebar-fixed - 3;//so that .sidebar-shortcuts appears above breadcrumbs.
  48. @zindex-submenu: @zindex-sidebar-fixed - 1;
  49. .sidebar {
  50. width: @sidebar-width;
  51. float: left;
  52. position: static;
  53. //why not simply position:absolute?
  54. //because we need the page height to be at least as high as the sidebar in case the page content is too small
  55. padding-left: 0;//override .nav-collapse
  56. padding-right: 0;
  57. //the grey background of sidebar
  58. &:before {
  59. content: "";
  60. display: block;
  61. width: inherit;
  62. position: absolute;//the relative parent is "html" element
  63. top: 0;
  64. bottom: 0;
  65. z-index: -1;
  66. background-color: inherit;
  67. border-style: inherit;
  68. border-color: inherit;
  69. border-width: inherit;
  70. }
  71. }
  72. //side navigation
  73. /**li .@{icon} {
  74. & , .nav-list & {
  75. width: auto;
  76. }
  77. }*/
  78. .nav-list {
  79. margin: 0;
  80. padding: 0;
  81. list-style: none;
  82. > li , > li > a , .nav-header {
  83. margin: 0;
  84. }
  85. li > a:focus {
  86. outline: none;
  87. }
  88. }
  89. .nav-list > li {
  90. display: block;
  91. position: relative;
  92. float: none;
  93. padding: 0;
  94. border-style: solid;
  95. border-width: 1px 0 0;
  96. &:last-child {
  97. border-bottom-width: 1px;
  98. }
  99. &.active > a {
  100. font-weight: bold;
  101. }
  102. /////////
  103. > a {
  104. display: block;
  105. height: @nav-item-height;
  106. line-height: floor(@nav-item-height / 2) - 2;
  107. padding-left: 7px;
  108. text-shadow: none !important;
  109. font-size: @nav-item-font-size;
  110. text-decoration: none;
  111. > .menu-icon {
  112. display: inline-block;
  113. min-width: @nav-item-icon-width;
  114. margin-right: 2px;
  115. vertical-align: sub;
  116. text-align: center;
  117. font-size: @nav-item-icon-size;
  118. font-weight: normal;
  119. }
  120. }
  121. //the blue hover border on left
  122. &:before {
  123. display: none;
  124. content: "";
  125. position: absolute;
  126. top: -1px;
  127. left: 0;
  128. z-index: 1;
  129. height: @nav-item-height + 2;
  130. width: 3px;
  131. max-width: 3px;
  132. overflow: hidden;
  133. background-color: @nav-item-hover-indicator;
  134. @media only screen and (min-width: @grid-float-breakpoint) {
  135. .main-container.container .sidebar:not(.h-sidebar) & {
  136. left: -2px;
  137. }
  138. }
  139. .main-container.container .sidebar.sidebar-fixed:not(.h-sidebar) & {
  140. //.main-container.container .sidebar.sidebar-scroll:not(.h-sidebar) & {
  141. left: 0;
  142. }
  143. }
  144. &:hover:before {
  145. display: block;
  146. }
  147. // the submenu indicator arrow
  148. a > .arrow {
  149. display: block;
  150. width: 14px !important;
  151. height: 14px;
  152. line-height: 14px;
  153. text-shadow: none;
  154. font-size: @nav-item-arrow-size;
  155. position: absolute;
  156. right: 10px;
  157. top: floor(@nav-item-height / 3) - 1;
  158. padding: 0;
  159. text-align: center;
  160. }
  161. &.separator {
  162. height: 3px;
  163. background-color: transparent;
  164. position: static;
  165. margin: 1px 0;
  166. .box-shadow(none);
  167. }
  168. //submenu
  169. &.active .submenu {
  170. display: block;
  171. }
  172. .submenu {
  173. display: none;
  174. list-style: none;
  175. margin: 0;
  176. padding: 0;
  177. line-height: 1.5;
  178. position: relative;
  179. > li {
  180. margin-left: 0;
  181. position: relative;
  182. > a {
  183. display: block;
  184. position: relative;
  185. padding: 7px 0 9px 37px;
  186. margin: 0;
  187. border-top-width: 1px;
  188. border-top-style: dotted;
  189. &:hover {
  190. text-decoration: none;
  191. }
  192. }
  193. //optional icon before each item
  194. a > .menu-icon {
  195. display: none;
  196. font-size: @font-size-submenu-item-icon;
  197. font-weight: normal;
  198. width: @submenu-item-icon-size;
  199. height: auto;
  200. line-height: 12px;
  201. text-align: center;
  202. position: absolute;
  203. left: 10px;
  204. top: 11px;
  205. z-index: 1;
  206. background-color: inherit;
  207. }
  208. &.active, &:hover {
  209. > a > .menu-icon {
  210. //show the icon on hover or when active
  211. display: inline-block;
  212. }
  213. }
  214. }// > li
  215. }//end of submenu
  216. //first level submenu
  217. > .submenu {
  218. border-top: 1px solid;
  219. > li {
  220. //tree like menu
  221. &:before {
  222. //the horizontal line
  223. content: "";
  224. display: block;
  225. width: 7px;
  226. position: absolute;
  227. z-index: 1;
  228. left: 20px;
  229. top: 17px;
  230. border: 1px @submenu-tree-line-style;
  231. border-width: 1px 0 0;
  232. }
  233. }
  234. //the vertical tree line
  235. &:before {
  236. content: "";
  237. display: block;
  238. position: absolute;
  239. z-index: 1;
  240. left: 18px;
  241. top: 0;
  242. bottom: 0;
  243. border: 1px @submenu-tree-line-style;
  244. border-width: 0 0 0 1px;
  245. }
  246. }
  247. }//end of .nav-list > li
  248. .nav-list li {
  249. &:hover > a > .arrow , &.active > a > .arrow , &.open > a > .arrow {
  250. color: inherit;
  251. }
  252. }
  253. .nav-list li.open > .submenu {
  254. display: block;
  255. }
  256. //override opera only
  257. no_such_element:-o-prefocus, .nav-list > li > a > .menu-icon {
  258. vertical-align: middle;
  259. }
  260. .3rd_level_icon() {
  261. display: inline-block;
  262. //font-size: @font-size-submenu-3rd-level-icon;
  263. //color: inherit;
  264. width: auto;
  265. position: static;
  266. background-color: transparent;
  267. margin-right: 4px;
  268. }
  269. //3rd & 4th level menu
  270. .nav-list > li > .submenu {
  271. li > .submenu {
  272. display: none;
  273. }
  274. li.active > .submenu {
  275. display: block;
  276. }
  277. a > .arrow {
  278. right: 10px;
  279. top: 10px;
  280. font-size: floor(@nav-item-arrow-size * 0.9);
  281. }
  282. > li:first-child > a {
  283. border-top-width: 0;
  284. }
  285. li > .submenu > li {
  286. line-height: 18px;
  287. &:before {
  288. //hide the tree like menu
  289. display: none;
  290. }
  291. > a {
  292. //3rd level
  293. margin-left: 20px;
  294. padding-left: 22px;
  295. }
  296. > .submenu > li > a {
  297. //4th level
  298. margin-left: 20px;
  299. padding-left: 38px;
  300. }
  301. a > .menu-icon {
  302. .3rd_level_icon();
  303. color: inherit;
  304. }
  305. a {
  306. //font-size: @base-font-size;
  307. .menu-icon , .arrow {
  308. color: inherit;
  309. }
  310. }
  311. }
  312. li.open:not(.hover) > a {
  313. > .menu-icon {
  314. display: inline-block;
  315. }
  316. }
  317. }//.nav-list > li > .submenu
  318. //labels and badges inside nav item
  319. .nav-list a {
  320. .badge , .label {
  321. position: absolute;
  322. top: 9px;
  323. right: 10px;
  324. opacity: 0.88;
  325. font-size: @base-font-size - 1;
  326. padding-left: 6px;
  327. padding-right: 6px;
  328. .@{icon} {
  329. vertical-align: middle;
  330. margin: 0;
  331. }
  332. }
  333. &.dropdown-toggle {
  334. .badge , .label {
  335. right: 26px;//move lefter because of .arrow
  336. }
  337. }
  338. }
  339. .nav-list li:hover > a {
  340. .badge , .label {
  341. opacity: 1;
  342. }
  343. }
  344. .nav-list .submenu .submenu a {
  345. .badge , .label {
  346. top: 6px;
  347. }
  348. }
  349. //shortcut buttons and sidebar toggle
  350. @import "sidebar/sidebar-fixed.less";
  351. //shortcut buttons and sidebar toggle
  352. @import "sidebar/shortcuts-toggle.less";
  353. //sidebar active state arrows , etc
  354. @import "sidebar/active.less";
  355. //submenu compact
  356. @import "sidebar/compact.less";
  357. //submenu hover style
  358. @import "sidebar/hover.less";
  359. @import "sidebar/sub-arrow.less";
  360. //minimized sidebar mode
  361. @import "sidebar/min.less";
  362. //horizontal sidebar style
  363. @import "sidebar/horizontal.less";
  364. //sidebar responsive styles
  365. @import "sidebar/responsive-1.less";//default
  366. @import "sidebar/old-toggle-button.less";//old style toggle button
  367. @import "sidebar/responsive-2.less";//like minimized sidebar
  368. @import "sidebar/responsive-3.less";//bootstrap style
  369. @import "sidebar/multiple.less";//when 2 sidebars are used!
  370. .sidebar-scroll {
  371. .sidebar-shortcuts {
  372. min-height: @breadcrumb-height;
  373. border-bottom: 1px solid;
  374. }
  375. .sidebar-toggle {
  376. border-top: 1px solid;
  377. }
  378. .nav-list > li:first-child {
  379. border-top-width: 0;
  380. }
  381. .nav-list > li:last-child {
  382. border-bottom-width: 0;
  383. }
  384. .nav-wrap {
  385. .sidebar-shortcuts {
  386. min-height: @breadcrumb-height - 1;
  387. border-bottom-width: 0;
  388. + .nav-list > li:first-child , + .nav-wrap-up .nav-list > li:first-child {
  389. border-top-width: 1px;
  390. }
  391. }
  392. }
  393. .nav-wrap-t {
  394. .sidebar-toggle {
  395. border-top-width: 0;
  396. }
  397. .nav-list > li:last-child {
  398. border-bottom-width: 1px;
  399. }
  400. }
  401. }
  402. .sidebar {
  403. .nav-wrap + .ace-scroll {
  404. position: absolute;
  405. right: 0;
  406. top: 0;
  407. z-index: 1;
  408. }
  409. .nav-wrap + .scrollout {
  410. right: -8px;
  411. }
  412. }
  413. .sidebar .submenu.sub-scroll {
  414. overflow-y: scroll;
  415. overflow-x: hidden;
  416. -webkit-overflow-scrolling: touch;
  417. //-webkit-transform: translate3d(0,0,0);
  418. }