-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
82 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
packages/docusaurus-theme-classic/src/theme/TOCCollapsible/CollapseButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* 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 Translate from '@docusaurus/Translate'; | ||
import styles from './CollapseButton.module.css'; | ||
import type {Props} from '@theme/TOCCollapsible/CollapseButton'; | ||
|
||
export default function TOCCollapsibleCollapseButton({ | ||
collapsed, | ||
...props | ||
}: Props): JSX.Element { | ||
return ( | ||
<button | ||
type="button" | ||
{...props} | ||
className={clsx( | ||
'clean-btn', | ||
styles.tocCollapsibleButton, | ||
!collapsed && styles.tocCollapsibleButtonExpanded, | ||
props.className, | ||
)}> | ||
<Translate | ||
id="theme.TOCCollapsible.toggleButtonLabel" | ||
description="The label used by the button on the collapsible TOC component"> | ||
On this page | ||
</Translate> | ||
</button> | ||
); | ||
} |
31 changes: 31 additions & 0 deletions
31
packages/docusaurus-theme-classic/src/theme/TOCCollapsible/index.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
.tocCollapsible { | ||
background-color: var(--ifm-menu-color-background-active); | ||
border-radius: var(--ifm-global-radius); | ||
margin: 1rem 0; | ||
} | ||
|
||
.tocCollapsibleContent > ul { | ||
border-left: none; | ||
border-top: 1px solid var(--ifm-color-emphasis-300); | ||
padding: 0.2rem 0; | ||
font-size: 15px; | ||
} | ||
|
||
.tocCollapsibleContent ul li { | ||
margin: 0.4rem 0.8rem; | ||
} | ||
|
||
.tocCollapsibleContent a { | ||
display: block; | ||
} | ||
|
||
.tocCollapsibleExpanded { | ||
transform: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters