mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-30 18:58:36 +02:00
refactor(theme-classic): always collocate stylesheets with components in one folder (#7415)
This commit is contained in:
parent
3f110a36bd
commit
c17d745533
15 changed files with 11 additions and 9 deletions
|
@ -12,7 +12,7 @@ import type {Props} from '@theme/DocPage/Layout/Sidebar';
|
||||||
import ExpandButton from '@theme/DocPage/Layout/Sidebar/ExpandButton';
|
import ExpandButton from '@theme/DocPage/Layout/Sidebar/ExpandButton';
|
||||||
|
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import styles from './index.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
import {ThemeClassNames, useDocsSidebar} from '@docusaurus/theme-common';
|
import {ThemeClassNames, useDocsSidebar} from '@docusaurus/theme-common';
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,10 @@ import BackToTopButton from '@theme/BackToTopButton';
|
||||||
import type {Props} from '@theme/DocPage/Layout';
|
import type {Props} from '@theme/DocPage/Layout';
|
||||||
import DocPageLayoutSidebar from '@theme/DocPage/Layout/Sidebar';
|
import DocPageLayoutSidebar from '@theme/DocPage/Layout/Sidebar';
|
||||||
import DocPageLayoutMain from '@theme/DocPage/Layout/Main';
|
import DocPageLayoutMain from '@theme/DocPage/Layout/Main';
|
||||||
|
|
||||||
import styles from './index.module.css';
|
|
||||||
|
|
||||||
import {useDocsSidebar} from '@docusaurus/theme-common';
|
import {useDocsSidebar} from '@docusaurus/theme-common';
|
||||||
|
|
||||||
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function DocPageLayout({children}: Props): JSX.Element {
|
export default function DocPageLayout({children}: Props): JSX.Element {
|
||||||
const sidebar = useDocsSidebar();
|
const sidebar = useDocsSidebar();
|
||||||
const [hiddenSidebarContainer, setHiddenSidebarContainer] = useState(false);
|
const [hiddenSidebarContainer, setHiddenSidebarContainer] = useState(false);
|
||||||
|
|
|
@ -10,7 +10,7 @@ import clsx from 'clsx';
|
||||||
import {ThemeClassNames} from '@docusaurus/theme-common';
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
||||||
import type {Props} from '@theme/DocSidebarItem/Html';
|
import type {Props} from '@theme/DocSidebarItem/Html';
|
||||||
|
|
||||||
import styles from './Html.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function DocSidebarItemHtml({
|
export default function DocSidebarItemHtml({
|
||||||
item,
|
item,
|
|
@ -14,7 +14,7 @@ import IconExternalLink from '@theme/IconExternalLink';
|
||||||
|
|
||||||
import type {Props} from '@theme/DocSidebarItem/Link';
|
import type {Props} from '@theme/DocSidebarItem/Link';
|
||||||
|
|
||||||
import styles from './Link.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function DocSidebarItemLink({
|
export default function DocSidebarItemLink({
|
||||||
item,
|
item,
|
|
@ -7,9 +7,10 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import type {Props} from '@theme/MDXComponents/Img';
|
import type {Props} from '@theme/MDXComponents/Img';
|
||||||
import styles from './Img.module.css';
|
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
function transformImgClassName(className?: string): string {
|
function transformImgClassName(className?: string): string {
|
||||||
return clsx(className, styles.img);
|
return clsx(className, styles.img);
|
||||||
}
|
}
|
|
@ -8,9 +8,10 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Translate from '@docusaurus/Translate';
|
import Translate from '@docusaurus/Translate';
|
||||||
import styles from './CollapseButton.module.css';
|
|
||||||
import type {Props} from '@theme/TOCCollapsible/CollapseButton';
|
import type {Props} from '@theme/TOCCollapsible/CollapseButton';
|
||||||
|
|
||||||
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function TOCCollapsibleCollapseButton({
|
export default function TOCCollapsibleCollapseButton({
|
||||||
collapsed,
|
collapsed,
|
||||||
...props
|
...props
|
|
@ -8,11 +8,12 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {useCollapsible, Collapsible} from '@docusaurus/theme-common';
|
import {useCollapsible, Collapsible} from '@docusaurus/theme-common';
|
||||||
import styles from './index.module.css';
|
|
||||||
import TOCItems from '@theme/TOCItems';
|
import TOCItems from '@theme/TOCItems';
|
||||||
import type {Props} from '@theme/TOCCollapsible';
|
import type {Props} from '@theme/TOCCollapsible';
|
||||||
import CollapseButton from '@theme/TOCCollapsible/CollapseButton';
|
import CollapseButton from '@theme/TOCCollapsible/CollapseButton';
|
||||||
|
|
||||||
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function TOCCollapsible({
|
export default function TOCCollapsible({
|
||||||
toc,
|
toc,
|
||||||
className,
|
className,
|
||||||
|
|
Loading…
Add table
Reference in a new issue