AdminLTE/build/scss/_sidebar-mini.scss

153 lines
3.5 KiB
SCSS
Raw Normal View History

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