AdminLTE/build/scss/_sidebar-mini.scss

113 lines
2.7 KiB
SCSS
Raw Normal View History

2015-10-31 22:00:16 +01:00
/*
* Component: Sidebar Mini
*/
2016-01-16 17:27:23 +01:00
// Add sidebar-mini class to the body tag to activate this feature
2015-10-31 22:00:16 +01:00
.sidebar-mini {
2016-01-16 17:27:23 +01:00
// Sidebar mini should work only on large devices
@include media-breakpoint-up(md) {
// When the sidebar is collapsed...
2015-10-31 22:00:16 +01:00
&.sidebar-collapse {
2016-01-16 17:27:23 +01:00
// Apply the new margining to the main content and footer
2015-10-31 22:00:16 +01:00
.content-wrapper,
.main-footer {
2016-01-16 17:27:23 +01:00
margin-left: $sidebar-mini-width !important;
2015-10-31 22:00:16 +01:00
}
2016-01-16 17:27:23 +01:00
// Modify the sidebar to shrink instead of disappearing
2015-10-31 22:00:16 +01:00
.main-sidebar {
2016-01-16 17:27:23 +01:00
// Don't go away! Just shrink
2015-10-31 22:00:16 +01:00
@include translate(0, 0);
2016-01-16 17:27:23 +01:00
width: $sidebar-mini-width !important;
2015-10-31 22:00:16 +01:00
}
2016-01-16 17:27:23 +01:00
.nav-sidebar {
> .nav-item {
2015-10-31 22:00:16 +01:00
position: relative;
2016-01-16 17:27:23 +01:00
> .nav-link {
2015-10-31 22:00:16 +01:00
margin-right: 0;
2016-01-16 17:27:23 +01:00
> .nav-icon {
width: 100%;
text-align: center;
2015-10-31 22:00:16 +01:00
}
}
2016-01-16 17:27:23 +01:00
> .nav-treeview {
// Add some padding to the treeview menu
2015-10-31 22:00:16 +01:00
padding-top: 5px;
padding-bottom: 5px;
}
2016-01-16 17:27:23 +01:00
// Show menu items on hover
2015-10-31 22:00:16 +01:00
&:hover {
2016-01-16 17:27:23 +01:00
> .nav-link {
overflow: visible;
2015-10-31 22:00:16 +01:00
}
2016-01-16 17:27:23 +01:00
> .nav-link > .text,
> .nav-treeview {
2015-10-31 22:00:16 +01:00
display: block !important;
position: absolute;
2016-01-16 17:27:23 +01:00
width: $sidebar-width - $sidebar-mini-width;
left: $sidebar-mini-width;
2015-10-31 22:00:16 +01:00
}
2016-01-16 17:27:23 +01:00
// position the header & treeview menus
> .nav-link > span {
2015-10-31 22:00:16 +01:00
top: 0;
margin-left: -3px;
2016-01-16 17:27:23 +01:00
padding: $nav-link-padding;
2015-10-31 22:00:16 +01:00
background-color: inherit;
}
2016-01-16 17:27:23 +01:00
> .nav-treeview {
top: $nav-link-padding;
2015-10-31 22:00:16 +01:00
margin-left: 0;
}
}
}
}
2016-01-16 17:27:23 +01:00
// Make the sidebar links, menus, labels, badges
// and angle icons disappear
2015-10-31 22:00:16 +01:00
.main-sidebar .user-panel > .info,
.sidebar-form,
2016-01-16 17:27:23 +01:00
.nav-sidebar > .nav-item > .nav-link > span,
.nav-sidebar > .nav-item > .nav-treeview,
.nav-sidebar > .nav-item > .nav-link > .pull-right,
.nav-sidebar .nav-header {
2015-10-31 22:00:16 +01:00
display: none !important;
-webkit-transform: translateZ(0);
}
}
}
}
2016-01-16 17:27:23 +01:00
// A fix for text overflow while transitioning from sidebar mini to full sidebar
.nav-sidebar,
2015-10-31 22:00:16 +01:00
.main-sidebar .user-panel,
2016-01-16 17:27:23 +01:00
.nav-sidebar > .nav-header {
2015-10-31 22:00:16 +01:00
white-space: nowrap;
overflow: hidden;
}
2016-01-16 17:27:23 +01:00
.nav-sidebar {
position: relative;
&:hover {
overflow: visible;
}
2015-10-31 22:00:16 +01:00
}
.sidebar-form,
2016-01-16 17:27:23 +01:00
.nav-sidebar > .nav-header {
2015-10-31 22:00:16 +01:00
overflow: hidden;
text-overflow: clip;
}
2016-01-16 17:27:23 +01:00
.nav-sidebar .nav-item > .nav-link {
2015-10-31 22:00:16 +01:00
position: relative;
> .pull-right {
position: absolute;
right: 10px;
top: 50%;
margin-top: -7px;
}
}