sidebar-mini.less 3.2 KB
Newer Older
A
Abdullah Almsaeed 已提交
1 2 3 4 5 6 7 8
/*
 * Component: Sidebar Mini
 */

//Add sidebar-mini class to the body tag to activate this feature
.sidebar-mini {
  //Sidebar mini should work only on devices larger than @screen-sm
  @media (min-width: @screen-sm) {
A
Abdullah Almsaeed 已提交
9
    //When the sidebar is collapsed...
A
Abdullah Almsaeed 已提交
10 11 12 13 14 15 16 17 18 19
    &.sidebar-collapse {

      //Apply the new margining to the main content and footer
      .content-wrapper,
      .right-side,
      .main-footer {
        margin-left: 50px!important;
        z-index: 840;
      }

D
Dmitri Suvorov 已提交
20
      //Modify the sidebar to shrink instead of disappearing
A
Abdullah Almsaeed 已提交
21 22 23 24 25
      .main-sidebar {
        //Don't go away! Just shrink
        .translate(0, 0);
        width: 50px!important;
        z-index: 850;
26
      }
A
Abdullah Almsaeed 已提交
27

A
Abdullah Almsaeed 已提交
28 29 30 31 32 33 34 35 36
      .sidebar-menu {
        > li {
          position: relative;
          > a {
            margin-right: 0;
          }
          > a > span {
            border-top-right-radius: 4px;
          }
A
Abdullah Almsaeed 已提交
37

A
Abdullah Almsaeed 已提交
38 39 40 41 42
          &:not(.treeview) {
            > a > span {
              border-bottom-right-radius: 4px;
            }
          }
A
Abdullah Almsaeed 已提交
43

A
Abdullah Almsaeed 已提交
44 45 46 47 48 49 50 51 52
          > .treeview-menu {
            //Add some padding to the treeview menu
            padding-top: 5px;
            padding-bottom: 5px;
            border-bottom-right-radius: 4px;
          }

          //Show menu items on hover
          &:hover {
53 54 55
            > a {
              overflow: visible;
            }
A
Abdullah Almsaeed 已提交
56
            > a > span:not(.pull-right),
57
            > .treeview-menu {
A
Abdullah Almsaeed 已提交
58 59 60 61 62
              display: block!important;
              position: absolute;
              width: @sidebar-width - 50;
              left: 50px;
            }
A
Abdullah Almsaeed 已提交
63

A
Abdullah Almsaeed 已提交
64 65 66
            //position the header & treeview menus
            > a > span {
              top: 0;
A
Abdullah Almsaeed 已提交
67
              margin-left: -3px;
A
Abdullah Almsaeed 已提交
68 69 70 71 72 73 74 75 76 77 78
              padding: 12px 5px 12px 20px;
              background-color: inherit;
            }
            > .treeview-menu {
              top: 44px;
              margin-left: 0;
            }
          }
        }
      }

D
Dmitri Suvorov 已提交
79
      //Make the sidebar links, menus, labels, badges
A
Abdullah Almsaeed 已提交
80 81 82 83 84 85 86 87
      //and angle icons disappear
      .main-sidebar .user-panel > .info,
      .sidebar-form,
      .sidebar-menu > li > a > span,
      .sidebar-menu > li > .treeview-menu,
      .sidebar-menu >li > a > .pull-right,
      .sidebar-menu li.header {
        display: none!important;
A
Abdullah Almsaeed 已提交
88
      }
A
Abdullah Almsaeed 已提交
89 90

      .main-header {
D
Dmitri Suvorov 已提交
91
        //Let's make the logo also shrink and the mini logo to appear
A
Abdullah Almsaeed 已提交
92 93 94 95 96 97 98 99 100 101 102 103 104
        .logo {
          width: 50px;
          > .logo-mini {
            display: block;
            margin-left: -15px;
            margin-right: -15px;
            font-size: 18px;
          }
          > .logo-lg {
            display: none;
          }
        }

A
Abdullah Almsaeed 已提交
105
        //Since the logo got smaller, we need to fix the navbar's position
A
Abdullah Almsaeed 已提交
106 107 108 109
        .navbar {
          margin-left: 50px;
        }
      }
A
Abdullah Almsaeed 已提交
110 111
    }
  }
A
Abdullah Almsaeed 已提交
112 113 114
}

//A fix for text overflow while transitioning from sidebar mini to full sidebar
115
.sidebar-menu li > a,
A
Abdullah Almsaeed 已提交
116
.main-sidebar .user-panel,
117
.sidebar-menu > li.header {
A
Abdullah Almsaeed 已提交
118
  white-space: nowrap!important;
119
  overflow: hidden;
A
Abdullah Almsaeed 已提交
120
}
121
.sidebar-form,
A
Abdullah Almsaeed 已提交
122 123 124 125 126 127 128 129 130 131 132 133
.sidebar-menu > li.header {
  overflow: hidden;
  text-overflow: clip;
}
.sidebar-menu li > a {
  position: relative;
  > .pull-right {
    position: absolute;
    top: 50%;
    right: 10px;
    margin-top: -7px;
  }
A
Abdullah Almsaeed 已提交
134
}