diff --git a/site/src/routes/guide/_GuideContents.html b/site/src/routes/guide/_GuideContents.html
index fb3a3bac12..74f66a6256 100644
--- a/site/src/routes/guide/_GuideContents.html
+++ b/site/src/routes/guide/_GuideContents.html
@@ -4,6 +4,7 @@
export let sections = [];
export let active_section = null;
+ export let show_contents;
onMount(() => {
// ------------------------------------------
@@ -40,6 +41,10 @@
let ul;
afterUpdate(() => {
+ // bit of a hack — prevent sidebar scrolling if
+ // TOC is open on mobile
+ if (show_contents && window.innerWidth < 832) return;
+
const active = ul.querySelector('.active');
if (active) {
@@ -65,36 +70,7 @@
});
-
-
- @media screen and (min-width: 768px) {
- .guide-toc {
- --section-clr: black;
- }
- }
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/src/routes/guide/index.html b/site/src/routes/guide/index.html
index 6983a752eb..f3b164139b 100644
--- a/site/src/routes/guide/index.html
+++ b/site/src/routes/guide/index.html
@@ -10,15 +10,12 @@
import GuideContents from './_GuideContents.html';
import Icon from '../../components/Icon.html';
- // NOT YET
- // get offset from css-vars (for smooth-scroll)
- // import CustomProperties from '../../utils/css-custom-properties.js'
-
export let sections;
let active_section;
let container;
let aside;
+ let show_contents = false;
onMount(() => {
const anchors = container.querySelectorAll('[id]');
@@ -75,65 +72,130 @@