Skip to content

Commit 94fa7fd

Browse files
mydeabitsandfoxes
authored andcommitted
fix(style): Ensure scrollbar is consistent (#13354)
1 parent 2ec682b commit 94fa7fd

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/components/sidebar/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ export async function Sidebar({path, versions}: SidebarProps) {
8181
});
8282

8383
return (
84-
<aside className={styles.sidebar}>
84+
<aside className={`${styles.sidebar} py-3`}>
8585
<input type="checkbox" id={sidebarToggleId} className="hidden" />
8686
<style>{':root { --sidebar-width: 300px; }'}</style>
8787
<div className="md:flex flex-col items-stretch overflow-auto">
88-
<div className="platform-selector">
88+
<div className="platform-selector px-3">
8989
<div className="mb-3">
9090
<PlatformSelector
9191
platforms={platforms}
@@ -98,7 +98,7 @@ export async function Sidebar({path, versions}: SidebarProps) {
9898
</div>
9999
)}
100100
</div>
101-
<div className={styles.toc}>
101+
<div className={`${styles.toc} px-3`}>
102102
<ScrollActiveLink activeLinkSelector={activeLinkSelector} />
103103
<SidebarLinks path={path} />
104104
</div>

src/components/sidebar/style.module.scss

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
flex-direction: column;
1414
width: 100%;
1515
z-index: 10;
16-
padding: 1.5rem 1rem;
1716
border-right: 1px solid var(--border-color);
1817
position: fixed;
1918
display: none;
@@ -70,16 +69,9 @@
7069
}
7170

7271
.toc {
73-
overflow: auto;
7472
font-size: 0.875rem;
7573
flex: 1;
76-
overflow-y: hidden;
77-
overflow-x: hidden;
78-
79-
// https://stackoverflow.com/questions/35484742/hide-useless-scrollbars-that-show-up-on-windows-only
80-
&:hover {
81-
overflow-y: auto;
82-
}
74+
overflow: auto;
8375

8476
@media only screen and (min-width: 768px) {
8577
display: block;

0 commit comments

Comments
 (0)