diff --git a/packages/docusaurus-theme-classic/src/index.ts b/packages/docusaurus-theme-classic/src/index.ts
index ad7510a655..fcbd564972 100644
--- a/packages/docusaurus-theme-classic/src/index.ts
+++ b/packages/docusaurus-theme-classic/src/index.ts
@@ -147,6 +147,9 @@ const swizzleAllowedComponents = [
'Footer',
'NotFound',
'SearchBar',
+ 'IconArrow',
+ 'IconEdit',
+ 'IconMenu',
'hooks/useTheme',
'prism-include-languages',
];
diff --git a/packages/docusaurus-theme-classic/src/theme/BlogPostPage/index.tsx b/packages/docusaurus-theme-classic/src/theme/BlogPostPage/index.tsx
index 3fc557a825..688334f5a0 100644
--- a/packages/docusaurus-theme-classic/src/theme/BlogPostPage/index.tsx
+++ b/packages/docusaurus-theme-classic/src/theme/BlogPostPage/index.tsx
@@ -13,6 +13,7 @@ import BlogPostPaginator from '@theme/BlogPostPaginator';
import type {Props} from '@theme/BlogPostPage';
import BlogSidebar from '@theme/BlogSidebar';
import TOC from '@theme/TOC';
+import IconEdit from '@theme/IconEdit';
function BlogPostPage(props: Props): JSX.Element {
const {content: BlogPostContents, sidebar} = props;
@@ -41,20 +42,7 @@ function BlogPostPage(props: Props): JSX.Element {
{editUrl && (
-
+
Edit this page
)}
diff --git a/packages/docusaurus-theme-classic/src/theme/DocItem/index.tsx b/packages/docusaurus-theme-classic/src/theme/DocItem/index.tsx
index 7df82eb00c..080b8d4b56 100644
--- a/packages/docusaurus-theme-classic/src/theme/DocItem/index.tsx
+++ b/packages/docusaurus-theme-classic/src/theme/DocItem/index.tsx
@@ -15,6 +15,7 @@ import DocPaginator from '@theme/DocPaginator';
import DocVersionSuggestions from '@theme/DocVersionSuggestions';
import type {Props} from '@theme/DocItem';
import TOC from '@theme/TOC';
+import IconEdit from '@theme/IconEdit';
import clsx from 'clsx';
import styles from './styles.module.css';
@@ -111,20 +112,7 @@ function DocItem(props: Props): JSX.Element {
href={editUrl}
target="_blank"
rel="noreferrer noopener">
-
+
Edit this page
)}
diff --git a/packages/docusaurus-theme-classic/src/theme/DocPage/index.tsx b/packages/docusaurus-theme-classic/src/theme/DocPage/index.tsx
index 187cbee809..5ab7bcd93d 100644
--- a/packages/docusaurus-theme-classic/src/theme/DocPage/index.tsx
+++ b/packages/docusaurus-theme-classic/src/theme/DocPage/index.tsx
@@ -17,6 +17,7 @@ import MDXComponents from '@theme/MDXComponents';
import NotFound from '@theme/NotFound';
import type {DocumentRoute} from '@theme/DocItem';
import type {Props} from '@theme/DocPage';
+import IconArrow from '@theme/IconArrow';
import {matchPath} from '@docusaurus/router';
import clsx from 'clsx';
@@ -97,8 +98,9 @@ function DocPageContent({
tabIndex={0}
role="button"
onKeyDown={toggleSidebar}
- onClick={toggleSidebar}
- />
+ onClick={toggleSidebar}>
+
+
)}
)}
diff --git a/packages/docusaurus-theme-classic/src/theme/DocPage/styles.module.css b/packages/docusaurus-theme-classic/src/theme/DocPage/styles.module.css
index 1097388808..a5a6755212 100644
--- a/packages/docusaurus-theme-classic/src/theme/DocPage/styles.module.css
+++ b/packages/docusaurus-theme-classic/src/theme/DocPage/styles.module.css
@@ -49,13 +49,6 @@
background-color: var(--collapse-button-bg-color-dark);
}
- .collapsedDocSidebar:before {
- content: '';
- background-image: url('~!file-loader!../icons/arrow.svg');
- width: 20px;
- height: 20px;
- }
-
.docMainContainer {
flex-grow: 1;
}
diff --git a/packages/docusaurus-theme-classic/src/theme/DocSidebar/index.tsx b/packages/docusaurus-theme-classic/src/theme/DocSidebar/index.tsx
index fa7a51b830..f2f0f5a783 100644
--- a/packages/docusaurus-theme-classic/src/theme/DocSidebar/index.tsx
+++ b/packages/docusaurus-theme-classic/src/theme/DocSidebar/index.tsx
@@ -16,6 +16,8 @@ import Link from '@docusaurus/Link';
import isInternalUrl from '@docusaurus/isInternalUrl';
import type {Props} from '@theme/DocSidebar';
import Logo from '@theme/Logo';
+import IconArrow from '@theme/IconArrow';
+import IconMenu from '@theme/IconMenu';
import styles from './styles.module.css';
@@ -243,24 +245,11 @@ function DocSidebar({
×
) : (
-
+ />
)}
@@ -287,8 +276,9 @@ function DocSidebar({
'button button--secondary button--outline',
styles.collapseSidebarButton,
)}
- onClick={onCollapse}
- />
+ onClick={onCollapse}>
+
+
)}
);
diff --git a/packages/docusaurus-theme-classic/src/theme/DocSidebar/styles.module.css b/packages/docusaurus-theme-classic/src/theme/DocSidebar/styles.module.css
index 3d42eeed52..33a82edb9f 100644
--- a/packages/docusaurus-theme-classic/src/theme/DocSidebar/styles.module.css
+++ b/packages/docusaurus-theme-classic/src/theme/DocSidebar/styles.module.css
@@ -66,13 +66,16 @@
.collapseSidebarButton {
display: block !important;
- background: url('~!file-loader!../icons/arrow.svg') no-repeat center center;
background-color: var(--ifm-button-background-color);
height: 40px;
position: sticky;
bottom: 0;
border-radius: 0;
+ }
+
+ .collapseSidebarButtonIcon {
transform: rotate(180deg);
+ margin-top: 4px;
}
html[data-theme='dark'] .collapseSidebarButton {
diff --git a/packages/docusaurus-theme-classic/src/theme/IconArrow/index.tsx b/packages/docusaurus-theme-classic/src/theme/IconArrow/index.tsx
new file mode 100644
index 0000000000..058a7ca185
--- /dev/null
+++ b/packages/docusaurus-theme-classic/src/theme/IconArrow/index.tsx
@@ -0,0 +1,22 @@
+/**
+ * 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.
+ */
+
+import React from 'react';
+import {Props} from '@theme/IconArrow';
+
+const IconArrow = (props: Props): JSX.Element => {
+ return (
+
+ );
+};
+
+export default IconArrow;
diff --git a/packages/docusaurus-theme-classic/src/theme/IconEdit/index.tsx b/packages/docusaurus-theme-classic/src/theme/IconEdit/index.tsx
new file mode 100644
index 0000000000..fa0ac4d472
--- /dev/null
+++ b/packages/docusaurus-theme-classic/src/theme/IconEdit/index.tsx
@@ -0,0 +1,33 @@
+/**
+ * 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.
+ */
+
+import React from 'react';
+import clsx from 'clsx';
+
+import {Props} from '@theme/IconEdit';
+
+import styles from './styles.module.css';
+
+const IconEdit = ({className, ...restProps}: Props): JSX.Element => {
+ return (
+
+ );
+};
+
+export default IconEdit;
diff --git a/packages/docusaurus-theme-classic/src/theme/IconEdit/styles.module.css b/packages/docusaurus-theme-classic/src/theme/IconEdit/styles.module.css
new file mode 100644
index 0000000000..03ffe16564
--- /dev/null
+++ b/packages/docusaurus-theme-classic/src/theme/IconEdit/styles.module.css
@@ -0,0 +1,11 @@
+/**
+ * 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.
+ */
+
+.iconEdit {
+ margin-right: 0.3em;
+ vertical-align: sub;
+}
diff --git a/packages/docusaurus-theme-classic/src/theme/IconMenu/index.tsx b/packages/docusaurus-theme-classic/src/theme/IconMenu/index.tsx
new file mode 100644
index 0000000000..407325570f
--- /dev/null
+++ b/packages/docusaurus-theme-classic/src/theme/IconMenu/index.tsx
@@ -0,0 +1,39 @@
+/**
+ * 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.
+ */
+
+import React from 'react';
+import {Props} from '@theme/IconMenu';
+
+const IconMenu = ({
+ width = 30,
+ height = 30,
+ className,
+ ...restProps
+}: Props): JSX.Element => {
+ return (
+
+ );
+};
+
+export default IconMenu;
diff --git a/packages/docusaurus-theme-classic/src/theme/Navbar/index.tsx b/packages/docusaurus-theme-classic/src/theme/Navbar/index.tsx
index cef3b688d3..a8bdef350d 100644
--- a/packages/docusaurus-theme-classic/src/theme/Navbar/index.tsx
+++ b/packages/docusaurus-theme-classic/src/theme/Navbar/index.tsx
@@ -17,6 +17,7 @@ import useLockBodyScroll from '@theme/hooks/useLockBodyScroll';
import useWindowSize, {windowSizes} from '@theme/hooks/useWindowSize';
import NavbarItem from '@theme/NavbarItem';
import Logo from '@theme/Logo';
+import IconMenu from '@theme/IconMenu';
import styles from './styles.module.css';
@@ -94,22 +95,7 @@ function Navbar(): JSX.Element {
tabIndex={0}
onClick={showSidebar}
onKeyDown={showSidebar}>
-
+
)}
\ No newline at end of file
diff --git a/packages/docusaurus-theme-classic/src/types.d.ts b/packages/docusaurus-theme-classic/src/types.d.ts
index b2668f711b..e31330f9b6 100644
--- a/packages/docusaurus-theme-classic/src/types.d.ts
+++ b/packages/docusaurus-theme-classic/src/types.d.ts
@@ -478,3 +478,30 @@ declare module '@theme/Logo' {
const Logo: (props: Props) => JSX.Element;
export default Logo;
}
+
+declare module '@theme/IconArrow' {
+ import type {ComponentProps} from 'react';
+
+ export type Props = ComponentProps<'svg'>;
+
+ const IconArrow: (props: Props) => JSX.Element;
+ export default IconArrow;
+}
+
+declare module '@theme/IconEdit' {
+ import type {ComponentProps} from 'react';
+
+ export type Props = ComponentProps<'svg'>;
+
+ const IconEdit: (props: Props) => JSX.Element;
+ export default IconEdit;
+}
+
+declare module '@theme/IconMenu' {
+ import type {ComponentProps} from 'react';
+
+ export type Props = ComponentProps<'svg'>;
+
+ const IconMenu: (props: Props) => JSX.Element;
+ export default IconMenu;
+}