sidebar-mini.less 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * Component: Sidebar Mini
  3. */
  4. //Add sidebar-mini class to the body tag to activate this feature
  5. .sidebar-mini {
  6. min-height: 100%;
  7. //Sidebar mini should work only on devices larger than @screen-sm
  8. @media (min-width: @screen-sm) {
  9. //When the sidebar is collapsed...
  10. &.sidebar-collapse {
  11. //Apply the new margining to the main content and footer
  12. .content-wrapper,
  13. .right-side,
  14. .main-footer {
  15. margin-left: 50px!important;
  16. z-index: 840;
  17. }
  18. //Modify the sidbar to shrink instead of disappearing
  19. .main-sidebar {
  20. //Don't go away! Just shrink
  21. .translate(0, 0);
  22. width: 50px!important;
  23. z-index: 850;
  24. //Keep only the image of the user in the user panel
  25. .user-panel {
  26. > .info {
  27. display: none;
  28. }
  29. }
  30. }
  31. .sidebar-menu {
  32. //Make the sidebar links, menus, labels, badeges
  33. //and angle icons disappear
  34. > li {
  35. position: relative;
  36. > a {
  37. margin-right: 0;
  38. }
  39. > a > span,
  40. > .treeview-menu,
  41. > a > .pull-right,
  42. &.header {
  43. display: none!important;
  44. }
  45. > a > span {
  46. border-top-right-radius: 4px;
  47. }
  48. &:not(.treeview) {
  49. > a > span {
  50. border-bottom-right-radius: 4px;
  51. }
  52. }
  53. > .treeview-menu {
  54. //Add some padding to the treeview menu
  55. padding-top: 5px;
  56. padding-bottom: 5px;
  57. border-bottom-right-radius: 4px;
  58. }
  59. //Show menu items on hover
  60. &:hover {
  61. > a > span:not(.pull-right),
  62. > .treeview-menu {
  63. display: block!important;
  64. position: absolute;
  65. width: @sidebar-width - 50;
  66. left: 50px;
  67. }
  68. //position the header & treeview menus
  69. > a > span {
  70. top: 0;
  71. padding: 12px 5px 12px 20px;
  72. background-color: inherit;
  73. }
  74. > .treeview-menu {
  75. top: 44px;
  76. margin-left: 0;
  77. }
  78. }
  79. }
  80. }
  81. //One more thing to remove because it doesn't fit :-z
  82. .sidebar-form {
  83. display: none;
  84. }
  85. .main-header {
  86. //Lets make the logo also shrink and the mini logo to appear
  87. .logo {
  88. width: 50px;
  89. > .logo-mini {
  90. display: block;
  91. margin-left: -15px;
  92. margin-right: -15px;
  93. font-size: 18px;
  94. }
  95. > .logo-lg {
  96. display: none;
  97. }
  98. }
  99. //Of course, since the logo got smaller, we need to fix the
  100. //navbar's position
  101. .navbar {
  102. margin-left: 50px;
  103. }
  104. }
  105. }
  106. }
  107. }