Skip to content

Commit 0d98ec1

Browse files
Fix: Sidebar logo
Fixes sidebar logo to be included again instead of empty space.
1 parent 9fdca07 commit 0d98ec1

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

src/css/custom.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,8 @@ iframe {
455455
}
456456
}
457457

458-
.theme-doc-sidebar-container [class^='sidebarLogo_'] {
459458
border-bottom: 1px solid var(--next-prev-border-color);
459+
.theme-doc-sidebar-container [class^='sidebarLogo_'] {
460460
margin: 0;
461461
}
462462

@@ -1493,6 +1493,7 @@ pre[class*='language-'] code span.token {
14931493
/* Mobile Navigation */
14941494
.navbar-sidebar {
14951495
background-color: var(--main-bg-color);
1496+
z-index: 1000;
14961497
}
14971498

14981499
.navbar-sidebar__back {

src/theme/DocSidebar/CustomSidebar.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,21 @@
33
background-color: var(--sidebar-bg-color) !important;
44
width: 100%;
55
overflow-y: auto;
6-
padding-top: 5rem;
6+
}
7+
8+
.custom-sidebar__logo {
9+
display: grid;
10+
place-items: center;
11+
padding: 1rem;
12+
height: 5rem;
13+
width: 100%;
14+
text-align: center;
15+
}
16+
17+
.custom-sidebar__logo svg {
18+
max-height: 100%;
19+
max-width: 80%;
20+
object-fit: contain;
721
}
822

923
.custom-sidebar__content {

src/theme/DocSidebar/Desktop/index.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { useLocation } from '@docusaurus/router';
3+
import { useColorMode } from '@docusaurus/theme-common';
34
import type { PropSidebarItem } from '@docusaurus/plugin-content-docs';
45
import Link from '@docusaurus/Link';
56
import {
@@ -9,6 +10,9 @@ import {
910
type Category,
1011
} from '../utils';
1112
import '../CustomSidebar.css';
13+
import LogoLight from '@site/static/img/pql-logo-large.svg';
14+
import LogoDark from '@site/static/img/pql-logo-large-dark-mode.svg';
15+
1216

1317
interface ContentProps {
1418
path: string;
@@ -17,6 +21,7 @@ interface ContentProps {
1721

1822
export default function Content({ sidebar }: ContentProps) {
1923
const location = useLocation();
24+
const { colorMode } = useColorMode();
2025
const categories: Category[] = buildCategories(sidebar);
2126

2227
const renderSidebarItem = (item: PropSidebarItem): React.ReactElement => {
@@ -80,6 +85,11 @@ export default function Content({ sidebar }: ContentProps) {
8085
role="navigation"
8186
aria-label="Documentation sidebar"
8287
>
88+
<div className="custom-sidebar__logo">
89+
<Link to="/index">
90+
{colorMode === 'dark' ? <LogoDark /> : <LogoLight />}
91+
</Link>
92+
</div>
8393
<div className="custom-sidebar__content">
8494
{categories.map(renderCategory)}
8595
</div>

0 commit comments

Comments
 (0)