sidebar-mini.less 3.6 KB

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