A platform for community discussion. Free, open, simple.
UX: Adjust scrollbar behaviour in sidebar
Alan Guo Xiang Tana3565914a4c3
diff --git a/app/assets/javascripts/discourse/app/components/sidebar.hbs b/app/assets/javascripts/discourse/app/components/sidebar.hbsindex 03f183e0b54..0b35ab32f34 100644--- a/app/assets/javascripts/discourse/app/components/sidebar.hbs+++ b/app/assets/javascripts/discourse/app/components/sidebar.hbs@@ -2,10 +2,10 @@<div class="sidebar-scroll-wrap">{{#if this.currentUser}}<Sidebar::Sections @collapsableSections={{true}}/>- <Sidebar::Footer />{{else}}<Sidebar::AnonymousSections />- <Sidebar::Footer />{{/if}}</div>++ <Sidebar::Footer /></DSection>diff --git a/app/assets/stylesheets/common/base/sidebar.scss b/app/assets/stylesheets/common/base/sidebar.scssindex c3616268af2..4a49a1850c5 100644--- a/app/assets/stylesheets/common/base/sidebar.scss+++ b/app/assets/stylesheets/common/base/sidebar.scss@@ -34,7 +34,15 @@width: var(--d-sidebar-width);padding: 1em 0 0;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--scrollbarBg: transparent;@@ -48,29 +56,23 @@&::-webkit-scrollbar-thumb {background-color: transparent;border-radius: calc(var(--scrollbarWidth) / 2);- border: calc(var(--scrollbarWidth) / 4) solid var(--primary-very-low);+ border: calc(var(--scrollbarWidth) / 4) solid transparent;}&:hover {scrollbar-color: var(--scrollbarThumbBg) var(--scrollbarBg);+&::-webkit-scrollbar-thumb {background-color: var(--scrollbarThumbBg);+ border-color: var(--primary-very-low);}+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));- box-sizing: border-box;- flex: 1;- display: flex;- flex-direction: column;.composer-open & {// allows sidebar to scroll to the bottom when the composer is open