sidebar-mini.less 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. //Make the image fit
  30. img {
  31. max-width: 100%;
  32. height: auto;
  33. }
  34. }
  35. }
  36. .sidebar-menu {
  37. //Make the sidebar links, menus, labels, badeges
  38. //and angle icons disappear
  39. > li {
  40. position: relative;
  41. > a {
  42. margin-right: 0;
  43. }
  44. > a > span,
  45. > .treeview-menu,
  46. > a > .pull-right,
  47. &.header {
  48. display: none!important;
  49. }
  50. > a > span {
  51. border-top-right-radius: 4px;
  52. }
  53. &:not(.treeview) {
  54. > a > span {
  55. border-bottom-right-radius: 4px;
  56. }
  57. }
  58. > .treeview-menu {
  59. //Add some padding to the treeview menu
  60. padding-top: 5px;
  61. padding-bottom: 5px;
  62. border-bottom-right-radius: 4px;
  63. }
  64. //Show menu items on hover
  65. &:hover {
  66. > a > span:not(.pull-right),
  67. > .treeview-menu {
  68. display: block!important;
  69. position: absolute;
  70. width: @sidebar-width - 50;
  71. left: 50px;
  72. }
  73. //position the header & treeview menus
  74. > a > span {
  75. top: 0;
  76. padding: 12px 5px 12px 20px;
  77. background-color: inherit;
  78. }
  79. > .treeview-menu {
  80. top: 44px;
  81. margin-left: 0;
  82. }
  83. }
  84. }
  85. }
  86. //One more thing to remove because it doesn't fit :-z
  87. .sidebar-form {
  88. display: none;
  89. }
  90. .main-header {
  91. //Lets make the logo also shrink and the mini logo to appear
  92. .logo {
  93. width: 50px;
  94. > .logo-mini {
  95. display: block;
  96. margin-left: -15px;
  97. margin-right: -15px;
  98. font-size: 18px;
  99. }
  100. > .logo-lg {
  101. display: none;
  102. }
  103. }
  104. //Of course, since the logo got smaller, we need to fix the
  105. //navbar's position
  106. .navbar {
  107. margin-left: 50px;
  108. }
  109. }
  110. }
  111. }
  112. }