Make TOC sticky on guides

pull/7804/head
Kamran Ahmed 2 months ago
parent addf973c81
commit 266d357e2a
  1. 2
      src/components/Guide/GuideContent.astro

@ -22,7 +22,7 @@ const { frontmatter: guideFrontmatter, author } = guide;
<article class='lg:grid lg:max-w-full lg:grid-cols-[1fr_minmax(0,700px)_1fr]'> <article class='lg:grid lg:max-w-full lg:grid-cols-[1fr_minmax(0,700px)_1fr]'>
{ {
(showTableOfContent || showRelatedGuides) && ( (showTableOfContent || showRelatedGuides) && (
<div class='bg-gradient-to-r from-gray-50 py-0 lg:col-start-3 lg:col-end-4 lg:row-start-1'> <div class='sticky top-0 lg:relative bg-gradient-to-r from-gray-50 py-0 lg:col-start-3 lg:col-end-4 lg:row-start-1'>
<RelatedGuides <RelatedGuides
relatedTitle={guideFrontmatter?.relatedTitle} relatedTitle={guideFrontmatter?.relatedTitle}
relatedGuides={guide?.relatedGuides || {}} relatedGuides={guide?.relatedGuides || {}}

Loading…
Cancel
Save