_sidebar-mini.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. //
  2. // Component: Sidebar Mini
  3. //
  4. // Logo style
  5. .logo-xs,
  6. .logo-xl {
  7. opacity: 1;
  8. position: absolute;
  9. visibility: visible;
  10. &.brand-image-xs {
  11. left: 18px;
  12. top: 12px;
  13. }
  14. &.brand-image-xl {
  15. left: 12px;
  16. top: 6px;
  17. }
  18. }
  19. .logo-xs {
  20. opacity: 0;
  21. visibility: hidden;
  22. &.brand-image-xl {
  23. left: 16px;
  24. top: 8px;
  25. }
  26. }
  27. .brand-link {
  28. &.logo-switch {
  29. &::before {
  30. content: "\00a0";
  31. }
  32. }
  33. }
  34. // Add sidebar-mini class to the body tag to activate this feature
  35. .sidebar-mini {
  36. @include media-breakpoint-up(lg) {
  37. @include sidebar-mini-breakpoint ();
  38. }
  39. }
  40. @include media-breakpoint-down(md) {
  41. .sidebar-mini.sidebar-collapse .main-sidebar {
  42. box-shadow: none !important;
  43. }
  44. }
  45. .sidebar-mini-md {
  46. @include media-breakpoint-up(md) {
  47. @include sidebar-mini-breakpoint ();
  48. }
  49. }
  50. @include media-breakpoint-down(sm) {
  51. .sidebar-mini-md.sidebar-collapse .main-sidebar {
  52. box-shadow: none !important;
  53. }
  54. }
  55. .sidebar-mini-xs {
  56. @include media-breakpoint-up(xs) {
  57. @include sidebar-mini-breakpoint ();
  58. }
  59. }
  60. .sidebar-mini,
  61. .sidebar-mini-md,
  62. .sidebar-mini-xs {
  63. .main-sidebar {
  64. .nav-child-indent .nav-treeview {
  65. .nav-link {
  66. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2 - 1rem);
  67. }
  68. .nav-treeview {
  69. .nav-link {
  70. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2 - 2rem);
  71. }
  72. .nav-treeview {
  73. .nav-link {
  74. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2 - 3rem);
  75. }
  76. .nav-treeview {
  77. .nav-link {
  78. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2 - 4rem);
  79. }
  80. .nav-treeview {
  81. .nav-link {
  82. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2 - 5rem);
  83. }
  84. }
  85. }
  86. }
  87. }
  88. }
  89. .nav-legacy {
  90. .nav-link {
  91. width: $sidebar-width;
  92. }
  93. &.nav-child-indent {
  94. .nav-treeview {
  95. .nav-link {
  96. width: calc(#{$sidebar-width} - 1rem);
  97. }
  98. .nav-treeview {
  99. .nav-link {
  100. width: calc(#{$sidebar-width} - 1rem - 1rem);
  101. }
  102. .nav-treeview {
  103. .nav-link {
  104. width: calc(#{$sidebar-width} - 1rem - 2rem);
  105. }
  106. .nav-treeview {
  107. .nav-link {
  108. width: calc(#{$sidebar-width} - 1rem - 3rem);
  109. }
  110. .nav-treeview {
  111. .nav-link {
  112. width: calc(#{$sidebar-width} - 1rem - 4rem);
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }
  119. }
  120. }
  121. .nav-flat {
  122. .nav-link {
  123. width: $sidebar-width;
  124. }
  125. &.nav-child-indent {
  126. .nav-treeview {
  127. .nav-link {
  128. width: calc(#{$sidebar-width});
  129. }
  130. .nav-treeview {
  131. .nav-link {
  132. width: calc(#{$sidebar-width} - .2rem);
  133. }
  134. .nav-treeview {
  135. .nav-link {
  136. width: calc(#{$sidebar-width} - .2rem * 2);
  137. }
  138. .nav-treeview {
  139. .nav-link {
  140. width: calc(#{$sidebar-width} - .2rem * 3);
  141. }
  142. .nav-treeview {
  143. .nav-link {
  144. width: calc(#{$sidebar-width} - .2rem * 4);
  145. }
  146. }
  147. }
  148. }
  149. }
  150. }
  151. }
  152. }
  153. .nav-child-indent.nav-compact .nav-treeview {
  154. .nav-link {
  155. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2 - .5rem);
  156. }
  157. .nav-treeview {
  158. .nav-link {
  159. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2 - 1rem);
  160. }
  161. .nav-treeview {
  162. .nav-link {
  163. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2 - 1.5rem);
  164. }
  165. .nav-treeview {
  166. .nav-link {
  167. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2 - 2rem);
  168. }
  169. .nav-treeview {
  170. .nav-link {
  171. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2 - 2.5rem);
  172. }
  173. }
  174. }
  175. }
  176. }
  177. }
  178. .nav-child-indent.nav-legacy.nav-compact {
  179. .nav-link {
  180. width: $sidebar-width;
  181. }
  182. .nav-treeview {
  183. .nav-link {
  184. width: calc(#{$sidebar-width} - .5rem);
  185. }
  186. .nav-treeview {
  187. .nav-link {
  188. width: calc(#{$sidebar-width} - .5rem * 2);
  189. }
  190. .nav-treeview {
  191. .nav-link {
  192. width: calc(#{$sidebar-width} - .5rem * 3);
  193. }
  194. .nav-treeview {
  195. .nav-link {
  196. width: calc(#{$sidebar-width} - .5rem * 4);
  197. }
  198. .nav-treeview {
  199. .nav-link {
  200. width: calc(#{$sidebar-width} - .5rem * 5);
  201. }
  202. }
  203. }
  204. }
  205. }
  206. }
  207. }
  208. .nav-link {
  209. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2);
  210. @include transition(width $transition-fn $transition-speed);
  211. }
  212. }
  213. }
  214. .sidebar-collapse {
  215. &.sidebar-mini,
  216. &.sidebar-mini-md,
  217. &.sidebar-mini-xs {
  218. .main-sidebar {
  219. // Hide the sidebar search results when mini mode is active.
  220. .sidebar-search-results {
  221. display: none;
  222. }
  223. .nav-sidebar {
  224. .nav-link {
  225. width: $sidebar-mini-width - $sidebar-padding-x * 2;
  226. }
  227. &.nav-flat,
  228. &.nav-legacy {
  229. .nav-link {
  230. width: $sidebar-mini-width;
  231. }
  232. }
  233. &.nav-child-indent.nav-compact {
  234. .nav-treeview {
  235. padding-left: 0 !important;
  236. margin-left: 0 !important;
  237. }
  238. .nav-link {
  239. width: calc(#{$sidebar-mini-width} - #{$sidebar-padding-x} * 2);
  240. }
  241. }
  242. }
  243. &.sidebar-focused,
  244. &:hover {
  245. &:not(.hide-nav-header-on-hover) {
  246. .nav-header {
  247. display: inline-block;
  248. }
  249. }
  250. // Show sidebar search when hover/focus on the sidebar mini mode.
  251. &:not(.sidebar-no-expand) {
  252. .nav-link {
  253. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2);
  254. }
  255. .form-control-sidebar {
  256. display: inline-block;
  257. }
  258. .form-control-sidebar ~ .input-group-append {
  259. display: flex;
  260. }
  261. .sidebar-search-open .sidebar-search-results {
  262. display: inline-block;
  263. }
  264. }
  265. .nav-child-indent {
  266. .nav-link {
  267. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2);
  268. }
  269. }
  270. .nav-legacy {
  271. .nav-link {
  272. width: $sidebar-width;
  273. }
  274. &.nav-child-indent {
  275. .nav-treeview {
  276. .nav-link {
  277. width: calc(#{$sidebar-width} - 1rem);
  278. }
  279. .nav-treeview {
  280. .nav-link {
  281. width: calc(#{$sidebar-width} - 1rem - 1rem);
  282. }
  283. .nav-treeview {
  284. .nav-link {
  285. width: calc(#{$sidebar-width} - 1rem - 2rem);
  286. }
  287. .nav-treeview {
  288. .nav-link {
  289. width: calc(#{$sidebar-width} - 1rem - 3rem);
  290. }
  291. .nav-treeview {
  292. .nav-link {
  293. width: calc(#{$sidebar-width} - 1rem - 4rem);
  294. }
  295. }
  296. }
  297. }
  298. }
  299. }
  300. }
  301. }
  302. .nav-flat {
  303. .nav-link {
  304. width: $sidebar-width;
  305. }
  306. &.nav-child-indent {
  307. .nav-treeview {
  308. .nav-link {
  309. width: calc(#{$sidebar-width});
  310. }
  311. .nav-treeview {
  312. .nav-link {
  313. width: calc(#{$sidebar-width} - .2rem);
  314. }
  315. .nav-treeview {
  316. .nav-link {
  317. width: calc(#{$sidebar-width} - .2rem * 2);
  318. }
  319. .nav-treeview {
  320. .nav-link {
  321. width: calc(#{$sidebar-width} - .2rem * 3);
  322. }
  323. .nav-treeview {
  324. .nav-link {
  325. width: calc(#{$sidebar-width} - .2rem * 4);
  326. }
  327. }
  328. }
  329. }
  330. }
  331. }
  332. }
  333. }
  334. .nav-child-indent.nav-compact {
  335. .nav-link {
  336. width: calc(#{$sidebar-width} - #{$sidebar-padding-x} * 2);
  337. }
  338. }
  339. .nav-child-indent.nav-legacy.nav-compact {
  340. .nav-link {
  341. width: $sidebar-width;
  342. }
  343. .nav-treeview {
  344. .nav-link {
  345. width: calc(#{$sidebar-width} - .5rem);
  346. }
  347. .nav-treeview {
  348. .nav-link {
  349. width: calc(#{$sidebar-width} - .5rem * 2);
  350. }
  351. .nav-treeview {
  352. .nav-link {
  353. width: calc(#{$sidebar-width} - .5rem * 3);
  354. }
  355. .nav-treeview {
  356. .nav-link {
  357. width: calc(#{$sidebar-width} - .5rem * 4);
  358. }
  359. .nav-treeview {
  360. .nav-link {
  361. width: calc(#{$sidebar-width} - .5rem * 5);
  362. }
  363. }
  364. }
  365. }
  366. }
  367. }
  368. }
  369. }
  370. }
  371. .sidebar-no-expand.main-sidebar.sidebar-focused,
  372. .sidebar-no-expand.main-sidebar:hover {
  373. width: $sidebar-mini-width;
  374. .nav-header {
  375. display: none;
  376. }
  377. .brand-link {
  378. width: $sidebar-mini-width !important;
  379. }
  380. .user-panel .image {
  381. float: none !important;
  382. }
  383. .logo-xs {
  384. animation-name: fade-in;
  385. animation-duration: $transition-speed;
  386. animation-fill-mode: both;
  387. visibility: visible;
  388. }
  389. .logo-xl {
  390. animation-name: fade-out;
  391. animation-duration: $transition-speed;
  392. animation-fill-mode: both;
  393. visibility: hidden;
  394. }
  395. .nav-sidebar.nav-child-indent .nav-treeview {
  396. padding-left: 0;
  397. }
  398. .sidebar {
  399. .brand-text,
  400. .user-panel > .info,
  401. .nav-sidebar .nav-link p {
  402. margin-left: -10px;
  403. animation-name: fade-out;
  404. animation-duration: $transition-speed;
  405. animation-fill-mode: both;
  406. visibility: hidden;
  407. display: inline-block;
  408. width: 0;
  409. }
  410. .nav-sidebar > .nav-item .nav-icon {
  411. margin-right: 0;
  412. }
  413. }
  414. }
  415. }
  416. }
  417. .nav-sidebar {
  418. position: relative;
  419. &:hover {
  420. overflow: visible;
  421. }
  422. }
  423. .sidebar-form,
  424. .nav-sidebar > .nav-header {
  425. overflow: hidden;
  426. text-overflow: clip;
  427. }
  428. .nav-sidebar .nav-item > .nav-link {
  429. position: relative;
  430. > .float-right {
  431. margin-top: -7px;
  432. position: absolute;
  433. right: 10px;
  434. top: 50%;
  435. }
  436. }
  437. .sidebar .nav-link p,
  438. .main-sidebar .brand-text,
  439. .main-sidebar .logo-xs,
  440. .main-sidebar .logo-xl,
  441. .sidebar .user-panel .info {
  442. @include transition(margin-left $transition-speed linear, opacity $transition-speed ease, visibility $transition-speed ease);
  443. }