sidebar-mini.less 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. //Show menu items on hover
  45. &:hover {
  46. > a {
  47. //overflow: visible;
  48. }
  49. > a > span:not(.pull-right),//:not(.pull-right-container),
  50. > .treeview-menu {
  51. display: block !important;
  52. position: absolute;
  53. width: @sidebar-width - 50;
  54. left: 50px;
  55. }
  56. //position the header & treeview menus
  57. > a > span {
  58. top: 0;
  59. margin-left: -3px;
  60. padding: 12px 5px 12px 20px;
  61. background-color: inherit;
  62. }
  63. > a > .pull-right-container {
  64. //display: block!important;
  65. float: right;
  66. width: auto!important;
  67. left: 200px!important;
  68. top: 10px!important;
  69. > .label:not(:first-of-type) {
  70. display: none;
  71. }
  72. }
  73. > .treeview-menu {
  74. top: 44px;
  75. margin-left: 0;
  76. }
  77. }
  78. }
  79. }
  80. //Make the sidebar links, menus, labels, badges
  81. //and angle icons disappear
  82. .main-sidebar .user-panel > .info,
  83. .sidebar-form,
  84. .sidebar-menu > li > a > span,
  85. .sidebar-menu > li > .treeview-menu,
  86. .sidebar-menu > li > a > .pull-right,
  87. .sidebar-menu li.header {
  88. display: none !important;
  89. -webkit-transform: translateZ(0);
  90. }
  91. .main-header {
  92. //Let's make the logo also shrink and the mini logo to appear
  93. .logo {
  94. width: 50px;
  95. > .logo-mini {
  96. display: block;
  97. margin-left: -15px;
  98. margin-right: -15px;
  99. font-size: 18px;
  100. }
  101. > .logo-lg {
  102. display: none;
  103. }
  104. }
  105. //Since the logo got smaller, we need to fix the navbar's position
  106. .navbar {
  107. margin-left: 50px;
  108. }
  109. }
  110. }
  111. }
  112. }
  113. //A fix for text overflow while transitioning from sidebar mini to full sidebar
  114. .sidebar-menu,
  115. .main-sidebar .user-panel,
  116. .sidebar-menu > li.header {
  117. white-space: nowrap;
  118. overflow: hidden;
  119. }
  120. .sidebar-menu:hover {
  121. overflow: visible;
  122. }
  123. .sidebar-form,
  124. .sidebar-menu > li.header {
  125. overflow: hidden;
  126. text-overflow: clip;
  127. }
  128. .sidebar-menu li > a {
  129. position: relative;
  130. > .pull-right-container {
  131. position: absolute;
  132. right: 10px;
  133. top: 50%;
  134. margin-top: -7px;
  135. }
  136. }