_sidebar-mini.scss 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. /*
  2. * Component: Sidebar Mini
  3. * -----------------------
  4. */
  5. // Mixin
  6. @mixin sidebar-mini-breakpoint() {
  7. // A fix for text overflow while transitioning from sidebar mini to full sidebar
  8. .nav-sidebar,
  9. .nav-sidebar > .nav-header,
  10. .nav-sidebar .nav-link {
  11. white-space: nowrap;
  12. overflow: hidden;
  13. }
  14. // When the sidebar is collapsed...
  15. &.sidebar-collapse {
  16. .d-hidden-mini {
  17. display: none;
  18. }
  19. // Apply the new margins to the main content and footer
  20. .content-wrapper,
  21. .main-footer,
  22. .main-header {
  23. margin-left: $sidebar-mini-width !important;
  24. }
  25. // Make the sidebar headers
  26. .nav-sidebar .nav-header {
  27. display: none;
  28. }
  29. .nav-sidebar .nav-link p {
  30. width: 0;
  31. }
  32. .sidebar .user-panel > .info,
  33. .nav-sidebar .nav-link p,
  34. .brand-text {
  35. margin-left: -10px;
  36. opacity: 0;
  37. visibility: hidden;
  38. }
  39. .logo-xl {
  40. opacity: 0;
  41. visibility: hidden;
  42. }
  43. .logo-xs {
  44. display: inline-block;
  45. opacity: 1;
  46. visibility: visible;
  47. }
  48. // Modify the sidebar to shrink instead of disappearing
  49. .main-sidebar {
  50. overflow-x: hidden;
  51. &,
  52. &::before {
  53. // Don't go away! Just shrink
  54. margin-left: 0;
  55. width: $sidebar-mini-width;
  56. }
  57. .user-panel {
  58. .image {
  59. float: none;
  60. }
  61. }
  62. &:hover,
  63. &.sidebar-focused {
  64. width: $sidebar-width;
  65. .user-panel {
  66. text-align: left;
  67. .image {
  68. float: left;
  69. }
  70. }
  71. .user-panel > .info,
  72. .nav-sidebar .nav-link p,
  73. .brand-text,
  74. .logo-xl {
  75. display: inline-block;
  76. margin-left: 0;
  77. opacity: 1;
  78. visibility: visible;
  79. }
  80. .logo-xs {
  81. opacity: 0;
  82. visibility: hidden;
  83. }
  84. .brand-image {
  85. margin-right: .5rem;
  86. }
  87. // Make the sidebar links, menus, labels, badges
  88. // and angle icons disappear
  89. .sidebar-form,
  90. .user-panel > .info {
  91. display: block !important;
  92. -webkit-transform: translateZ(0);
  93. }
  94. .nav-sidebar > .nav-item > .nav-link > span {
  95. display: inline-block !important;
  96. }
  97. }
  98. }
  99. // Make an element visible only when sidebar mini is active
  100. .visible-sidebar-mini {
  101. display: block !important;
  102. }
  103. }
  104. }
  105. // Logo style
  106. .logo-xs,
  107. .logo-xl {
  108. margin: 0;
  109. opacity: 1;
  110. position: absolute;
  111. visibility: visible;
  112. &.brand-image-xs {
  113. left: 18px;
  114. top: 12px;
  115. }
  116. &.brand-image-xl {
  117. left: 12px;
  118. top: 6px;
  119. }
  120. }
  121. .logo-xs {
  122. opacity: 0;
  123. visibility: hidden;
  124. &.brand-image-xl {
  125. left: 16px;
  126. top: 8px;
  127. }
  128. }
  129. .brand-link {
  130. &.logo-switch {
  131. &::before {
  132. content: '\00a0';
  133. }
  134. }
  135. }
  136. // Add sidebar-mini class to the body tag to activate this feature
  137. .sidebar-mini {
  138. @include media-breakpoint-up(lg) {
  139. @include sidebar-mini-breakpoint;
  140. }
  141. }
  142. .sidebar-mini-md {
  143. @include media-breakpoint-up(md) {
  144. @include sidebar-mini-breakpoint;
  145. }
  146. }
  147. .nav-sidebar {
  148. position: relative;
  149. &:hover {
  150. overflow: visible;
  151. }
  152. }
  153. .sidebar-form,
  154. .nav-sidebar > .nav-header {
  155. overflow: hidden;
  156. text-overflow: clip;
  157. }
  158. .nav-sidebar .nav-item > .nav-link {
  159. position: relative;
  160. > .float-right {
  161. margin-top: -7px;
  162. position: absolute;
  163. right: 10px;
  164. top: 50%;
  165. }
  166. }
  167. .sidebar .nav-link p,
  168. .main-sidebar .brand-text,
  169. .main-sidebar .logo-xs,
  170. .main-sidebar .logo-xl,
  171. .sidebar .user-panel .info {
  172. @include transition(margin-left $transition-speed linear, opacity $transition-speed ease, visibility $transition-speed ease)
  173. }