Skip to content

Commit 4c193d8

Browse files
committed
Merge branch 'menu_breakpoint_improvements_2' into revert-3866-revert-3860-menu_breakpoint_improvements
2 parents 9ffae85 + 76c43a4 commit 4c193d8

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

src/css/breakpoints.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/*
2-
Needed because we cannot import css into scss and use var(--some-variable)
3-
*/
41
$mobile-breakpoint: 996px;
52
$tablet-breakpoint: 1024px;
63
$laptop-breakpoint: 1330px;

src/theme/DocItem/Layout/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import DocItemTOCDesktop from '@theme/DocItem/TOC/Desktop';
1111
import DocItemContent from '@theme/DocItem/Content';
1212
import DocBreadcrumbs from '@theme/DocBreadcrumbs';
1313
import EditThisPage from '@theme/EditThisPage';
14-
import styles from './styles.module.css';
14+
import styles from './styles.module.scss';
1515
import Translate from "@docusaurus/Translate";
1616
import IconClose from "@theme/Icon/Close";
1717
import {useLocation} from "@docusaurus/router";

src/theme/DocItem/Layout/styles.module.css renamed to src/theme/DocItem/Layout/styles.module.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use '../../../css/breakpoints.scss' as breakpoints;
12

23
.docItemContainer header + *,
34
.docItemContainer article > *:first-child {
@@ -19,15 +20,15 @@
1920
justify-content: space-between;
2021
}
2122

22-
@media (min-width: var(--mobile-breakpoint)) {
23+
@media (min-width: breakpoints.$mobile-breakpoint) {
2324
.docItemCol {
2425
max-width: 75% !important;
26+
padding-bottom: 2rem;
2527
}
2628
}
2729

2830
@media (max-width: var(--mobile-breakpoint)) {
2931
.docItemContainer {
30-
padding-bottom: none;
3132
}
3233
}
3334

src/theme/DocSidebar/Desktop/Content/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from '@docusaurus/theme-common/internal';
88
import {translate} from '@docusaurus/Translate';
99
import DocSidebarItems from '@theme/DocSidebarItems';
10-
import styles from './styles.module.css';
10+
import styles from './styles.module.scss';
1111
export default function DocSidebarDesktopContent({path, sidebar, className}) {
1212
return (
1313
<nav
@@ -21,7 +21,7 @@ export default function DocSidebarDesktopContent({path, sidebar, className}) {
2121
styles.menu,
2222
className,
2323
)}
24-
style={{paddingTop: '1.75rem', overflowY: 'auto'}}
24+
style={{paddingTop: '1.75rem', marginBottom: '3.5rem', overflowY: 'auto'}}
2525
>
2626
<ul className={clsx(ThemeClassNames.docs.docSidebarMenu, 'menu__list')}>
2727
<DocSidebarItems items={sidebar} activePath={path} level={1} />

src/theme/DocSidebar/Desktop/Content/styles.module.css renamed to src/theme/DocSidebar/Desktop/Content/styles.module.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
@media (min-width: var(--mobile-breakpoint)) {
1+
@use '../../../../css/breakpoints.scss' as breakpoints;
2+
3+
@media (min-width: breakpoints.$mobile-breakpoint) {
24
.menu {
35
flex-grow: 1;
46
padding: 0 1rem 0.5rem;

src/theme/DocSidebar/Desktop/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {useThemeConfig} from '@docusaurus/theme-common';
44
import Logo from '@theme/Logo';
55
import CollapseButton from '@theme/DocSidebar/Desktop/CollapseButton';
66
import Content from '@theme/DocSidebar/Desktop/Content';
7-
import styles from './styles.module.css';
7+
import styles from './styles.module.scss';
88
import SearchBar from "../../SearchBar";
99
function DocSidebarDesktop({path, sidebar, onCollapse, isHidden, ...props}) {
1010
const {
@@ -45,7 +45,7 @@ function DocSidebarDesktop({path, sidebar, onCollapse, isHidden, ...props}) {
4545
styles.sidebar,
4646
hideOnScroll && styles.sidebarWithHideableNavbar,
4747
isHidden && styles.sidebarHidden,
48-
'padding-top--md',
48+
'padding-top--md'
4949
)}
5050
>
5151
{hideOnScroll && <Logo tabIndex={-1} className={styles.sidebarLogo} />}

src/theme/DocSidebar/Desktop/styles.module.css renamed to src/theme/DocSidebar/Desktop/styles.module.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
@import '../../../css/breakpoints.css';
1+
@use '../../../css/breakpoints.scss' as breakpoints;
2+
3+
@media (min-width: breakpoints.$mobile-breakpoint) {
24

3-
@media (min-width: var(--mobile-breakpoint)) {
45
.sidebar {
56
display: flex;
67
flex-direction: column;

0 commit comments

Comments
 (0)