sidebar-mini.less 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*
  2. * Component: Sidebar Mini
  3. */
  4. //Add sidebar-mini class to the body tag to activate this feature
  5. .sidebar-mini {
  6. //Sidebar mini should work only on devices larger than @screen-sm
  7. @media (min-width: @screen-sm) {
  8. //When the sidebar is collapsed...
  9. &.sidebar-collapse {
  10. .sidebar-menu:hover {
  11. overflow: visible;
  12. }
  13. //Apply the new margining to the main content and footer
  14. .content-wrapper,
  15. .right-side,
  16. .main-footer {
  17. margin-left: 50px !important;
  18. z-index: 840;
  19. }
  20. //Modify the sidebar to shrink instead of disappearing
  21. .main-sidebar {
  22. //Don't go away! Just shrink
  23. .translate(0, 0);
  24. width: 50px !important;
  25. z-index: 850;
  26. }
  27. .sidebar-menu {
  28. > li {
  29. position: relative;
  30. > a {
  31. margin-right: 0;
  32. }
  33. > a > span {
  34. //border-top-right-radius: 4px;
  35. }
  36. &:not(.treeview) {
  37. > a > span {
  38. //border-bottom-right-radius: 4px;
  39. }
  40. }
  41. > .treeview-menu {
  42. //Add some padding to the treeview menu
  43. padding-top: 5px;
  44. padding-bottom: 5px;
  45. //border-bottom-right-radius: 4px;
  46. scrollbar-width: thin;
  47. scrollbar-color: rgba(255,255,255,.15) transparent;
  48. /* Works on Chrome, Edge, and Safari */
  49. &::-webkit-scrollbar {
  50. width: 8px;
  51. }
  52. &::-webkit-scrollbar-track {
  53. background: transparent;
  54. }
  55. &::-webkit-scrollbar-thumb {
  56. background-color: rgba(255,255,255,.15);
  57. border-radius: 20px;
  58. border: 3px solid transparent;
  59. }
  60. }
  61. //Show menu items on hover
  62. &:hover {
  63. > a {
  64. //overflow: visible;
  65. width: @sidebar-width;
  66. }
  67. > a > span:not(.pull-right),//:not(.pull-right-container),
  68. > .treeview-menu {
  69. display: block !important;
  70. position: absolute;
  71. width: @sidebar-width - 50;
  72. left: 50px;
  73. }
  74. //position the header & treeview menus
  75. > a > span {
  76. top: 0;
  77. //margin-left: -3px;
  78. padding: 12px 5px 12px 20px;
  79. background-color: inherit;
  80. }
  81. > a > .pull-right-container {
  82. display: block!important;
  83. float: right;
  84. width: auto!important;
  85. left: 195px!important;
  86. top: 10px!important;
  87. > .label:not(:first-of-type) {
  88. display: none;
  89. }
  90. }
  91. > .treeview-menu {
  92. top: 46px;
  93. margin-left: 0;
  94. }
  95. }
  96. }
  97. }
  98. //Make the sidebar links, menus, labels, badges
  99. //and angle icons disappear
  100. .main-sidebar .user-panel > .info,
  101. .sidebar-form,
  102. .sidebar-menu > li > a > span,
  103. .sidebar-menu > li > .treeview-menu,
  104. .sidebar-menu > li > a > .pull-right,
  105. .sidebar-menu li.header {
  106. display: none !important;
  107. -webkit-transform: translateZ(0);
  108. }
  109. .main-header {
  110. //Let's make the logo also shrink and the mini logo to appear
  111. .logo {
  112. width: 50px;
  113. > .logo-mini {
  114. display: block;
  115. margin-left: -15px;
  116. margin-right: -15px;
  117. font-size: 18px;
  118. }
  119. > .logo-lg {
  120. display: none;
  121. }
  122. }
  123. //Since the logo got smaller, we need to fix the navbar's position
  124. .navbar {
  125. margin-left: 50px;
  126. }
  127. }
  128. }
  129. }
  130. }
  131. //A fix for text overflow while transitioning from sidebar mini to full sidebar
  132. .sidebar-menu,
  133. .main-sidebar .user-panel,
  134. .sidebar-menu > li.header {
  135. white-space: nowrap;
  136. overflow: hidden;
  137. }
  138. .sidebar-form,
  139. .sidebar-menu > li.header {
  140. overflow: hidden;
  141. text-overflow: clip;
  142. }
  143. .sidebar-menu li > a {
  144. position: relative;
  145. > .pull-right-container {
  146. position: absolute;
  147. right: 10px;
  148. top: 50%;
  149. margin-top: -7px;
  150. }
  151. }