_sidebar-mini.scss 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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: map-get($grid-breakpoints, 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. @include 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),
  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. > .treeview-menu {
  64. top: 44px;
  65. margin-left: 0;
  66. }
  67. }
  68. }
  69. }
  70. //Make the sidebar links, menus, labels, badges
  71. //and angle icons disappear
  72. .main-sidebar .user-panel > .info,
  73. .sidebar-form,
  74. .sidebar-menu > li > a > span,
  75. .sidebar-menu > li > .treeview-menu,
  76. .sidebar-menu > li > a > .pull-right,
  77. .sidebar-menu li.header {
  78. display: none !important;
  79. -webkit-transform: translateZ(0);
  80. }
  81. .main-header {
  82. //Let's make the logo also shrink and the mini logo to appear
  83. .logo {
  84. width: 50px;
  85. > .logo-mini {
  86. display: block;
  87. margin-left: -15px;
  88. margin-right: -15px;
  89. font-size: 18px;
  90. }
  91. > .logo-lg {
  92. display: none;
  93. }
  94. }
  95. //Since the logo got smaller, we need to fix the navbar's position
  96. .navbar {
  97. margin-left: 50px;
  98. }
  99. }
  100. }
  101. }
  102. }
  103. //A fix for text overflow while transitioning from sidebar mini to full sidebar
  104. .sidebar-menu,
  105. .main-sidebar .user-panel,
  106. .sidebar-menu > li.header {
  107. white-space: nowrap;
  108. overflow: hidden;
  109. }
  110. .sidebar-menu:hover {
  111. overflow: visible;
  112. }
  113. .sidebar-form,
  114. .sidebar-menu > li.header {
  115. overflow: hidden;
  116. text-overflow: clip;
  117. }
  118. .sidebar-menu li > a {
  119. position: relative;
  120. > .pull-right {
  121. position: absolute;
  122. right: 10px;
  123. top: 50%;
  124. margin-top: -7px;
  125. }
  126. }