UX: Adjust scrollbar behaviour in sidebar

Vertical sidebar is only restricted to sidebar sections and not the
footer.
This commit is contained in:
Alan Guo Xiang Tan 2022-08-19 10:51:55 +08:00
parent 1e1cf1e821
commit a3565914a4
2 changed files with 15 additions and 13 deletions

View File

@ -2,10 +2,10 @@
<div class="sidebar-scroll-wrap"> <div class="sidebar-scroll-wrap">
{{#if this.currentUser}} {{#if this.currentUser}}
<Sidebar::Sections @collapsableSections={{true}}/> <Sidebar::Sections @collapsableSections={{true}}/>
<Sidebar::Footer />
{{else}} {{else}}
<Sidebar::AnonymousSections /> <Sidebar::AnonymousSections />
<Sidebar::Footer />
{{/if}} {{/if}}
</div> </div>
<Sidebar::Footer />
</DSection> </DSection>

View File

@ -34,7 +34,15 @@
width: var(--d-sidebar-width); width: var(--d-sidebar-width);
padding: 1em 0 0; padding: 1em 0 0;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; }
.sidebar-scroll-wrap {
box-sizing: border-box;
flex: 1;
display: flex;
flex-direction: column;
overflow-x: hidden;
overflow-y: overlay;
// custom scrollbar styling // custom scrollbar styling
--scrollbarBg: transparent; --scrollbarBg: transparent;
@ -48,29 +56,23 @@
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
background-color: transparent; background-color: transparent;
border-radius: calc(var(--scrollbarWidth) / 2); border-radius: calc(var(--scrollbarWidth) / 2);
border: calc(var(--scrollbarWidth) / 4) solid var(--primary-very-low); border: calc(var(--scrollbarWidth) / 4) solid transparent;
} }
&:hover { &:hover {
scrollbar-color: var(--scrollbarThumbBg) var(--scrollbarBg); scrollbar-color: var(--scrollbarThumbBg) var(--scrollbarBg);
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
background-color: var(--scrollbarThumbBg); background-color: var(--scrollbarThumbBg);
border-color: var(--primary-very-low);
} }
transition-delay: 0s; transition-delay: 0s;
} }
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: var(--scrollbarWidth); 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));
box-sizing: border-box;
flex: 1;
display: flex;
flex-direction: column;
.composer-open & { .composer-open & {
// allows sidebar to scroll to the bottom when the composer is open // allows sidebar to scroll to the bottom when the composer is open