From e466a38d986eebe5a1c2f4a2ea628481955bc100 Mon Sep 17 00:00:00 2001 From: Rizel Scarlett Date: Tue, 14 Oct 2025 07:43:42 -0400 Subject: [PATCH] fix: remove unused imports and fix hardcoded CSS class in copy button --- .../src/theme/DocItem/Layout/index.tsx | 5 ++--- .../src/theme/DocItem/Layout/styles.module.css | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 documentation/src/theme/DocItem/Layout/styles.module.css diff --git a/documentation/src/theme/DocItem/Layout/index.tsx b/documentation/src/theme/DocItem/Layout/index.tsx index 630d7a9206..c1b587f647 100644 --- a/documentation/src/theme/DocItem/Layout/index.tsx +++ b/documentation/src/theme/DocItem/Layout/index.tsx @@ -1,5 +1,4 @@ import React, {type ReactNode, useState, useEffect} from 'react'; -import Layout from '@theme-original/DocItem/Layout'; import type LayoutType from '@theme/DocItem/Layout'; import type {WrapperProps} from '@docusaurus/types'; import {useDoc} from '@docusaurus/plugin-content-docs/client'; @@ -17,6 +16,7 @@ import Heading from '@theme/Heading'; import MDXContent from '@theme/MDXContent'; import {Copy, Check} from 'lucide-react'; import styles from './CopyPageButton.module.css'; +import layoutStyles from './styles.module.css'; import TurndownService from 'turndown'; type Props = WrapperProps; @@ -30,7 +30,6 @@ function CopyPageButton(): ReactNode { const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(null); const [isClient, setIsClient] = useState(false); - const {metadata} = useDoc(); // Ensure we're on the client side to avoid hydration issues useEffect(() => { @@ -278,7 +277,7 @@ function CustomDocItemLayout({children}: {children: ReactNode}): ReactNode {
-
+
diff --git a/documentation/src/theme/DocItem/Layout/styles.module.css b/documentation/src/theme/DocItem/Layout/styles.module.css new file mode 100644 index 0000000000..784498f2e1 --- /dev/null +++ b/documentation/src/theme/DocItem/Layout/styles.module.css @@ -0,0 +1,17 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +.docItemContainer header + *, +.docItemContainer article > *:first-child { + margin-top: 0; +} + +@media (min-width: 997px) { + .docItemCol { + max-width: 75% !important; + } +}