Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Documentation Website Responsive #103 #124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/components/SideNav.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<nav id="sidebar" class="pt-12 w-1/6 min-w-[16rem] bg-gray1 dark:bg-gray7 hidden lg:block">
<nav id="sidebar" class="absolute z-10 w-full pt-12 lg:relative lg:w-1/6 min-w-[16rem] bg-gray1 dark:bg-gray7 hidden lg:block">
<ul class="pl-8 font-code mb-20">
<li class="heading">guide</li>
<li><a href="/">why?</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docs/src/components/TopNav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ import Search from './Search.astro'
document.getElementById("dark")!.addEventListener("click", dark);

const sidebarBtn = document.getElementById("sidebarBtn");
const article = document.querySelector("article")
sidebarBtn.onclick = function () {
const sidebar = document.getElementById("sidebar");
sidebar.classList.toggle("hidden");
article.classList.toggle("hidden")
};
</script>
4 changes: 2 additions & 2 deletions docs/src/layouts/MainLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import Footer from "../components/Footer.astro";
</head>
<body class="dark:bg-gray6 dark:text-white transition-colors duration-500">
<TopNav />
<div class="flex items-stretch overflow-x-hidden">
<div class="relative flex items-stretch overflow-x-hidden">
<SideNav />
<main
class="max-w-screen-2xl min-h-screen p-6 lg:p-20 mx-auto prose dark:prose-invert w-full flex flex-col justify-between"
>
<article>
<article >
<slot />
</article>

Expand Down