Skip to content

Commit 4721403

Browse files
authored
Hide scrollbar on sections (#3367)
1 parent df848ef commit 4721403

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

.changeset/brown-ducks-think.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": patch
3+
---
4+
5+
Hide scrollbar on sections

packages/gitbook/src/components/DocumentView/OpenAPI/style.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,7 @@ body:has(.openapi-select-popover) {
680680
/* Tabs */
681681
.openapi-panel-header,
682682
.openapi-tabs-list {
683-
@apply flex flex-row gap-1.5 py-1.5 px-2.5 w-full overflow-x-scroll;
684-
scrollbar-width: none;
685-
-ms-overflow-style: none;
683+
@apply flex flex-row gap-1.5 py-1.5 px-2.5 w-full overflow-x-auto no-scrollbar;
686684
}
687685

688686
.openapi-tabs-tab {

packages/gitbook/src/components/Header/Header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ export function Header(props: { context: GitBookSiteContext; withTopHeader?: boo
183183
<div
184184
className={tcls(
185185
'w-full',
186-
'overflow-x-scroll',
187-
'overflow-y-hidden',
186+
'overflow-x-auto',
187+
'no-scrollbar',
188188
'-mb-4 pb-4', // Positive padding / negative margin allows the navigation menu indicator to show in a scroll viewƒ
189189
!sections ? ['hidden', 'page-no-toc:flex'] : 'flex'
190190
)}

packages/gitbook/tailwind.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,17 @@ const config: Config = {
456456
},
457457
},
458458
plugins: [
459+
plugin(({ addUtilities }) => {
460+
addUtilities({
461+
'.no-scrollbar': {
462+
'scrollbar-width': 'none',
463+
'-ms-overflow-style': 'none',
464+
'&::-webkit-scrollbar': {
465+
display: 'none',
466+
},
467+
},
468+
});
469+
}),
459470
plugin(({ addVariant }) => {
460471
/**
461472
* Variant when the Table of Content navigation is open.

0 commit comments

Comments
 (0)