Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tweak language dropdown styling #3748

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
zenoachtig merged 4 commits into main from tweak-language-dropdown-styling
Oct 22, 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/quiet-comics-act.md
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gitbook": patch
---

Tweak language dropdown styling
13 changes: 6 additions & 7 deletions packages/gitbook/src/components/Header/Header.tsx
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,12 @@ export function Header(props: {
<div className="transition-[padding] duration-300 lg:chat-open:pr-80 xl:chat-open:pr-96">
<SiteSectionTabs sections={encodeClientSiteSections(context, sections)}>
{withVariants === 'translations' ? (
<div className="before:contents[] flex self-start py-2 before:mr-4 before:border-tint before:border-l">
<TranslationsDropdown
context={context}
siteSpace={siteSpace}
siteSpaces={siteSpaces}
/>
</div>
<TranslationsDropdown
context={context}
siteSpace={siteSpace}
siteSpaces={siteSpaces}
className="my-2 ml-2 self-start"
/>
) : null}
</SiteSectionTabs>
</div>
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,18 @@ export function SiteSectionTabs(props: {
className={tcls(
'grow',
'md:-ml-8 -ml-4 sm:-ml-6',
!children ? 'md:-mr-8 -mr-4 sm:-mr-6' : ''
!children
? 'md:-mr-8 -mr-4 sm:-mr-6'
: 'after:contents[] after:absolute after:inset-y-2 after:right-0 after:border-transparent after:border-r after:transition-colors'
)}
activeId={currentSection.id}
trailingEdgeScrollClassName={children ? 'after:border-tint' : ''}
>
<NavigationMenu.List
className={tcls(
'-mx-3 flex grow gap-2 bg-transparent',
'pl-4 sm:pl-6 md:pl-8',
!children ? 'pr-4 sm:pr-6 md:pr-8' : ''
!children ? 'pr-4 sm:pr-6 md:pr-8' : 'pr-4'
)}
aria-label="Sections"
id="sections"
Expand Down
27 changes: 23 additions & 4 deletions packages/gitbook/src/components/primitives/ScrollContainer.tsx
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ export type ScrollContainerProps = {
children: React.ReactNode;
className?: string;

/** Optional class(es) to apply when there the container can be scrolled on the leading (left or top) edge */
leadingEdgeScrollClassName?: string;

/** Optional class(es) to apply when there the container can be scrolled on the trailing (right or bottom) edge */
trailingEdgeScrollClassName?: string;

/** The direction of the scroll container. */
orientation: 'horizontal' | 'vertical';

Expand All @@ -23,7 +29,15 @@ export type ScrollContainerProps = {
} & React.HTMLAttributes<HTMLDivElement>;

export function ScrollContainer(props: ScrollContainerProps) {
const { children, className, orientation, activeId, ...rest } = props;
const {
children,
className,
orientation,
activeId,
leadingEdgeScrollClassName,
trailingEdgeScrollClassName,
...rest
} = props;

const containerRef = React.useRef<HTMLDivElement>(null);

Expand Down Expand Up @@ -110,7 +124,12 @@ export function ScrollContainer(props: ScrollContainerProps) {

return (
<div
className={tcls('group/scroll-container relative flex overflow-hidden', className)}
className={tcls(
'group/scroll-container relative flex overflow-hidden',
className,
scrollPosition > 0 ? leadingEdgeScrollClassName : '',
scrollPosition < scrollSize ? trailingEdgeScrollClassName : ''
)}
{...rest}
>
{/* Scrollable content */}
Expand Down Expand Up @@ -140,7 +159,7 @@ export function ScrollContainer(props: ScrollContainerProps) {
icon={orientation === 'horizontal' ? 'chevron-left' : 'chevron-up'}
iconOnly
size="xsmall"
variant="secondary"
variant="header"
tabIndex={-1}
className={tcls(
orientation === 'horizontal'
Expand All @@ -158,7 +177,7 @@ export function ScrollContainer(props: ScrollContainerProps) {
icon={orientation === 'horizontal' ? 'chevron-right' : 'chevron-down'}
iconOnly
size="xsmall"
variant="secondary"
variant="header"
tabIndex={-1}
className={tcls(
orientation === 'horizontal'
Expand Down

AltStyle によって変換されたページ (->オリジナル) /