Skip to content

Commit 5991d9a

Browse files
authored
chore: fix mobile nav in docs (#767)
1 parent 398e348 commit 5991d9a

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

docs/src/components/Header/SidebarToggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const MenuToggle: FunctionalComponent = () => {
1919
type="button"
2020
aria-pressed={sidebarShown ? "true" : "false"}
2121
id="menu-toggle"
22-
onClick={() => setSidebarShown(!sidebarShown)}
22+
onClick={() => setSidebarShown((show) => !show)}
2323
>
2424
<svg
2525
xmlns="http://www.w3.org/2000/svg"

docs/src/components/PageContent/PageContent.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const { title, headings, githubEditUrl, githubRepo } = Astro.props;
1818
<section class="main-section">
1919
<h1 class="content-title" id="overview">{title}</h1>
2020
<nav class="block sm:hidden">
21-
<TableOfContents client:media="(max-width: 50em)" headings={headings} />
21+
<TableOfContents client:visible headings={headings} />
2222
</nav>
2323
{
2424
githubRepo ? (

docs/src/components/RightSidebar/RightSidebar.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const { headings, githubEditUrl } = Astro.props;
1414

1515
<nav class="sidebar-nav" aria-labelledby="grid-right">
1616
<div class="sidebar-nav-inner">
17-
<TableOfContents client:media="(min-width: 50em)" headings={headings} />
17+
<TableOfContents client:visible headings={headings} />
1818
<MoreMenu editHref={githubEditUrl} />
1919
<a
2020
class="github-button"

docs/src/layouts/MainLayout.astro

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,21 @@ const currentFile = `src/content/docs${currentPage.replace(/\/$/, "")}.md`;
109109
display: flex;
110110
}
111111
}
112-
</style>
113-
<style is:global>
114-
.layout > * {
115-
width: 100%;
116-
height: 100%;
117-
}
118112

119-
.mobile-sidebar-toggle {
113+
:global(.mobile-sidebar-toggle) {
120114
overflow: hidden;
121115
}
122116

123-
.mobile-sidebar-toggle #grid-left {
117+
:global(.mobile-sidebar-toggle) #grid-left {
124118
display: block;
125119
top: 2rem;
126120
}
127121
</style>
122+
<style is:global>
123+
.layout > * {
124+
width: 100%;
125+
height: 100%;
126+
}
127+
</style>
128128
</body>
129129
</html>

0 commit comments

Comments
 (0)