diff --git a/packages/docusaurus-theme-classic/src/theme/CodeBlock/styles.module.css b/packages/docusaurus-theme-classic/src/theme/CodeBlock/styles.module.css index ecf0d8e24b6c..f9aa8ec795d1 100644 --- a/packages/docusaurus-theme-classic/src/theme/CodeBlock/styles.module.css +++ b/packages/docusaurus-theme-classic/src/theme/CodeBlock/styles.module.css @@ -9,16 +9,16 @@ position: relative; /*rtl:ignore*/ direction: ltr; + margin-bottom: var(--ifm-leading); } .codeBlockTitle { border-top-left-radius: var(--ifm-global-radius); border-top-right-radius: var(--ifm-global-radius); - border-bottom: 1px solid var(--ifm-color-emphasis-200); - font-family: var(--ifm-font-family-monospace); - font-weight: bold; + border-bottom: 1px solid var(--ifm-color-emphasis-300); + font-size: var(--ifm-code-font-size); + font-weight: 500; padding: 0.75rem var(--ifm-pre-padding); - width: 100%; } .codeBlock { @@ -53,9 +53,8 @@ } .codeBlockLines { - font-family: var(--ifm-font-family-monospace); - font-size: inherit; - line-height: var(--ifm-pre-line-height); + font: var(--ifm-code-font-size) / var(--ifm-pre-line-height) + var(--ifm-font-family-monospace); white-space: pre; float: left; min-width: 100%; diff --git a/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx b/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx index 0feff446fee8..9792c64e03b7 100644 --- a/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx @@ -11,8 +11,6 @@ import CodeBlock from '@theme/CodeBlock'; import Heading from '@theme/Heading'; import type {MDXComponentsObject} from '@theme/MDXComponents'; -import styles from './styles.module.css'; - const MDXComponents: MDXComponentsObject = { code: (props) => { const {children} = props; @@ -25,7 +23,7 @@ const MDXComponents: MDXComponentsObject = { return children; }, a: (props) => , - pre: (props) =>
, + pre: (props) =>
, h1: Heading('h1'), h2: Heading('h2'), h3: Heading('h3'), diff --git a/packages/docusaurus-theme-classic/src/theme/MDXComponents/styles.module.css b/packages/docusaurus-theme-classic/src/theme/MDXComponents/styles.module.css deleted file mode 100644 index 1dba84ecf1b3..000000000000 --- a/packages/docusaurus-theme-classic/src/theme/MDXComponents/styles.module.css +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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. - */ - -.mdxCodeBlock { - position: relative; - margin-bottom: var(--ifm-leading); - font-size: var(--ifm-code-font-size); -} - -.mdxCodeBlock pre { - font-size: inherit; -}