{
  "id": "sticky-sidebar",
  "name": "Sticky Sidebar",
  "category": "layouts",
  "tags": [
    "sticky",
    "sidebar",
    "position sticky",
    "scroll",
    "grid",
    "toc"
  ],
  "description": "A sidebar that sticks while the content scrolls. Scroll inside the preview to see it.",
  "url": "https://copy-css.com/snippets/sticky-sidebar",
  "markdown": "https://copy-css.com/snippets/sticky-sidebar.md",
  "html": "<div class=\"sticky-layout\">\n  <aside>Sidebar</aside>\n  <main>\n    <section>Section 1</section>\n    <section>Section 2</section>\n    <section>Section 3</section>\n    <section>Section 4</section>\n  </main>\n</div>",
  "css": ".sticky-layout {\n  display: grid;\n  grid-template-columns: 220px 1fr;\n  align-items: start; /* without this, the sidebar stretches and can't stick */\n  gap: 32px;\n}\n\n.sticky-layout aside {\n  position: sticky;\n  top: 16px;\n}",
  "features": [
    "CSS Grid",
    "sticky positioning"
  ],
  "customProperties": []
}
