[{"data":1,"prerenderedAt":2238},["ShallowReactive",2],{"page-\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fscroll-margin-and-scroll-padding-for-sticky-headers\u002F":3,"content-all-pages":1674,"live-demo:snap-scroll-padding-header":2232},{"id":4,"title":5,"body":6,"description":1652,"extension":1653,"meta":1654,"navigation":362,"path":1670,"seo":1671,"stem":1672,"__hash__":1673},"content\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fscroll-margin-and-scroll-padding-for-sticky-headers\u002Findex.md","scroll-margin and scroll-padding: Keeping Targets Clear of Sticky Headers",{"type":7,"value":8,"toc":1642},"minimark",[9,22,42,47,59,68,165,171,175,182,186,196,1069,1086,1090,1093,1152,1171,1186,1190,1193,1256,1270,1275,1279,1282,1480,1495,1508,1512,1530,1534,1555,1567,1595,1607,1611,1639],[10,11,13,17,18,21],"h1",{"id":12},"scroll-margin-and-scroll-padding-keeping-targets-clear-of-sticky-headers",[14,15,16],"code",{},"scroll-margin"," and ",[14,19,20],{},"scroll-padding",": Keeping Targets Clear of Sticky Headers",[23,24,25,26,17,28,30,31,36,37,41],"p",{},"A page with a sticky header has a quiet usability bug. Click a table-of-contents link and the target heading scrolls to the very top of the viewport — directly under the header, so the reader sees the paragraph below it and wonders whether the link worked. Tab through a long form and each focused field scrolls to the top edge, hidden behind the same header, so keyboard users cannot see what they are typing into. Both problems have the same one-line fix, and it is one of the least-known properties in CSS. This page explains ",[14,27,20],{},[14,29,16],{},", which one to use when, and how they interact with every way a page scrolls to an element. It belongs to ",[32,33,35],"a",{"href":34},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002F","Scroll Snap & Overflow Layouts"," in the ",[32,38,40],{"href":39},"\u002Fmastering-container-queries-responsive-layouts\u002F","Mastering Container Queries & Responsive Layouts"," guide.",[43,44,46],"h2",{"id":45},"why-the-browser-puts-targets-under-the-header","Why the browser puts targets under the header",[23,48,49,50,53,54,58],{},"When the browser scrolls an element into view — for a fragment link, a focus change, ",[14,51,52],{},"element.scrollIntoView()",", or find-in-page — it computes a target position that aligns the element with the edge of the scroll container's ",[55,56,57],"em",{},"snapport",". By default the snapport is the whole visible area of the scroller, so \"align to the top\" means the element's top edge meets the viewport's top edge.",[23,60,61,62,64,65,67],{},"A sticky or fixed header occupies the top of that visible area, but the browser has no idea it is there: positioning is a visual matter, and scrolling logic does not consult it. The two properties on this page give the scrolling logic the information it is missing. ",[14,63,20],{}," shrinks the snapport from the scroll container's side. ",[14,66,16],{}," enlarges each target's alignment box from the element's side.",[69,70,76,77,76,81,76,85,76,93,76,101,76,109,76,115,76,120,76,129,76,133,76,138,76,141,76,144,76,147,76,153,76,156,76,159,76,162],"svg",{"viewBox":71,"role":72,"ariaLabel":73,"xmlns":74,"style":75},"0 0 720 320","img","Two viewports: without scroll-padding the target heading lands under the sticky header; with scroll-padding-top it lands just below it","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[78,79,80],"title",{},"Fragment navigation with and without scroll-padding",[82,83,84],"desc",{},"Left, the target heading's top aligns with the viewport top and is hidden behind the sticky header. Right, scroll-padding-top equal to the header height moves the snapport's top edge down, so the heading lands below the header.",[86,87,92],"text",{"textAnchor":88,"x":89,"y":90,"style":91},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","Where #section-3 lands after clicking its link",[94,95],"path",{"d":96,"fill":97,"stroke":98,"strokeWidth":99,"opacity":100},"M60 50 H320 V290 H60 Z","none","currentColor","2","0.7",[102,103],"rect",{"x":104,"y":105,"width":106,"height":107,"fill":98,"opacity":108},"62","52","256","44","0.25",[86,110,114],{"textAnchor":88,"x":111,"y":112,"style":113},"190","79","text-anchor:middle;fill:currentColor;font:600 12px sans-serif","sticky header",[86,116,119],{"textAnchor":88,"x":111,"y":117,"style":118},"124","text-anchor:middle;fill:currentColor;font:12px sans-serif","heading hidden above this line",[102,121],{"x":122,"y":123,"width":124,"height":125,"rx":126,"fill":127,"opacity":128},"80","140","220","60","4","#7aa2ff","0.16",[86,130,132],{"textAnchor":88,"x":111,"y":131,"style":118},"175","paragraph after it",[86,134,137],{"textAnchor":88,"x":111,"y":135,"style":136},"312","text-anchor:middle;fill:currentColor;font:12px ui-monospace,monospace","no scroll-padding",[94,139],{"d":140,"fill":97,"stroke":98,"strokeWidth":99,"opacity":100},"M400 50 H660 V290 H400 Z",[102,142],{"x":143,"y":105,"width":106,"height":107,"fill":98,"opacity":108},"402",[86,145,114],{"textAnchor":88,"x":146,"y":112,"style":113},"530",[102,148],{"x":149,"y":150,"width":124,"height":151,"rx":126,"fill":127,"opacity":152},"420","104","30","0.45",[86,154,155],{"textAnchor":88,"x":146,"y":117,"style":113},"#section-3 heading",[102,157],{"x":149,"y":158,"width":124,"height":125,"rx":126,"fill":127,"opacity":128},"142",[86,160,132],{"textAnchor":88,"x":146,"y":161,"style":118},"177",[86,163,164],{"textAnchor":88,"x":146,"y":135,"style":136},"scroll-padding-top: header",[23,166,167,168,170],{},"The keyboard case is the one that makes this an accessibility requirement rather than polish. WCAG 2.4.11 Focus Not Obscured (Minimum), added in WCAG 2.2, requires that a focused component is not entirely hidden by author-created content such as a sticky header. ",[14,169,20],{}," is the most direct way to meet it for scrolling caused by focus changes.",[43,172,174],{"id":173},"the-complete-implementation","The complete implementation",[23,176,177,178,181],{},"The demo reproduces the bug and the fix side by side. Each panel is a small scrolling page with a sticky header; only the right-hand one sets ",[14,179,180],{},"scroll-padding-top",". Click the same link in both.",[183,184],"live-demo",{"name":185},"snap-scroll-padding-header",[23,187,188,189,191,192,195],{},"The full page below keeps the header height in one custom property and uses it in three places: the header's own height, the root scroller's ",[14,190,180],{},", and a slightly larger ",[14,193,194],{},"scroll-margin-top"," on headings so they breathe below the header.",[197,198,203],"pre",{"className":199,"code":200,"language":201,"meta":202,"style":202},"language-html shiki shiki-themes github-light-high-contrast github-dark-high-contrast","\u003C!doctype html>\n\u003Chtml lang=\"en\">\n\u003Chead>\n\u003Cmeta charset=\"utf-8\">\n\u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\u003Ctitle>Sticky header offsets\u003C\u002Ftitle>\n\u003Cstyle>\n  :root {\n    --header-h: 3.5rem;\n  }\n\n  \u002F* The ROOT element is the document scroller, so scroll-padding goes\n     here, not on body. Every scroll-into-view now treats the top\n     3.5rem as off limits: fragment links, focus, scrollIntoView(). *\u002F\n  html {\n    scroll-padding-top: var(--header-h);\n  }\n\n  @media (prefers-reduced-motion: no-preference) {\n    html { scroll-behavior: smooth; }\n  }\n\n  body { margin: 0; font: 16px\u002F1.6 system-ui, sans-serif; }\n\n  .site-header {\n    position: sticky;\n    top: 0;\n    z-index: 10;\n    height: var(--header-h);\n    display: flex;\n    align-items: center;\n    padding-inline: 1rem;\n    background: #0f172a;\n    color: #f8fafc;\n  }\n\n  main { max-width: 42rem; margin: 0 auto; padding: 1rem; }\n\n  \u002F* Headings get a little extra room on top of the padding, so the\n     heading does not sit flush against the header's bottom edge.\n     scroll-margin ADDS to scroll-padding for this target. *\u002F\n  main h2 {\n    scroll-margin-top: 0.75rem;\n  }\n\n  \u002F* Highlight the fragment target briefly so readers can see where\n     they landed; the highlight is static under reduced motion. *\u002F\n  main h2:target {\n    background: #fef3c7;\n  }\n\u003C\u002Fstyle>\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Cheader class=\"site-header\">Handbook\u003C\u002Fheader>\n  \u003Cmain>\n    \u003Cnav aria-label=\"On this page\">\n      \u003Ca href=\"#setup\">Setup\u003C\u002Fa> · \u003Ca href=\"#usage\">Usage\u003C\u002Fa> · \u003Ca href=\"#faq\">FAQ\u003C\u002Fa>\n    \u003C\u002Fnav>\n    \u003Ch2 id=\"setup\">Setup\u003C\u002Fh2>\n    \u003Cp>Long content…\u003C\u002Fp>\n    \u003Ch2 id=\"usage\">Usage\u003C\u002Fh2>\n    \u003Cp>Long content…\u003C\u002Fp>\n    \u003Ch2 id=\"faq\">FAQ\u003C\u002Fh2>\n    \u003Cp>Long content…\u003C\u002Fp>\n  \u003C\u002Fmain>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n","html","",[14,204,205,225,245,255,273,298,312,322,331,351,357,364,371,377,383,391,411,416,421,430,450,455,460,507,512,520,533,545,558,574,587,600,615,628,641,646,651,693,698,704,710,716,726,741,746,751,757,763,775,787,792,802,811,821,845,855,874,930,940,961,975,995,1008,1028,1041,1051,1060],{"__ignoreMap":202},[206,207,210,214,218,222],"span",{"class":208,"line":209},"line",1,[206,211,213],{"class":212},"suds8","\u003C!",[206,215,217],{"class":216},"sne4z","doctype",[206,219,221],{"class":220},"s-5SL"," html",[206,223,224],{"class":212},">\n",[206,226,228,231,233,236,239,243],{"class":208,"line":227},2,[206,229,230],{"class":212},"\u003C",[206,232,201],{"class":216},[206,234,235],{"class":220}," lang",[206,237,238],{"class":212},"=",[206,240,242],{"class":241},"sT6z2","\"en\"",[206,244,224],{"class":212},[206,246,248,250,253],{"class":208,"line":247},3,[206,249,230],{"class":212},[206,251,252],{"class":216},"head",[206,254,224],{"class":212},[206,256,258,260,263,266,268,271],{"class":208,"line":257},4,[206,259,230],{"class":212},[206,261,262],{"class":216},"meta",[206,264,265],{"class":220}," charset",[206,267,238],{"class":212},[206,269,270],{"class":241},"\"utf-8\"",[206,272,224],{"class":212},[206,274,276,278,280,283,285,288,291,293,296],{"class":208,"line":275},5,[206,277,230],{"class":212},[206,279,262],{"class":216},[206,281,282],{"class":220}," name",[206,284,238],{"class":212},[206,286,287],{"class":241},"\"viewport\"",[206,289,290],{"class":220}," content",[206,292,238],{"class":212},[206,294,295],{"class":241},"\"width=device-width, initial-scale=1\"",[206,297,224],{"class":212},[206,299,301,303,305,308,310],{"class":208,"line":300},6,[206,302,230],{"class":212},[206,304,78],{"class":216},[206,306,307],{"class":212},">Sticky header offsets\u003C\u002F",[206,309,78],{"class":216},[206,311,224],{"class":212},[206,313,315,317,320],{"class":208,"line":314},7,[206,316,230],{"class":212},[206,318,319],{"class":216},"style",[206,321,224],{"class":212},[206,323,325,328],{"class":208,"line":324},8,[206,326,327],{"class":220},"  :root",[206,329,330],{"class":212}," {\n",[206,332,334,338,341,344,348],{"class":208,"line":333},9,[206,335,337],{"class":336},"soyes","    --header-h",[206,339,340],{"class":212},": ",[206,342,343],{"class":220},"3.5",[206,345,347],{"class":346},"sHUrx","rem",[206,349,350],{"class":212},";\n",[206,352,354],{"class":208,"line":353},10,[206,355,356],{"class":212},"  }\n",[206,358,360],{"class":208,"line":359},11,[206,361,363],{"emptyLinePlaceholder":362},true,"\n",[206,365,367],{"class":208,"line":366},12,[206,368,370],{"class":369},"sLBg1","  \u002F* The ROOT element is the document scroller, so scroll-padding goes\n",[206,372,374],{"class":208,"line":373},13,[206,375,376],{"class":369},"     here, not on body. Every scroll-into-view now treats the top\n",[206,378,380],{"class":208,"line":379},14,[206,381,382],{"class":369},"     3.5rem as off limits: fragment links, focus, scrollIntoView(). *\u002F\n",[206,384,386,389],{"class":208,"line":385},15,[206,387,388],{"class":216},"  html",[206,390,330],{"class":212},[206,392,394,397,399,402,405,408],{"class":208,"line":393},16,[206,395,396],{"class":220},"    scroll-padding-top",[206,398,340],{"class":212},[206,400,401],{"class":220},"var",[206,403,404],{"class":212},"(",[206,406,407],{"class":336},"--header-h",[206,409,410],{"class":212},");\n",[206,412,414],{"class":208,"line":413},17,[206,415,356],{"class":212},[206,417,419],{"class":208,"line":418},18,[206,420,363],{"emptyLinePlaceholder":362},[206,422,424,427],{"class":208,"line":423},19,[206,425,426],{"class":346},"  @media",[206,428,429],{"class":212}," (prefers-reduced-motion: no-preference) {\n",[206,431,433,436,439,442,444,447],{"class":208,"line":432},20,[206,434,435],{"class":216},"    html",[206,437,438],{"class":212}," { ",[206,440,441],{"class":220},"scroll-behavior",[206,443,340],{"class":212},[206,445,446],{"class":220},"smooth",[206,448,449],{"class":212},"; }\n",[206,451,453],{"class":208,"line":452},21,[206,454,356],{"class":212},[206,456,458],{"class":208,"line":457},22,[206,459,363],{"emptyLinePlaceholder":362},[206,461,463,466,468,471,473,476,479,482,484,487,490,493,496,499,502,505],{"class":208,"line":462},23,[206,464,465],{"class":216},"  body",[206,467,438],{"class":212},[206,469,470],{"class":220},"margin",[206,472,340],{"class":212},[206,474,475],{"class":220},"0",[206,477,478],{"class":212},"; ",[206,480,481],{"class":220},"font",[206,483,340],{"class":212},[206,485,486],{"class":220},"16",[206,488,489],{"class":346},"px",[206,491,492],{"class":212},"\u002F",[206,494,495],{"class":220},"1.6",[206,497,498],{"class":220}," system-ui",[206,500,501],{"class":212},", ",[206,503,504],{"class":220},"sans-serif",[206,506,449],{"class":212},[206,508,510],{"class":208,"line":509},24,[206,511,363],{"emptyLinePlaceholder":362},[206,513,515,518],{"class":208,"line":514},25,[206,516,517],{"class":220},"  .site-header",[206,519,330],{"class":212},[206,521,523,526,528,531],{"class":208,"line":522},26,[206,524,525],{"class":220},"    position",[206,527,340],{"class":212},[206,529,530],{"class":220},"sticky",[206,532,350],{"class":212},[206,534,536,539,541,543],{"class":208,"line":535},27,[206,537,538],{"class":220},"    top",[206,540,340],{"class":212},[206,542,475],{"class":220},[206,544,350],{"class":212},[206,546,548,551,553,556],{"class":208,"line":547},28,[206,549,550],{"class":220},"    z-index",[206,552,340],{"class":212},[206,554,555],{"class":220},"10",[206,557,350],{"class":212},[206,559,561,564,566,568,570,572],{"class":208,"line":560},29,[206,562,563],{"class":220},"    height",[206,565,340],{"class":212},[206,567,401],{"class":220},[206,569,404],{"class":212},[206,571,407],{"class":336},[206,573,410],{"class":212},[206,575,577,580,582,585],{"class":208,"line":576},30,[206,578,579],{"class":220},"    display",[206,581,340],{"class":212},[206,583,584],{"class":220},"flex",[206,586,350],{"class":212},[206,588,590,593,595,598],{"class":208,"line":589},31,[206,591,592],{"class":220},"    align-items",[206,594,340],{"class":212},[206,596,597],{"class":220},"center",[206,599,350],{"class":212},[206,601,603,606,608,611,613],{"class":208,"line":602},32,[206,604,605],{"class":220},"    padding-inline",[206,607,340],{"class":212},[206,609,610],{"class":220},"1",[206,612,347],{"class":346},[206,614,350],{"class":212},[206,616,618,621,623,626],{"class":208,"line":617},33,[206,619,620],{"class":220},"    background",[206,622,340],{"class":212},[206,624,625],{"class":220},"#0f172a",[206,627,350],{"class":212},[206,629,631,634,636,639],{"class":208,"line":630},34,[206,632,633],{"class":220},"    color",[206,635,340],{"class":212},[206,637,638],{"class":220},"#f8fafc",[206,640,350],{"class":212},[206,642,644],{"class":208,"line":643},35,[206,645,356],{"class":212},[206,647,649],{"class":208,"line":648},36,[206,650,363],{"emptyLinePlaceholder":362},[206,652,654,657,659,662,664,667,669,671,673,675,677,680,682,685,687,689,691],{"class":208,"line":653},37,[206,655,656],{"class":216},"  main",[206,658,438],{"class":212},[206,660,661],{"class":220},"max-width",[206,663,340],{"class":212},[206,665,666],{"class":220},"42",[206,668,347],{"class":346},[206,670,478],{"class":212},[206,672,470],{"class":220},[206,674,340],{"class":212},[206,676,475],{"class":220},[206,678,679],{"class":220}," auto",[206,681,478],{"class":212},[206,683,684],{"class":220},"padding",[206,686,340],{"class":212},[206,688,610],{"class":220},[206,690,347],{"class":346},[206,692,449],{"class":212},[206,694,696],{"class":208,"line":695},38,[206,697,363],{"emptyLinePlaceholder":362},[206,699,701],{"class":208,"line":700},39,[206,702,703],{"class":369},"  \u002F* Headings get a little extra room on top of the padding, so the\n",[206,705,707],{"class":208,"line":706},40,[206,708,709],{"class":369},"     heading does not sit flush against the header's bottom edge.\n",[206,711,713],{"class":208,"line":712},41,[206,714,715],{"class":369},"     scroll-margin ADDS to scroll-padding for this target. *\u002F\n",[206,717,719,721,724],{"class":208,"line":718},42,[206,720,656],{"class":216},[206,722,723],{"class":216}," h2",[206,725,330],{"class":212},[206,727,729,732,734,737,739],{"class":208,"line":728},43,[206,730,731],{"class":220},"    scroll-margin-top",[206,733,340],{"class":212},[206,735,736],{"class":220},"0.75",[206,738,347],{"class":346},[206,740,350],{"class":212},[206,742,744],{"class":208,"line":743},44,[206,745,356],{"class":212},[206,747,749],{"class":208,"line":748},45,[206,750,363],{"emptyLinePlaceholder":362},[206,752,754],{"class":208,"line":753},46,[206,755,756],{"class":369},"  \u002F* Highlight the fragment target briefly so readers can see where\n",[206,758,760],{"class":208,"line":759},47,[206,761,762],{"class":369},"     they landed; the highlight is static under reduced motion. *\u002F\n",[206,764,766,768,770,773],{"class":208,"line":765},48,[206,767,656],{"class":216},[206,769,723],{"class":216},[206,771,772],{"class":220},":target",[206,774,330],{"class":212},[206,776,778,780,782,785],{"class":208,"line":777},49,[206,779,620],{"class":220},[206,781,340],{"class":212},[206,783,784],{"class":220},"#fef3c7",[206,786,350],{"class":212},[206,788,790],{"class":208,"line":789},50,[206,791,356],{"class":212},[206,793,795,798,800],{"class":208,"line":794},51,[206,796,797],{"class":212},"\u003C\u002F",[206,799,319],{"class":216},[206,801,224],{"class":212},[206,803,805,807,809],{"class":208,"line":804},52,[206,806,797],{"class":212},[206,808,252],{"class":216},[206,810,224],{"class":212},[206,812,814,816,819],{"class":208,"line":813},53,[206,815,230],{"class":212},[206,817,818],{"class":216},"body",[206,820,224],{"class":212},[206,822,824,827,830,833,835,838,841,843],{"class":208,"line":823},54,[206,825,826],{"class":212},"  \u003C",[206,828,829],{"class":216},"header",[206,831,832],{"class":220}," class",[206,834,238],{"class":212},[206,836,837],{"class":241},"\"site-header\"",[206,839,840],{"class":212},">Handbook\u003C\u002F",[206,842,829],{"class":216},[206,844,224],{"class":212},[206,846,848,850,853],{"class":208,"line":847},55,[206,849,826],{"class":212},[206,851,852],{"class":216},"main",[206,854,224],{"class":212},[206,856,858,861,864,867,869,872],{"class":208,"line":857},56,[206,859,860],{"class":212},"    \u003C",[206,862,863],{"class":216},"nav",[206,865,866],{"class":220}," aria-label",[206,868,238],{"class":212},[206,870,871],{"class":241},"\"On this page\"",[206,873,224],{"class":212},[206,875,877,880,882,885,887,890,893,895,898,900,902,904,907,910,912,914,916,918,920,923,926,928],{"class":208,"line":876},57,[206,878,879],{"class":212},"      \u003C",[206,881,32],{"class":216},[206,883,884],{"class":220}," href",[206,886,238],{"class":212},[206,888,889],{"class":241},"\"#setup\"",[206,891,892],{"class":212},">Setup\u003C\u002F",[206,894,32],{"class":216},[206,896,897],{"class":212},"> · \u003C",[206,899,32],{"class":216},[206,901,884],{"class":220},[206,903,238],{"class":212},[206,905,906],{"class":241},"\"#usage\"",[206,908,909],{"class":212},">Usage\u003C\u002F",[206,911,32],{"class":216},[206,913,897],{"class":212},[206,915,32],{"class":216},[206,917,884],{"class":220},[206,919,238],{"class":212},[206,921,922],{"class":241},"\"#faq\"",[206,924,925],{"class":212},">FAQ\u003C\u002F",[206,927,32],{"class":216},[206,929,224],{"class":212},[206,931,933,936,938],{"class":208,"line":932},58,[206,934,935],{"class":212},"    \u003C\u002F",[206,937,863],{"class":216},[206,939,224],{"class":212},[206,941,943,945,947,950,952,955,957,959],{"class":208,"line":942},59,[206,944,860],{"class":212},[206,946,43],{"class":216},[206,948,949],{"class":220}," id",[206,951,238],{"class":212},[206,953,954],{"class":241},"\"setup\"",[206,956,892],{"class":212},[206,958,43],{"class":216},[206,960,224],{"class":212},[206,962,964,966,968,971,973],{"class":208,"line":963},60,[206,965,860],{"class":212},[206,967,23],{"class":216},[206,969,970],{"class":212},">Long content…\u003C\u002F",[206,972,23],{"class":216},[206,974,224],{"class":212},[206,976,978,980,982,984,986,989,991,993],{"class":208,"line":977},61,[206,979,860],{"class":212},[206,981,43],{"class":216},[206,983,949],{"class":220},[206,985,238],{"class":212},[206,987,988],{"class":241},"\"usage\"",[206,990,909],{"class":212},[206,992,43],{"class":216},[206,994,224],{"class":212},[206,996,998,1000,1002,1004,1006],{"class":208,"line":997},62,[206,999,860],{"class":212},[206,1001,23],{"class":216},[206,1003,970],{"class":212},[206,1005,23],{"class":216},[206,1007,224],{"class":212},[206,1009,1011,1013,1015,1017,1019,1022,1024,1026],{"class":208,"line":1010},63,[206,1012,860],{"class":212},[206,1014,43],{"class":216},[206,1016,949],{"class":220},[206,1018,238],{"class":212},[206,1020,1021],{"class":241},"\"faq\"",[206,1023,925],{"class":212},[206,1025,43],{"class":216},[206,1027,224],{"class":212},[206,1029,1031,1033,1035,1037,1039],{"class":208,"line":1030},64,[206,1032,860],{"class":212},[206,1034,23],{"class":216},[206,1036,970],{"class":212},[206,1038,23],{"class":216},[206,1040,224],{"class":212},[206,1042,1044,1047,1049],{"class":208,"line":1043},65,[206,1045,1046],{"class":212},"  \u003C\u002F",[206,1048,852],{"class":216},[206,1050,224],{"class":212},[206,1052,1054,1056,1058],{"class":208,"line":1053},66,[206,1055,797],{"class":212},[206,1057,818],{"class":216},[206,1059,224],{"class":212},[206,1061,1063,1065,1067],{"class":208,"line":1062},67,[206,1064,797],{"class":212},[206,1066,201],{"class":216},[206,1068,224],{"class":212},[23,1070,1071,1072,1075,1076,1078,1079,1082,1083,1085],{},"The division of labour is the lesson. The header covers the same strip of the viewport for ",[55,1073,1074],{},"every"," target, so its height belongs on the scroller as ",[14,1077,20],{},", set once. The extra breathing room is a property of ",[55,1080,1081],{},"headings"," specifically — form fields do not need it — so it belongs on the targets as ",[14,1084,16],{},".",[43,1087,1089],{"id":1088},"the-key-technique-padding-on-the-scroller-margin-on-the-target","The key technique: padding on the scroller, margin on the target",[23,1091,1092],{},"The two properties sound symmetrical and are easy to confuse. The diagram shows where each one acts.",[69,1094,76,1097,76,1100,76,1103,76,1106,76,1109,76,1115,76,1119,76,1124,76,1129,76,1132,76,1137,76,1144,76,1148],{"viewBox":1095,"role":72,"ariaLabel":1096,"xmlns":74,"style":75},"0 0 720 300","Scroll-padding shrinks the scroller's snapport; scroll-margin grows the target's alignment box; the two offsets add",[78,1098,1099],{},"Two offsets that add together",[82,1101,1102],{},"A scroll container whose snapport starts below a scroll-padding strip. A target whose alignment box starts above it by its scroll-margin. The alignment box's top meets the snapport's top, so the element sits padding plus margin below the scroller's edge.",[86,1104,1105],{"textAnchor":88,"x":89,"y":90,"style":91},"Final gap = scroll-padding + scroll-margin",[94,1107],{"d":1108,"fill":97,"stroke":98,"strokeWidth":99,"opacity":100},"M120 50 H600 V280 H120 Z",[102,1110],{"x":1111,"y":105,"width":1112,"height":1113,"fill":98,"opacity":1114},"122","476","50","0.18",[86,1116,1118],{"textAnchor":88,"x":89,"y":1117,"style":136},"82","scroll-padding-top (on the scroller)",[102,1120],{"x":1121,"y":1122,"width":89,"height":1123,"fill":127,"opacity":1114},"180","102","24",[86,1125,1128],{"textAnchor":88,"x":89,"y":1126,"style":1127},"119","text-anchor:middle;fill:currentColor;font:11px ui-monospace,monospace","scroll-margin-top (on the target)",[102,1130],{"x":1121,"y":1131,"width":89,"height":107,"rx":126,"fill":127,"opacity":152},"126",[86,1133,1136],{"textAnchor":88,"x":89,"y":1134,"style":1135},"153","text-anchor:middle;fill:currentColor;font:600 13px sans-serif","target element",[86,1138,1143],{"textAnchor":1139,"x":1140,"y":1141,"style":1142},"end","110","106","text-anchor:end;fill:currentColor;font:11px sans-serif","snapport top",[86,1145,1147],{"textAnchor":88,"x":89,"y":1146,"style":118},"230","Padding: same for every target.",[86,1149,1151],{"textAnchor":88,"x":89,"y":1150,"style":118},"252","Margin: per target, for exceptions.",[23,1153,1154,1155,501,1157,501,1160,1163,1164,1166,1167,1170],{},"Both properties come in physical and logical longhands — ",[14,1156,180],{},[14,1158,1159],{},"scroll-padding-block-start",[14,1161,1162],{},"scroll-margin-inline"," and so on — and both accept lengths and percentages. ",[14,1165,20],{}," also accepts ",[14,1168,1169],{},"auto",", which lets the browser pick a value; in practice explicit values are more predictable. Neither property has any effect on layout: they change only where scrolling operations stop, never the size or position of boxes.",[23,1172,1173,1174,1178,1179,1182,1183,1185],{},"The same properties serve ",[32,1175,1177],{"href":1176},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap\u002F","scroll snap",". Snap alignment is computed against the snapport too, so a carousel's ",[14,1180,1181],{},"scroll-padding-inline"," decides where slides come to rest, and a slide's ",[14,1184,1162],{}," can offset an individual slide. One concept — the snapport — covers snapping, fragment navigation and focus scrolling alike.",[43,1187,1189],{"id":1188},"every-way-a-page-scrolls-to-an-element","Every way a page scrolls to an element",[23,1191,1192],{},"It is worth listing the triggers explicitly, because teams often test the fragment-link case, see it fixed, and assume the job is done. The snapport rules apply to all of these:",[1194,1195,1196,1208,1214,1230,1236,1246],"ul",{},[1197,1198,1199,1203,1204,1207],"li",{},[1200,1201,1202],"strong",{},"Fragment navigation."," Clicking ",[14,1205,1206],{},"\u003Ca href=\"#usage\">",", loading a URL with a hash, or using the browser's back button to return to a fragment.",[1197,1209,1210,1213],{},[1200,1211,1212],{},"Sequential focus navigation."," Tabbing to a link, button or field that is outside the visible area, and the browser scrolling it into view.",[1197,1215,1216,1219,1220,501,1222,1225,1226,1229],{},[1200,1217,1218],{},"Programmatic scrolling."," ",[14,1221,52],{},[14,1223,1224],{},"element.focus()"," without ",[14,1227,1228],{},"preventScroll",", and framework router helpers that call them.",[1197,1231,1232,1235],{},[1200,1233,1234],{},"Find in page."," The browser scrolls each match into view when the user searches with Ctrl+F or Cmd+F.",[1197,1237,1238,1241,1242,1245],{},[1200,1239,1240],{},"Text fragments."," Links of the form ",[14,1243,1244],{},"#:~:text=phrase",", which search engines and share sheets generate, scroll the highlighted text into view.",[1197,1247,1248,1251,1252,1255],{},[1200,1249,1250],{},"Snap settling."," When ",[14,1253,1254],{},"scroll-snap-type"," is set on the scroller, resting positions after a gesture use the same snapport.",[23,1257,1258,1259,1261,1262,1265,1266,1269],{},"Because a single declaration on the scroller covers all six, ",[14,1260,20],{}," is one of the highest-value, lowest-risk properties you can add to a site with a sticky header. The only case it cannot help is scrolling that the page performs with explicit coordinates — ",[14,1263,1264],{},"window.scrollTo(0, y)"," — because there is no target element to align. Code that computes scroll positions manually should subtract the header height itself, or better, be rewritten to use ",[14,1267,1268],{},"scrollIntoView()"," so it inherits the CSS offset.",[23,1271,1272,1273,1085],{},"Test the focus case deliberately: open a long form, click into the last field, then press Shift+Tab repeatedly while watching each field scroll into view. Every focused field should appear fully below the header. If one does not, check whether an ancestor between it and the root is itself a scroll container, which would need its own ",[14,1274,20],{},[43,1276,1278],{"id":1277},"variation-headers-that-change-height","Variation: headers that change height",[23,1280,1281],{},"Real headers are rarely a single fixed height. They grow a second row on narrow screens, shrink on scroll, or gain an announcement banner. Tie every dependant to the same custom property and update the property wherever the height changes.",[197,1283,1287],{"className":1284,"code":1285,"language":1286,"meta":202,"style":202},"language-css shiki shiki-themes github-light-high-contrast github-dark-high-contrast",":root { --header-h: 3.5rem; }\n\n\u002F* Two-row header on narrow screens: one variable change updates the\n   header, the scroll offset and anything else that depends on it. *\u002F\n@media (width \u003C 40rem) {\n  :root { --header-h: 6rem; }\n}\n\n\u002F* An announcement banner above the header, only while it exists. *\u002F\n:root:has(.announcement:not([hidden])) {\n  --header-h: calc(3.5rem + 2.5rem);\n}\n\nhtml { scroll-padding-top: calc(var(--header-h) + 0.5rem); }\n.site-header { min-height: var(--header-h); }\n","css",[14,1288,1289,1306,1310,1315,1320,1342,1359,1364,1368,1373,1392,1418,1422,1426,1460],{"__ignoreMap":202},[206,1290,1291,1294,1296,1298,1300,1302,1304],{"class":208,"line":209},[206,1292,1293],{"class":220},":root",[206,1295,438],{"class":212},[206,1297,407],{"class":336},[206,1299,340],{"class":212},[206,1301,343],{"class":220},[206,1303,347],{"class":346},[206,1305,449],{"class":212},[206,1307,1308],{"class":208,"line":227},[206,1309,363],{"emptyLinePlaceholder":362},[206,1311,1312],{"class":208,"line":247},[206,1313,1314],{"class":369},"\u002F* Two-row header on narrow screens: one variable change updates the\n",[206,1316,1317],{"class":208,"line":257},[206,1318,1319],{"class":369},"   header, the scroll offset and anything else that depends on it. *\u002F\n",[206,1321,1322,1325,1328,1331,1334,1337,1339],{"class":208,"line":275},[206,1323,1324],{"class":346},"@media",[206,1326,1327],{"class":212}," (",[206,1329,1330],{"class":220},"width",[206,1332,1333],{"class":346}," \u003C",[206,1335,1336],{"class":220}," 40",[206,1338,347],{"class":346},[206,1340,1341],{"class":212},") {\n",[206,1343,1344,1346,1348,1350,1352,1355,1357],{"class":208,"line":300},[206,1345,327],{"class":220},[206,1347,438],{"class":212},[206,1349,407],{"class":336},[206,1351,340],{"class":212},[206,1353,1354],{"class":220},"6",[206,1356,347],{"class":346},[206,1358,449],{"class":212},[206,1360,1361],{"class":208,"line":314},[206,1362,1363],{"class":212},"}\n",[206,1365,1366],{"class":208,"line":324},[206,1367,363],{"emptyLinePlaceholder":362},[206,1369,1370],{"class":208,"line":333},[206,1371,1372],{"class":369},"\u002F* An announcement banner above the header, only while it exists. *\u002F\n",[206,1374,1375,1378,1380,1383,1386,1389],{"class":208,"line":353},[206,1376,1377],{"class":220},":root:has",[206,1379,404],{"class":212},[206,1381,1382],{"class":220},".announcement:not",[206,1384,1385],{"class":212},"([",[206,1387,1388],{"class":220},"hidden",[206,1390,1391],{"class":212},"])) {\n",[206,1393,1394,1397,1399,1402,1404,1406,1408,1411,1414,1416],{"class":208,"line":359},[206,1395,1396],{"class":336},"  --header-h",[206,1398,340],{"class":212},[206,1400,1401],{"class":220},"calc",[206,1403,404],{"class":212},[206,1405,343],{"class":220},[206,1407,347],{"class":346},[206,1409,1410],{"class":346}," +",[206,1412,1413],{"class":220}," 2.5",[206,1415,347],{"class":346},[206,1417,410],{"class":212},[206,1419,1420],{"class":208,"line":366},[206,1421,1363],{"class":212},[206,1423,1424],{"class":208,"line":373},[206,1425,363],{"emptyLinePlaceholder":362},[206,1427,1428,1430,1432,1434,1436,1438,1440,1442,1444,1446,1449,1452,1455,1457],{"class":208,"line":379},[206,1429,201],{"class":216},[206,1431,438],{"class":212},[206,1433,180],{"class":220},[206,1435,340],{"class":212},[206,1437,1401],{"class":220},[206,1439,404],{"class":212},[206,1441,401],{"class":220},[206,1443,404],{"class":212},[206,1445,407],{"class":336},[206,1447,1448],{"class":212},") ",[206,1450,1451],{"class":346},"+",[206,1453,1454],{"class":220}," 0.5",[206,1456,347],{"class":346},[206,1458,1459],{"class":212},"); }\n",[206,1461,1462,1465,1467,1470,1472,1474,1476,1478],{"class":208,"line":385},[206,1463,1464],{"class":220},".site-header",[206,1466,438],{"class":212},[206,1468,1469],{"class":220},"min-height",[206,1471,340],{"class":212},[206,1473,401],{"class":220},[206,1475,404],{"class":212},[206,1477,407],{"class":336},[206,1479,1459],{"class":212},[23,1481,1482,1483,1487,1488,1490,1491,1494],{},"A header that shrinks on scroll with a ",[32,1484,1486],{"href":1485},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002F","scroll-driven animation"," is the hardest case, because its height is continuous rather than stepped. Set ",[14,1489,180],{}," to the ",[55,1492,1493],{},"expanded"," height: when a fragment link scrolls far enough for the header to collapse, the target simply has a little more room than necessary, which is harmless, whereas padding for the collapsed height would hide targets under the expanded header near the top of the page.",[23,1496,1497,1498,1501,1502,1504,1505,1507],{},"For headers inside an app shell where an inner ",[14,1499,1500],{},"\u003Cmain>"," scrolls instead of the document, move ",[14,1503,20],{}," onto that inner scroller. The property must be on the element that actually scrolls, which is also why setting it on ",[14,1506,818],{}," usually does nothing.",[43,1509,1511],{"id":1510},"browser-support","Browser support",[23,1513,1514,17,1516,1518,1519,1521,1522,1525,1526,1529],{},[14,1515,20],{},[14,1517,16],{},", including all their longhands, are supported in all current versions of Chrome, Edge, Firefox and Safari, and they apply to fragment navigation, focus scrolling and ",[14,1520,1268],{}," in each. ",[14,1523,1524],{},"scroll-behavior: smooth"," is supported in Chrome 61+, Edge 79+, Firefox 36+ and Safari 15.4+. ",[14,1527,1528],{},":has()",", used for the banner variation, is supported in Chrome and Edge 105+, Firefox 121+ and Safari 15.4+.",[43,1531,1533],{"id":1532},"faq","FAQ",[23,1535,1536,1545,1546,1548,1549,1551,1552,1554],{},[1200,1537,1538,1539,1541,1542,1544],{},"Should I use ",[14,1540,20],{}," or ",[14,1543,16],{}," for a sticky header?","\nUse ",[14,1547,180],{}," on the scrolling element, usually ",[14,1550,201],{},", because the header covers the same strip for every target. Use ",[14,1553,194],{}," on individual targets only when some of them need extra or different space, such as headings that should sit a little lower.",[23,1556,1557,1563,1564,1566],{},[1200,1558,1559,1560,1562],{},"Does ",[14,1561,20],{}," affect focus scrolling from the Tab key?","\nYes. When focus moves to an element that is out of view, browsers scroll it into view using the same snapport rules, so ",[14,1565,20],{}," keeps focused inputs and links from landing under a sticky header. That makes it an accessibility fix, not just a cosmetic one.",[23,1568,1569,1578,1579,1581,1582,1584,1585,1587,1588,1590,1591,1594],{},[1200,1570,1571,1572,1574,1575,1577],{},"Why does ",[14,1573,20],{}," on ",[14,1576,818],{}," do nothing?","\nBecause the document's scroller is normally the root element, ",[14,1580,201],{},", not ",[14,1583,818],{},". ",[14,1586,20],{}," must be set on the element that actually scrolls. Set it on ",[14,1589,201],{},", or on whichever inner element has ",[14,1592,1593],{},"overflow: auto"," if the page uses an app-shell layout.",[23,1596,1597,1603,1604,1606],{},[1200,1598,1599,1600,1602],{},"How do I keep ",[14,1601,20],{}," in sync with a header whose height changes?","\nStore the header height in a custom property and use it for both the header and ",[14,1605,180],{},". If the height is only known at runtime, set the property from script when it changes; CSS will update the scroll offset automatically.",[43,1608,1610],{"id":1609},"related","Related",[1194,1612,1613,1618,1625,1632],{},[1197,1614,1615,1617],{},[32,1616,35],{"href":34}," — the parent guide to scrolling behaviour in layouts.",[1197,1619,1620,1624],{},[32,1621,1623],{"href":1622},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Foverscroll-behavior-for-nested-scrolling\u002F","overscroll-behavior for Nested Scrolling"," — the other scroller property most pages need.",[1197,1626,1627,1631],{},[32,1628,1630],{"href":1629},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fcreating-accessible-focus-indicators\u002F","Creating Accessible Focus Indicators"," — making the element that scrolled into view visibly focused.",[1197,1633,1634,1638],{},[32,1635,1637],{"href":1636},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript\u002F","Scroll Progress Bar Without JavaScript"," — scroll-linked header effects that share the same header.",[319,1640,1641],{},"html pre.shiki code .suds8, html code.shiki .suds8{--shiki-default:#0E1116;--shiki-dark:#F0F3F6}html pre.shiki code .sne4z, html code.shiki .sne4z{--shiki-default:#024C1A;--shiki-dark:#72F088}html pre.shiki code .s-5SL, html code.shiki .s-5SL{--shiki-default:#023B95;--shiki-dark:#91CBFF}html pre.shiki code .sT6z2, html code.shiki .sT6z2{--shiki-default:#032563;--shiki-dark:#ADDCFF}html pre.shiki code .soyes, html code.shiki .soyes{--shiki-default:#702C00;--shiki-dark:#FFB757}html pre.shiki code .sHUrx, html code.shiki .sHUrx{--shiki-default:#A0111F;--shiki-dark:#FF9492}html pre.shiki code .sLBg1, html code.shiki .sLBg1{--shiki-default:#66707B;--shiki-dark:#BDC4CC}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":202,"searchDepth":227,"depth":227,"links":1643},[1644,1645,1646,1647,1648,1649,1650,1651],{"id":45,"depth":227,"text":46},{"id":173,"depth":227,"text":174},{"id":1088,"depth":227,"text":1089},{"id":1188,"depth":227,"text":1189},{"id":1277,"depth":227,"text":1278},{"id":1510,"depth":227,"text":1511},{"id":1532,"depth":227,"text":1533},{"id":1609,"depth":227,"text":1610},"Stop sticky headers from covering anchor targets and focused fields: scroll-padding on the scroller, scroll-margin on targets, and how both feed scrollIntoView.","md",{"pageTitle":1655,"datePublished":1656,"dateModified":1656,"faq":1657},"scroll-margin and scroll-padding Explained","2026-09-18",[1658,1661,1664,1667],{"q":1659,"a":1660},"Should I use scroll-padding or scroll-margin for a sticky header?","Use scroll-padding-top on the scrolling element, usually html, because the header covers the same strip for every target. Use scroll-margin-top on individual targets only when some of them need extra or different space, such as headings that should sit a little lower.",{"q":1662,"a":1663},"Does scroll-padding affect focus scrolling from the Tab key?","Yes. When focus moves to an element that is out of view, browsers scroll it into view using the same snapport rules, so scroll-padding keeps focused inputs and links from landing under a sticky header. That makes it an accessibility fix, not just a cosmetic one.",{"q":1665,"a":1666},"Why does scroll-padding on body do nothing?","Because the document's scroller is normally the root element, html, not body. scroll-padding must be set on the element that actually scrolls. Set it on html, or on whichever inner element has overflow: auto if the page uses an app-shell layout.",{"q":1668,"a":1669},"How do I keep scroll-padding in sync with a header whose height changes?","Store the header height in a custom property and use it for both the header and scroll-padding-top. If the height is only known at runtime, set the property from script when it changes; CSS will update the scroll offset automatically.","\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fscroll-margin-and-scroll-padding-for-sticky-headers",{"title":5,"description":1652},"mastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fscroll-margin-and-scroll-padding-for-sticky-headers\u002Findex","WNQCLokOMa0yFcUkpfhRI12BtcHMiWan2CNS6piVauE",[1675,1678,1681,1684,1687,1690,1693,1696,1699,1702,1705,1708,1711,1714,1717,1720,1723,1726,1729,1732,1735,1738,1741,1744,1747,1750,1753,1756,1759,1762,1765,1768,1771,1774,1777,1780,1783,1786,1789,1792,1795,1798,1801,1804,1807,1810,1813,1816,1819,1822,1825,1828,1831,1834,1837,1840,1843,1846,1849,1852,1855,1858,1861,1864,1867,1870,1873,1876,1879,1882,1885,1888,1891,1894,1897,1900,1903,1906,1909,1912,1915,1918,1921,1924,1927,1930,1933,1936,1939,1942,1945,1948,1951,1954,1956,1959,1962,1965,1968,1971,1974,1977,1980,1983,1986,1989,1992,1995,1998,2001,2004,2007,2010,2013,2016,2019,2022,2025,2028,2031,2034,2037,2040,2043,2046,2049,2052,2055,2058,2061,2064,2067,2070,2073,2076,2079,2082,2085,2088,2091,2094,2096,2099,2102,2105,2108,2111,2114,2117,2120,2123,2126,2129,2132,2135,2138,2141,2144,2147,2150,2153,2156,2159,2162,2165,2168,2171,2174,2177,2180,2183,2186,2189,2192,2195,2196,2199,2202,2205,2208,2211,2214,2217,2220,2223,2226,2229],{"path":1676,"title":1677},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fcreating-accessible-focus-indicators","Creating Accessible Focus Indicators: Building a Ring That Survives Any Background",{"path":1679,"title":1680},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":1682,"title":1683},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":1685,"title":1686},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":1688,"title":1689},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fpause-controls-for-looping-animations","Pause Controls for Looping CSS Animations: Meeting WCAG 2.2.2",{"path":1691,"title":1692},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":1694,"title":1695},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Freducing-motion-preferences-in-css","Reducing Motion Preferences in CSS: How the Setting Becomes a Media Feature",{"path":1697,"title":1698},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Ftarget-size-and-pointer-accessibility","Target Size and Pointer Accessibility: Meeting 2.5.8 Without Redesigning",{"path":1700,"title":1701},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":1703,"title":1704},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":1706,"title":1707},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations\u002Fanimated-gradient-borders-with-property","Animated Gradient Borders With @property: A Spinning Highlight Without Extra Elements",{"path":1709,"title":1710},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations\u002Fclip-path-reveal-animations","Clip-Path Reveal Animations: Wipes, Irises and Corners Without Extra Markup",{"path":1712,"title":1713},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":1715,"title":1716},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations\u002Fmask-image-fade-edges","Fading Edges With mask-image: Soft Boundaries That Work on Any Background",{"path":1718,"title":1719},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations\u002Fmorphing-shapes-with-clip-path-polygon","Morphing Shapes With clip-path: polygon(): Point-Matched Transitions",{"path":1721,"title":1722},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":1724,"title":1725},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fcolor-mix-hover-states","Hover and Active States With color-mix(): One Token, Every Shade",{"path":1727,"title":1728},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":1730,"title":1731},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Flight-dark-function-for-themes","Light and Dark Themes With light-dark(): One Declaration per Colour",{"path":1733,"title":1734},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":1736,"title":1737},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":1739,"title":1740},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":1742,"title":1743},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":1745,"title":1746},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":1748,"title":1749},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-that-scales-with-container-size","Motion That Scales with Container Size: cqi, cqb, and Derived Durations",{"path":1751,"title":1752},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":1754,"title":1755},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":1757,"title":1758},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":1760,"title":1761},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":1763,"title":1764},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwhen-to-use-javascript-animation","When to Use JavaScript Instead of CSS for Animation",{"path":1766,"title":1767},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fanimating-custom-properties-with-at-property","Animating Custom Properties with @property: Typed Variables That Interpolate",{"path":1769,"title":1770},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":1772,"title":1773},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":1775,"title":1776},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":1778,"title":1779},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fregistered-properties-and-type-safety","Registered Properties and Type Safety: @property as a Contract for Design Tokens",{"path":1781,"title":1782},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":1784,"title":1785},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":1787,"title":1788},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":1790,"title":1791},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":1793,"title":1794},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":1796,"title":1797},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":1799,"title":1800},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":1802,"title":1803},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":1805,"title":1806},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":1808,"title":1809},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"path":1811,"title":1812},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":1814,"title":1815},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Finterpolate-size-for-height-auto-animation","Animating to height: auto With interpolate-size and calc-size()",{"path":1817,"title":1818},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":1820,"title":1821},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":1823,"title":1824},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":1826,"title":1827},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":1829,"title":1830},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":1832,"title":1833},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Flinear-easing-function-for-springs","Spring and Bounce Easing With linear(): Physical Motion Without JavaScript",{"path":1835,"title":1836},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fsteps-easing-for-sprite-animations","steps() Easing: Sprite Sheets, Typewriters and Other Frame-by-Frame Effects",{"path":1838,"title":1839},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":1841,"title":1842},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states","Button Press and  States",{"path":1844,"title":1845},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-visible-vs-focus-polyfill-alternatives"," vs :focus: Why It Replaced the Focus-Ring Polyfill",{"path":1847,"title":1848},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":1850,"title":1851},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fhover-intent-delays-with-transition-delay","Hover Intent Delays With transition-delay: Menus That Don't Flicker",{"path":1853,"title":1854},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":1856,"title":1857},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fpointer-and-hover-media-queries","Pointer and Hover Media Queries: Gating Affordances by Input Capability",{"path":1859,"title":1860},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fsmooth-hover-effects-without-javascript","Smooth Hover Effects Without JavaScript: CSS-Only Patterns for Modern UI",{"path":1862,"title":1863},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":1865,"title":1866},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking","Stacking Animations With animation-composition",{"path":1868,"title":1869},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-fill-mode-explained","animation-fill-mode: What an Animation Applies Before and After It Runs",{"path":1871,"title":1872},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":1874,"title":1875},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":1877,"title":1878},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-loading-spinners-and-skeletons","CSS-Only Loading Spinners and Skeleton Shimmer Screens with @keyframes",{"path":1880,"title":1881},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-toggle-switches-and-checkboxes","CSS-Only Toggle Switches and Checkboxes That Keep the Native Input",{"path":1883,"title":1884},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":1886,"title":1887},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":1889,"title":1890},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":1892,"title":1893},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply","Animating box-shadow and Filters Cheaply",{"path":1895,"title":1896},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":1898,"title":1899},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite","Layout, Paint and Composite: What Triggers What",{"path":1901,"title":1902},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":1904,"title":1905},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":1907,"title":1908},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fprofiling-animations-in-devtools","Profiling CSS Animations in DevTools: Finding the Frame That Costs Too Much",{"path":1910,"title":1911},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fwill-change-and-the-compositor-thread","will-change and the Compositor Thread: Layer Promotion Without the Footguns",{"path":1913,"title":1914},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":1916,"title":1917},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":1919,"title":1920},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects","Scroll-Driven Parallax Effects in CSS",{"path":1922,"title":1923},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":1925,"title":1926},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":1928,"title":1929},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":1931,"title":1932},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range","View Timelines and animation-range",{"path":1934,"title":1935},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":1937,"title":1938},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":1940,"title":1941},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fsame-document-view-transitions","Writing a Same-Document View Transition: the CSS You Actually Author",{"path":1943,"title":1944},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-names-shared-elements","view-transition-name and Shared Elements: Morphing a Thumbnail into a Hero",{"path":1946,"title":1947},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":1949,"title":1950},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":1952,"title":1953},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":492,"title":1955},"Modern CSS Layouts & Micro-Interactions",{"path":1957,"title":1958},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":1960,"title":1961},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":1963,"title":1964},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":1966,"title":1967},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":1969,"title":1970},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":1972,"title":1973},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":1975,"title":1976},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":1978,"title":1979},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":1981,"title":1982},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":1984,"title":1985},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":1987,"title":1988},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":1990,"title":1991},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":1993,"title":1994},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":1996,"title":1997},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-queries-inside-css-nesting","Container Queries Inside CSS Nesting: Keeping Responses Next to the Styles They Change",{"path":1999,"title":2000},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":2002,"title":2003},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-units-cqi-cqb-explained","Container Query Units Explained: cqi, cqb, cqw, cqh, cqmin and cqmax",{"path":2005,"title":2006},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":2008,"title":2009},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":2011,"title":2012},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fdebugging-container-queries-in-devtools","Debugging Container Queries in DevTools: Why a Rule Doesn't Match",{"path":2014,"title":2015},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fhow-to-use-container-queries-in-production","How to Use Container Queries in Production Without a Rewrite",{"path":2017,"title":2018},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics","Container Query Syntax Basics",{"path":2020,"title":2021},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":2023,"title":2024},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":2026,"title":2027},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fbuilding-a-dashboard-with-subgrid","Building a Responsive Dashboard Where Cards Align with Subgrid",{"path":2029,"title":2030},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":2032,"title":2033},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-template-areas-responsive-layouts","Responsive Layouts With grid-template-areas: Rearranging Regions by Name",{"path":2035,"title":2036},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fholy-grail-layout-with-grid","The Holy-Grail Layout with CSS Grid and Container Queries",{"path":2038,"title":2039},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":2041,"title":2042},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fmasonry-style-layouts-with-grid","Masonry-Style Layouts With the CSS That Ships Today",{"path":2044,"title":2045},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Foverlapping-elements-with-grid-stacking","Overlapping Elements With Grid Stacking: Layers Without position: absolute",{"path":2047,"title":2048},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":2050,"title":2051},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fcentering-in-css-every-method","Centering in CSS: Every Modern Method and When Each One Breaks",{"path":2053,"title":2054},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-basis-vs-width","flex-basis vs width: Which Size a Flex Item Actually Starts From",{"path":2056,"title":2057},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":2059,"title":2060},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":2062,"title":2063},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":2065,"title":2066},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":2068,"title":2069},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fsticky-footer-with-flexbox-and-grid","Sticky Footer With Flexbox or Grid: Pinning the Footer on Short Pages",{"path":2071,"title":2072},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fclamp-vs-media-query-typography","clamp() Fluid Type vs Media-Query Step Typography: Tradeoffs and Anatomy",{"path":2074,"title":2075},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":2077,"title":2078},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-line-height-and-measure","Fluid Line Height and Measure: Keeping Text Readable as It Scales",{"path":2080,"title":2081},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-space-scale-with-clamp","Building a Fluid Spacing Scale with clamp() and Container Units",{"path":2083,"title":2084},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":2086,"title":2087},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":2089,"title":2090},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":2092,"title":2093},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ftext-wrap-balance-and-pretty","text-wrap: balance and pretty: Better Line Breaks Without Manual Breaks",{"path":2095,"title":40},"\u002Fmastering-container-queries-responsive-layouts",{"path":2097,"title":2098},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":2100,"title":2101},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fcontent-visibility-and-contain-intrinsic-size","content-visibility and contain-intrinsic-size: Rendering Only What Is Near the Screen",{"path":2103,"title":2104},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":2106,"title":2107},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Flayout-widths-with-min-max-clamp","Layout Widths With min(), max() and clamp(): Sizing Without Breakpoints",{"path":2109,"title":2110},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":2112,"title":2113},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":2115,"title":2116},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":2118,"title":2119},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":2121,"title":2122},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":2124,"title":2125},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":2127,"title":2128},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":2130,"title":2131},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Frevert-layer-and-revert-keywords","initial, inherit, unset, revert and revert-layer: Undoing Styles Correctly",{"path":2133,"title":2134},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset","Writing a Minimal Modern CSS Reset: Every Line Justified",{"path":2136,"title":2137},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fcontent-aware-card-layouts-with-has","Content-Aware Card Layouts With :has(): One Component, Many Shapes",{"path":2139,"title":2140},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has","Empty and Loading States With ()",{"path":2142,"title":2143},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fform-validation-layouts-with-has","Form Validation Layouts With :has(): Styling Groups From Field State",{"path":2145,"title":2146},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fhas-selector-performance",":has() Selector Performance: What Is Cheap, What Is Not, and How to Measure",{"path":2148,"title":2149},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fhas-vs-container-style-queries",":has() vs Container Style Queries: Discovered State and Published State",{"path":2151,"title":2152},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"path":2154,"title":2155},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fquantity-queries-with-has","Quantity Queries With :has(): Layouts That Respond to How Many Items There Are",{"path":2157,"title":2158},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fbuilding-responsive-cards-with-container-queries","Building Responsive Cards with Container Queries: A Production-Ready Guide",{"path":2160,"title":2161},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":2163,"title":2164},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":2166,"title":2167},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":2169,"title":2170},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":2172,"title":2173},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":2175,"title":2176},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":2178,"title":2179},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":2181,"title":2182},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions","Tabs That Become an Accordion: One Component, Two Layouts",{"path":2184,"title":2185},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":2187,"title":2188},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fhorizontal-scrolling-card-rows","Horizontal Scrolling Card Rows: Swipeable Lists That Stay in Their Lane",{"path":2190,"title":2191},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":2193,"title":2194},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Foverscroll-behavior-for-nested-scrolling","overscroll-behavior: Taming Nested Scrolling, Pull-to-Refresh and Back-Swipe",{"path":1670,"title":5},{"path":2197,"title":2198},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":2200,"title":2201},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcontainer-style-query-theming","Container Style Query Theming: One Token Instead of a Variant Class Matrix",{"path":2203,"title":2204},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":2206,"title":2207},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-queries-with-custom-properties","Style Queries With Custom Properties: Declaring, Inheriting, and Matching Tokens",{"path":2209,"title":2210},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":2212,"title":2213},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-fallbacks-and-support","Style Query Fallbacks and Support: Designing for Older Browser Versions",{"path":2215,"title":2216},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fdvh-svh-lvh-mobile-viewport-units","dvh, svh and lvh: Choosing the Right Mobile Viewport Unit",{"path":2218,"title":2219},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Ffull-bleed-sections-in-constrained-layouts","Full-Bleed Sections in a Constrained Layout: Breaking Out Without Breaking the Page",{"path":2221,"title":2222},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":2224,"title":2225},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fsafe-area-insets-for-notched-screens","Safe Area Insets: Designing Around Notches, Corners and Home Indicators",{"path":2227,"title":2228},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fviewport-units-vs-container-units","Viewport Units vs Container Units: Choosing the Right Reference Box",{"path":2230,"title":2231},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":2233,"caption":2234,"height":2235,"html":2236,"css":2237},"Fragment links under a sticky header, with and without scroll-padding","Click the links in each panel: on the left the heading lands under the header; on the right scroll-padding-top keeps it visible.",300,"\n\u003Cdiv class=\"pair\">\n  \u003Cdiv class=\"page\">\n    \u003Cheader class=\"bar\">No padding · \u003Ca href=\"#a1\">A\u003C\u002Fa> \u003Ca href=\"#b1\">B\u003C\u002Fa> \u003Ca href=\"#c1\">C\u003C\u002Fa>\u003C\u002Fheader>\n    \u003Ch3 id=\"a1\">Section A\u003C\u002Fh3>\u003Cp>Text for section A. Keep scrolling to see more of the page content.\u003C\u002Fp>\n    \u003Ch3 id=\"b1\">Section B\u003C\u002Fh3>\u003Cp>Text for section B. Keep scrolling to see more of the page content.\u003C\u002Fp>\n    \u003Ch3 id=\"c1\">Section C\u003C\u002Fh3>\u003Cp>Text for section C. Keep scrolling to see more of the page content.\u003C\u002Fp>\u003Cdiv class=\"spacer\">\u003C\u002Fdiv>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"page padded\">\n    \u003Cheader class=\"bar\">Padded · \u003Ca href=\"#a2\">A\u003C\u002Fa> \u003Ca href=\"#b2\">B\u003C\u002Fa> \u003Ca href=\"#c2\">C\u003C\u002Fa>\u003C\u002Fheader>\n    \u003Ch3 id=\"a2\">Section A\u003C\u002Fh3>\u003Cp>Text for section A. Keep scrolling to see more of the page content.\u003C\u002Fp>\n    \u003Ch3 id=\"b2\">Section B\u003C\u002Fh3>\u003Cp>Text for section B. Keep scrolling to see more of the page content.\u003C\u002Fp>\n    \u003Ch3 id=\"c2\">Section C\u003C\u002Fh3>\u003Cp>Text for section C. Keep scrolling to see more of the page content.\u003C\u002Fp>\u003Cdiv class=\"spacer\">\u003C\u002Fdiv>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>","\nbody { display: block; }\n.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }\n.page { height: 240px; overflow-y: auto; border: 1px solid var(--demo-border); border-radius: 8px; }\n.page.padded { scroll-padding-top: 2.5rem; }\n.bar { position: sticky; top: 0; height: 2.5rem; display: flex; align-items: center; gap: 0.4rem; padding-inline: 0.6rem; background: #0f172a; color: #f8fafc; font-size: 0.85rem; }\n.bar a { color: #bfdbfe; }\n.page h3 { margin: 0.75rem 0.6rem 0.25rem; font-size: 1rem; }\n.page h3:target { background: #fef3c7; color: #0f172a; }\n.page p { margin: 0 0.6rem; font-size: 0.85rem; }\n.spacer { height: 200px; }",1789717746452]