mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 13:43:36 +08:00
UX: improve experimental sidebar scrollbar (#17293)
This commit is contained in:
parent
b1f7da4fe3
commit
321dc29583
|
@ -1,5 +1,6 @@
|
|||
{{#d-section pageClass="has-sidebar" class="sidebar-wrapper"}}
|
||||
<div class="sidebar-container">
|
||||
<div class="sidebar-scroll-wrap">
|
||||
<Sidebar::TopicsSection />
|
||||
<Sidebar::CategoriesSection />
|
||||
|
||||
|
@ -11,4 +12,5 @@
|
|||
<Sidebar::MessagesSection />
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/d-section}}
|
||||
|
|
|
@ -44,7 +44,36 @@
|
|||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
width: 240px;
|
||||
padding: 1em 0.5em 1em 0;
|
||||
padding: 1em 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
|
||||
// custom scrollbar styling
|
||||
--scrollbarBg: transparent;
|
||||
--scrollbarThumbBg: var(--primary-low);
|
||||
--scrollbarWidth: 1em;
|
||||
|
||||
scrollbar-color: transparent var(--scrollbarBg);
|
||||
transition: scrollbar-color 0.2s ease-in-out;
|
||||
&::-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);
|
||||
}
|
||||
}
|
||||
&::-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));
|
||||
}
|
||||
|
||||
.sidebar-toggle {
|
||||
|
|
Loading…
Reference in New Issue
Block a user