{
  "id": "scroll-header-shadow",
  "name": "Scroll Header Shadow",
  "category": "shadows",
  "tags": [
    "sticky header",
    "scroll-driven",
    "animation-timeline",
    "elevation",
    "panel"
  ],
  "description": "A sticky header that gains a soft shadow only once its panel scrolls, using a scroll-driven animation.",
  "url": "https://copy-css.com/snippets/scroll-header-shadow",
  "markdown": "https://copy-css.com/snippets/scroll-header-shadow.md",
  "html": "<section class=\"scroll-panel\" tabindex=\"0\" aria-label=\"Inbox\">\n  <header class=\"scroll-panel-head\">Inbox</header>\n  <p>Design review moved to 3pm</p>\n  <p>New comment on Homepage v2</p>\n  <p>Invoice #1042 was paid</p>\n  <p>Weekly report is ready</p>\n  <p>Alex shared a file with you</p>\n  <p>Your trial ends in 3 days</p>\n</section>",
  "css": ".scroll-panel {\n  width: 240px;\n  height: 170px;\n  overflow: auto;\n  border-radius: 14px;\n  background: #ffffff;\n  color: #334155;\n  font: 14px/1.4 system-ui, sans-serif;\n  box-shadow: 0 0 0 1px #e2e8f0;\n  scroll-timeline: --panel-scroll;\n}\n\n.scroll-panel:focus-visible {\n  outline: 2px solid #2563eb;\n  outline-offset: 2px;\n}\n\n.scroll-panel-head {\n  position: sticky;\n  top: 0;\n  padding: 12px 16px;\n  background: #ffffff;\n  color: #0f172a;\n  font-weight: 700;\n}\n\n.scroll-panel p {\n  margin: 0;\n  padding: 10px 16px;\n  border-top: 1px solid #f1f5f9;\n}\n\n/* Browsers without scroll-driven animations keep a flat header */\n@supports (animation-timeline: scroll()) {\n  .scroll-panel-head {\n    animation: scroll-panel-lift linear both;\n    animation-timeline: --panel-scroll;\n    animation-range: 0 24px;\n  }\n}\n\n@keyframes scroll-panel-lift {\n  to { box-shadow: 0 6px 12px -6px #0f172a40; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .scroll-panel-head { animation: none; }\n}",
  "features": [
    "scroll-driven animations",
    "keyframe animations",
    "box shadows",
    "sticky positioning",
    "keyboard focus styles",
    "reduced-motion support"
  ],
  "customProperties": []
}
