sidebar-mini.less 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 > a > span > .pull-right,
  54. .sidebar-menu li.header {
  55. display: none !important;
  56. -webkit-transform: translateZ(0);
  57. }
  58. .main-header {
  59. //Let's make the logo also shrink and the mini logo to appear
  60. .logo {
  61. width: 50px;
  62. > .logo-mini {
  63. display: block;
  64. margin-left: -15px;
  65. margin-right: -15px;
  66. font-size: 18px;
  67. }
  68. > .logo-lg {
  69. display: none;
  70. }
  71. }
  72. //Since the logo got smaller, we need to fix the navbar's position
  73. .navbar {
  74. margin-left: 50px;
  75. }
  76. }
  77. }
  78. }
  79. }
  80. @media (min-width: @screen-sm) {
  81. // Show menu items on hover
  82. .sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse {
  83. .sidebar-menu > li:hover {
  84. > a {
  85. //overflow: visible;
  86. }
  87. > a > span:not(.pull-right), //:not(.pull-right-container),
  88. > .treeview-menu {
  89. display: block !important;
  90. position: absolute;
  91. width: @sidebar-width - 50;
  92. left: 50px;
  93. }
  94. //position the header & treeview menus
  95. > a > span {
  96. top: 0;
  97. margin-left: -3px;
  98. padding: 12px 5px 12px 20px;
  99. background-color: inherit;
  100. }
  101. > a > .pull-right-container {
  102. //display: block!important;
  103. position: relative !important;
  104. float: right;
  105. width: auto !important;
  106. left: 200px - 20px !important;
  107. top: -22px !important;
  108. z-index: 900;
  109. > .label:not(:first-of-type) {
  110. display: none;
  111. }
  112. }
  113. > .treeview-menu {
  114. top: 44px;
  115. margin-left: 0;
  116. }
  117. }
  118. }
  119. }
  120. .sidebar-expanded-on-hover {
  121. .main-footer,
  122. .content-wrapper {
  123. margin-left: 50px;
  124. }
  125. .main-sidebar {
  126. box-shadow: @sidebar-expanded-shadow;
  127. }
  128. }
  129. //A fix for text overflow while transitioning from sidebar mini to full sidebar
  130. .sidebar-menu,
  131. .main-sidebar .user-panel,
  132. .sidebar-menu > li.header {
  133. white-space: nowrap;
  134. overflow: hidden;
  135. }
  136. .sidebar-menu:hover {
  137. overflow: visible;
  138. }
  139. .sidebar-form,
  140. .sidebar-menu > li.header {
  141. overflow: hidden;
  142. text-overflow: clip;
  143. }
  144. .sidebar-menu li > a {
  145. position: relative;
  146. > .pull-right-container {
  147. position: absolute;
  148. right: 10px;
  149. top: 50%;
  150. margin-top: -7px;
  151. }
  152. }