sidebar-mini.less 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. @media (min-width: @screen-sm) {
  80. // Show menu items on hover
  81. .sidebar-mini:not(.sidebar-mini-expand-feature).sidebar-collapse {
  82. .sidebar-menu > li:hover {
  83. > a {
  84. //overflow: visible;
  85. }
  86. > a > span:not(.pull-right), //:not(.pull-right-container),
  87. > .treeview-menu {
  88. display: block !important;
  89. position: absolute;
  90. width: @sidebar-width - 50;
  91. left: 50px;
  92. }
  93. //position the header & treeview menus
  94. > a > span {
  95. top: 0;
  96. margin-left: -3px;
  97. padding: 12px 5px 12px 20px;
  98. background-color: inherit;
  99. }
  100. > a > .pull-right-container {
  101. //display: block!important;
  102. position: relative !important;
  103. float: right;
  104. width: auto !important;
  105. left: 200px - 20px !important;
  106. top: -22px !important;
  107. z-index: 900;
  108. > .label:not(:first-of-type) {
  109. display: none;
  110. }
  111. }
  112. > .treeview-menu {
  113. top: 44px;
  114. margin-left: 0;
  115. }
  116. }
  117. }
  118. }
  119. .sidebar-expanded-on-hover {
  120. .main-footer,
  121. .content-wrapper {
  122. margin-left: 50px;
  123. }
  124. .main-sidebar {
  125. box-shadow: @sidebar-expanded-shadow;
  126. }
  127. }
  128. //A fix for text overflow while transitioning from sidebar mini to full sidebar
  129. .sidebar-menu,
  130. .main-sidebar .user-panel,
  131. .sidebar-menu > li.header {
  132. white-space: nowrap;
  133. overflow: hidden;
  134. }
  135. .sidebar-menu:hover {
  136. overflow: visible;
  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. }