diff --git a/packages/docusaurus-theme-classic/src/theme/BlogSidebar/styles.module.css b/packages/docusaurus-theme-classic/src/theme/BlogSidebar/styles.module.css index e8037a09cbcf..c55e3277a701 100644 --- a/packages/docusaurus-theme-classic/src/theme/BlogSidebar/styles.module.css +++ b/packages/docusaurus-theme-classic/src/theme/BlogSidebar/styles.module.css @@ -25,8 +25,7 @@ .sidebarItem { list-style-type: none; - margin-top: 0.8rem; - margin-bottom: 0.8rem; + margin: 0.8rem 0; } .sidebarItemLink { diff --git a/packages/docusaurus-theme-classic/src/theme/TOC/styles.module.css b/packages/docusaurus-theme-classic/src/theme/TOC/styles.module.css index b58430c06f1f..e0950d845739 100644 --- a/packages/docusaurus-theme-classic/src/theme/TOC/styles.module.css +++ b/packages/docusaurus-theme-classic/src/theme/TOC/styles.module.css @@ -6,7 +6,6 @@ */ .tableOfContents { - display: inherit; max-height: calc(100vh - (var(--ifm-navbar-height) + 2rem)); overflow-y: auto; position: sticky; diff --git a/packages/docusaurus-theme-classic/src/theme/TOCInline/index.tsx b/packages/docusaurus-theme-classic/src/theme/TOCInline/index.tsx index ea65e57da9b4..152c076b66d3 100644 --- a/packages/docusaurus-theme-classic/src/theme/TOCInline/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/TOCInline/index.tsx @@ -11,8 +11,6 @@ import type {TOCProps} from '@theme/TOC'; import styles from './styles.module.css'; import {TOCItem} from '@docusaurus/types'; -const LINK_CLASS_NAME = styles['table-of-contents__link--inline']; - /* eslint-disable jsx-a11y/control-has-associated-label */ function HeadingsInline({ toc, @@ -30,7 +28,6 @@ function HeadingsInline({
  • { } if (scrollTop < navbarHeight) { + setIsNavbarVisible(true); return; } diff --git a/packages/docusaurus-theme-classic/src/theme/hooks/useWindowSize.ts b/packages/docusaurus-theme-classic/src/theme/hooks/useWindowSize.ts index a07eeea7c05a..6c899431cc95 100644 --- a/packages/docusaurus-theme-classic/src/theme/hooks/useWindowSize.ts +++ b/packages/docusaurus-theme-classic/src/theme/hooks/useWindowSize.ts @@ -7,6 +7,7 @@ import {useEffect, useState} from 'react'; +import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment'; import type {WindowSize} from '@theme/hooks/useWindowSize'; const desktopThresholdWidth = 996; @@ -17,7 +18,7 @@ const windowSizes = { } as const; function useWindowSize(): WindowSize | undefined { - const isClient = typeof window !== 'undefined'; + const isClient = ExecutionEnvironment.canUseDOM; function getSize() { if (!isClient) {