discourse/app/assets/stylesheets/common/base/sidebar.scss

67 lines
1.7 KiB
SCSS

:root {
--d-sidebar-width: #{$d-sidebar-width};
--d-sidebar-animation-time: 0.25s;
--d-sidebar-animation-ease: ease-in-out;
}
#main-outlet-wrapper {
.sidebar-wrapper {
grid-area: sidebar;
position: sticky;
top: var(--header-offset);
height: calc(100vh - var(--header-offset));
align-self: start;
overflow-y: auto;
background-color: var(--primary-very-low);
}
.sidebar-container {
display: flex;
flex-direction: column;
box-sizing: border-box;
height: 100%;
width: var(--d-sidebar-width);
padding: 1em 0 0;
overflow-x: hidden;
overflow-y: auto;
// custom scrollbar styling
--scrollbarBg: transparent;
--scrollbarThumbBg: var(--primary-low);
--scrollbarWidth: 1.2em;
scrollbar-color: transparent var(--scrollbarBg);
transition: scrollbar-color 0.25s ease-in-out;
transition-delay: 0.5s;
&::-webkit-scrollbar-thumb {
background-color: transparent;
border-radius: calc(var(--scrollbarWidth) / 2);
border: calc(var(--scrollbarWidth) / 4) solid var(--primary-very-low);
}
&:hover {
scrollbar-color: var(--scrollbarThumbBg) var(--scrollbarBg);
&::-webkit-scrollbar-thumb {
background-color: var(--scrollbarThumbBg);
}
transition-delay: 0s;
}
&::-webkit-scrollbar {
width: var(--scrollbarWidth);
}
}
.sidebar-scroll-wrap {
// limit the wrapper width, so when the scrollbar is added the content doesn't shift
max-width: calc(var(--d-sidebar-width) - var(--scrollbarWidth));
box-sizing: border-box;
flex: 1;
display: flex;
flex-direction: column;
}
.sidebar-sections {
flex: 1;
}
}