Skip to content

Commit

Permalink
DocPageLayoutAsideExpandButton refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Apr 29, 2022
1 parent 802aa4b commit c5b1c58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

@media (min-width: 997px) {
.collapsedDocSidebar {
.expandButton {
position: sticky;
top: 0;
height: 100%;
Expand All @@ -17,21 +17,21 @@
transition: background-color var(--ifm-transition-fast) ease;
}

.collapsedDocSidebar:hover,
.collapsedDocSidebar:focus {
.expandButton:hover,
.expandButton:focus {
background-color: var(--ifm-color-emphasis-200);
}

.expandSidebarButtonIcon {
.expandButtonIcon {
transform: rotate(0);
}

[dir='rtl'] .expandSidebarButtonIcon {
[dir='rtl'] .expandButtonIcon {
transform: rotate(180deg);
}

[data-theme='dark'] .collapsedDocSidebar:hover,
[data-theme='dark'] .collapsedDocSidebar:focus {
[data-theme='dark'] .expandButton:hover,
[data-theme='dark'] .expandButton:focus {
background-color: var(--collapse-button-bg-color-dark);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import IconArrow from '@theme/IconArrow';
import {translate} from '@docusaurus/Translate';
import type {Props} from '@theme/DocPage/Layout/Aside/ExpandButton';

import styles from '../index.module.css';
import styles from './ExpandButton.module.css';

export default function DocPageLayoutAsideExpandButton({
toggleSidebar,
}: Props): JSX.Element {
return (
<div
className={styles.collapsedDocSidebar}
className={styles.expandButton}
title={translate({
id: 'theme.docs.sidebar.expandButtonTitle',
message: 'Expand sidebar',
Expand All @@ -34,7 +34,7 @@ export default function DocPageLayoutAsideExpandButton({
role="button"
onKeyDown={toggleSidebar}
onClick={toggleSidebar}>
<IconArrow className={styles.expandSidebarButtonIcon} />
<IconArrow className={styles.expandButtonIcon} />
</div>
);
}

0 comments on commit c5b1c58

Please sign in to comment.