diff --git a/packages/docusaurus-theme-classic/src/theme/DocRoot/Layout/Sidebar/styles.module.css b/packages/docusaurus-theme-classic/src/theme/DocRoot/Layout/Sidebar/styles.module.css index f821f3b605645..b2f90b1389269 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocRoot/Layout/Sidebar/styles.module.css +++ b/packages/docusaurus-theme-classic/src/theme/DocRoot/Layout/Sidebar/styles.module.css @@ -33,7 +33,7 @@ .sidebarViewport { top: 0; position: sticky; - height: 100%; - max-height: 100vh; + min-height: 277px; + height: 100vh; } } diff --git a/packages/docusaurus-theme-classic/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css b/packages/docusaurus-theme-classic/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css index c5026e8bf1545..477b059aa947e 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +++ b/packages/docusaurus-theme-classic/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css @@ -20,7 +20,6 @@ display: block !important; background-color: var(--docusaurus-collapse-button-bg); height: 40px; - position: sticky; bottom: 0; border-radius: 0; border: 1px solid var(--ifm-toc-border-color); diff --git a/packages/docusaurus-theme-classic/src/theme/DocSidebar/Desktop/Content/index.tsx b/packages/docusaurus-theme-classic/src/theme/DocSidebar/Desktop/Content/index.tsx index cbd89b05f6611..494fe7da6320f 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocSidebar/Desktop/Content/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/DocSidebar/Desktop/Content/index.tsx @@ -5,41 +5,20 @@ * LICENSE file in the root directory of this source tree. */ -import React, {useState} from 'react'; +import React from 'react'; import clsx from 'clsx'; import {ThemeClassNames} from '@docusaurus/theme-common'; -import { - useAnnouncementBar, - useScrollPosition, -} from '@docusaurus/theme-common/internal'; import {translate} from '@docusaurus/Translate'; import DocSidebarItems from '@theme/DocSidebarItems'; import type {Props} from '@theme/DocSidebar/Desktop/Content'; import styles from './styles.module.css'; -function useShowAnnouncementBar() { - const {isActive} = useAnnouncementBar(); - const [showAnnouncementBar, setShowAnnouncementBar] = useState(isActive); - - useScrollPosition( - ({scrollY}) => { - if (isActive) { - setShowAnnouncementBar(scrollY === 0); - } - }, - [isActive], - ); - return isActive && showAnnouncementBar; -} - export default function DocSidebarDesktopContent({ path, sidebar, className, }: Props): JSX.Element { - const showAnnouncementBar = useShowAnnouncementBar(); - return (