From 7f1b6c06b6ccec7f61adb8d20d32731da67f644f Mon Sep 17 00:00:00 2001
From: Ilion Beyst <ilion.beyst@gmail.com>
Date: Mon, 12 Sep 2022 21:55:16 +0200
Subject: add toc sidebar to docs site

---
 web/pw-server/src/routes/docs/__layout.svelte | 60 +++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 web/pw-server/src/routes/docs/__layout.svelte

(limited to 'web/pw-server/src/routes/docs/__layout.svelte')

diff --git a/web/pw-server/src/routes/docs/__layout.svelte b/web/pw-server/src/routes/docs/__layout.svelte
new file mode 100644
index 0000000..40c4317
--- /dev/null
+++ b/web/pw-server/src/routes/docs/__layout.svelte
@@ -0,0 +1,60 @@
+<script>
+  import TocEntry from "$lib/components/docs/TocEntry.svelte";
+</script>
+
+<div class="container">
+  <div class="sidebar">
+    <div class="sidebar-content">
+      <h2>Docs</h2>
+      <div class="sidebar-nav-group">
+        <TocEntry href="/docs/rules" text="Rules" />
+      </div>
+    </div>
+  </div>
+  <div class="content-container">
+    <div class="content">
+      <slot />
+    </div>
+  </div>
+</div>
+
+<style lang="scss">
+  @use "src/styles/variables";
+
+  .container {
+    display: flex;
+    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
+      "Open Sans", "Helvetica Neue", sans-serif;
+  }
+
+  .sidebar {
+    width: 300px;
+    line-height: 20px;
+    border-right: 1px solid variables.$light-grey;
+  }
+
+  .sidebar-content {
+    padding: 32px 16px;
+    position: sticky;
+    align-self: flex-start;
+    top: 0px;
+  }
+
+  .sidebar-content h2 {
+    margin: 16px 0;
+  }
+
+  .sidebar-nav-group {
+    padding: 0 8px;
+  }
+
+  .content-container {
+    padding: 16px 0;
+    flex-grow: 1;
+  }
+
+  .content {
+    max-width: 75%;
+    margin: 0 auto;
+  }
+</style>
-- 
cgit v1.2.3

