Skip to content

Hide scrollbar on sections #3367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/brown-ducks-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gitbook": patch
---

Hide scrollbar on sections
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,7 @@ body:has(.openapi-select-popover) {
/* Tabs */
.openapi-panel-header,
.openapi-tabs-list {
@apply flex flex-row gap-1.5 py-1.5 px-2.5 w-full overflow-x-scroll;
scrollbar-width: none;
-ms-overflow-style: none;
@apply flex flex-row gap-1.5 py-1.5 px-2.5 w-full overflow-x-auto no-scrollbar;
}

.openapi-tabs-tab {
Expand Down
4 changes: 2 additions & 2 deletions packages/gitbook/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ export function Header(props: { context: GitBookSiteContext; withTopHeader?: boo
<div
className={tcls(
'w-full',
'overflow-x-scroll',
'overflow-y-hidden',
'overflow-x-auto',
'no-scrollbar',
'-mb-4 pb-4', // Positive padding / negative margin allows the navigation menu indicator to show in a scroll viewƒ
!sections ? ['hidden', 'page-no-toc:flex'] : 'flex'
)}
Expand Down
11 changes: 11 additions & 0 deletions packages/gitbook/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,17 @@ const config: Config = {
},
},
plugins: [
plugin(({ addUtilities }) => {
addUtilities({
'.no-scrollbar': {
'scrollbar-width': 'none',
'-ms-overflow-style': 'none',
'&::-webkit-scrollbar': {
display: 'none',
},
},
});
}),
plugin(({ addVariant }) => {
/**
* Variant when the Table of Content navigation is open.
Expand Down