_sidebar-mini.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 large devices
  7. @include media-breakpoint-up(md) {
  8. // When the sidebar is collapsed...
  9. &.sidebar-collapse {
  10. // Apply the new margining to the main content and footer
  11. .content-wrapper,
  12. .main-footer {
  13. margin-left: $sidebar-mini-width !important;
  14. }
  15. // Modify the sidebar to shrink instead of disappearing
  16. .main-sidebar {
  17. // Don't go away! Just shrink
  18. @include translate(0, 0);
  19. width: $sidebar-mini-width !important;
  20. }
  21. .nav-sidebar {
  22. > .nav-item {
  23. position: relative;
  24. > .nav-link {
  25. margin-right: 0;
  26. > .nav-icon {
  27. width: 100%;
  28. text-align: center;
  29. }
  30. }
  31. > .nav-treeview {
  32. // Add some padding to the treeview menu
  33. padding-top: 5px;
  34. padding-bottom: 5px;
  35. }
  36. // Show menu items on hover
  37. &:hover {
  38. > .nav-link {
  39. overflow: visible;
  40. }
  41. > .nav-link > .text,
  42. > .nav-treeview {
  43. display: block !important;
  44. position: absolute;
  45. width: $sidebar-width - $sidebar-mini-width;
  46. left: $sidebar-mini-width;
  47. }
  48. // position the header & treeview menus
  49. > .nav-link > span {
  50. top: 0;
  51. margin-left: -3px;
  52. padding: $nav-link-padding;
  53. background-color: inherit;
  54. }
  55. > .nav-treeview {
  56. top: $nav-link-padding;
  57. margin-left: 0;
  58. }
  59. }
  60. }
  61. }
  62. // Make the sidebar links, menus, labels, badges
  63. // and angle icons disappear
  64. .main-sidebar .user-panel > .info,
  65. .sidebar-form,
  66. .nav-sidebar > .nav-item > .nav-link > span,
  67. .nav-sidebar > .nav-item > .nav-treeview,
  68. .nav-sidebar > .nav-item > .nav-link > .pull-right,
  69. .nav-sidebar .nav-header {
  70. display: none !important;
  71. -webkit-transform: translateZ(0);
  72. }
  73. }
  74. }
  75. }
  76. // A fix for text overflow while transitioning from sidebar mini to full sidebar
  77. .nav-sidebar,
  78. .main-sidebar .user-panel,
  79. .nav-sidebar > .nav-header {
  80. white-space: nowrap;
  81. overflow: hidden;
  82. }
  83. .nav-sidebar {
  84. position: relative;
  85. &:hover {
  86. overflow: visible;
  87. }
  88. }
  89. .sidebar-form,
  90. .nav-sidebar > .nav-header {
  91. overflow: hidden;
  92. text-overflow: clip;
  93. }
  94. .nav-sidebar .nav-item > .nav-link {
  95. position: relative;
  96. > .pull-right {
  97. position: absolute;
  98. right: 10px;
  99. top: 50%;
  100. margin-top: -7px;
  101. }
  102. }