[{"data":1,"prerenderedAt":2139},["ShallowReactive",2],{"page-\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects":3,"content-all-pages":1575,"live-demo:scroll-parallax":2133},{"id":4,"title":5,"body":6,"description":1558,"extension":1559,"meta":1560,"navigation":336,"path":1571,"seo":1572,"stem":1573,"__hash__":1574},"content\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects\u002Findex.md","Scroll-Driven Parallax Effects in CSS",{"type":7,"value":8,"toc":1545},"minimark",[9,13,37,42,48,137,144,148,151,155,914,934,938,949,1005,1015,1019,1033,1156,1164,1168,1171,1379,1387,1391,1412,1422,1426,1429,1433,1445,1449,1468,1472,1485,1491,1499,1508,1512,1542],[10,11,5],"h1",{"id":12},"scroll-driven-parallax-effects-in-css",[14,15,16,17,21,22,25,26,31,32,36],"p",{},"Parallax — background layers moving more slowly than the foreground as the page scrolls — used to mean a scroll event listener that read ",[18,19,20],"code",{},"scrollY"," and wrote a transform on every frame. It was one of the most reliable ways to make a page janky: the listener ran on the main thread, competed with everything else, and fell behind the scroll the moment the page got busy. Scroll-driven animations replace the listener with a timeline the browser manages itself. A layer's ",[18,23,24],{},"translate"," is tied to its progress through the viewport, and the compositor updates it in step with scrolling. This page builds that effect, keeps it subtle, and covers the fallback and reduced-motion handling. It belongs to ",[27,28,30],"a",{"href":29},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002F","Scroll-Driven Animations"," in the ",[27,33,35],{"href":34},"\u002Fcss-only-micro-interactions-animations\u002F","CSS-Only Micro-Interactions & Animations"," guide.",[38,39,41],"h2",{"id":40},"how-the-effect-is-produced","How the effect is produced",[14,43,44,45,47],{},"Parallax is a difference in speed. When the user scrolls 100 pixels, the foreground moves 100 pixels, and a background layer that moves only 80 pixels appears farther away. With CSS you do not set speeds directly. Instead you give the background a ",[18,46,24],{}," animation that runs as the section crosses the viewport: it starts slightly pushed up and ends slightly pushed down. Across the scroll range, that downward drift subtracts from the upward scroll, so the layer drifts more slowly than its container.",[49,50,56,57,56,61,56,65,56,73,56,85,56,88,56,91,56,98,56,102,56,106,56,112,56,116,56,121,56,126,56,129,56,132],"svg",{"viewBox":51,"role":52,"ariaLabel":53,"xmlns":54,"style":55},"0 0 720 300","img","A section crossing the viewport: at entry the background layer is offset up, at exit it is offset down, so it moves more slowly than the section","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[58,59,60],"title",{},"The counter-movement that creates depth",[62,63,64],"desc",{},"Three snapshots of a section scrolling up through the viewport. At entry the background layer is shifted up by 10 percent; halfway it is centred; at exit it is shifted down by 10 percent. The section travels the full distance while the background travels less, which reads as depth.",[66,67,72],"text",{"textAnchor":68,"x":69,"y":70,"style":71},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","The layer runs against the scroll",[74,75],"rect",{"x":76,"y":77,"width":78,"height":79,"rx":80,"fill":81,"stroke":82,"strokeWidth":83,"opacity":84},"40","60","180","170","8","none","currentColor","1.5","0.6",[74,86],{"x":87,"y":77,"width":78,"height":79,"rx":80,"fill":81,"stroke":82,"strokeWidth":83,"opacity":84},"270",[74,89],{"x":90,"y":77,"width":78,"height":79,"rx":80,"fill":81,"stroke":82,"strokeWidth":83,"opacity":84},"500",[74,92],{"x":77,"y":93,"width":94,"height":77,"rx":95,"fill":96,"opacity":97},"70","140","4","#7aa2ff","0.25",[74,99],{"x":100,"y":101,"width":94,"height":77,"rx":95,"fill":96,"opacity":97},"290","115",[74,103],{"x":104,"y":105,"width":94,"height":77,"rx":95,"fill":96,"opacity":97},"520","160",[66,107,111],{"textAnchor":68,"x":108,"y":109,"style":110},"130","104","text-anchor:middle;fill:currentColor;font:12px ui-monospace,monospace","translate: 0 -10%",[66,113,115],{"textAnchor":68,"x":69,"y":114,"style":110},"149","translate: 0 0",[66,117,120],{"textAnchor":68,"x":118,"y":119,"style":110},"590","194","translate: 0 10%",[66,122,125],{"textAnchor":68,"x":108,"y":123,"style":124},"252","text-anchor:middle;fill:currentColor;font:600 12px sans-serif","section entering",[66,127,128],{"textAnchor":68,"x":69,"y":123,"style":124},"section centred",[66,130,131],{"textAnchor":68,"x":118,"y":123,"style":124},"section leaving",[66,133,136],{"textAnchor":68,"x":69,"y":134,"style":135},"284","text-anchor:middle;fill:currentColor;font:12px sans-serif","Frames are the section; the tinted block is its background layer.",[14,138,139,140,143],{},"The timeline that drives this is ",[18,141,142],{},"view()",": an anonymous view progress timeline measuring how far an element has travelled through its nearest scroll container's visible area. At 0% the element's leading edge has just entered; at 100% its trailing edge has just left.",[38,145,147],{"id":146},"the-complete-implementation","The complete implementation",[14,149,150],{},"Scroll inside the demo frame to see two layers move at different rates behind the section headings.",[152,153],"live-demo",{"name":154},"scroll-parallax",[156,157,162],"pre",{"className":158,"code":159,"language":160,"meta":161,"style":161},"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>Scroll-driven parallax\u003C\u002Ftitle>\n\u003Cstyle>\n  body { margin: 0; font: 16px\u002F1.5 system-ui, sans-serif; }\n\n  .scene {\n    position: relative;\n    min-block-size: 70vh;\n    display: grid;\n    place-items: center;\n    overflow: clip;           \u002F* hide the layer's oversized edges *\u002F\n    isolation: isolate;\n  }\n\n  .scene__layer {\n    position: absolute;\n    inset: -15% 0;            \u002F* 15% taller at each end to cover the travel *\u002F\n    z-index: -1;\n    background: linear-gradient(160deg, #1e3a8a, #0ea5e9);\n  }\n\n  .scene h2 {\n    color: #fff;\n    font-size: clamp(1.5rem, 4vw, 3rem);\n    margin: 0;\n  }\n\n  @supports (animation-timeline: view()) {\n    @media (prefers-reduced-motion: no-preference) {\n      .scene__layer {\n        animation: parallax linear both;\n        animation-timeline: view();\n      }\n\n      @keyframes parallax {\n        from { translate: 0 -10%; }\n        to   { translate: 0 10%; }\n      }\n    }\n  }\n\u003C\u002Fstyle>\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Csection class=\"scene\">\n    \u003Cdiv class=\"scene__layer\" aria-hidden=\"true\">\u003C\u002Fdiv>\n    \u003Ch2>Mountains\u003C\u002Fh2>\n  \u003C\u002Fsection>\n  \u003Cp style=\"padding: 2rem; max-inline-size: 60ch;\">\n    Body content between scenes scrolls normally.\n  \u003C\u002Fp>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n","html","",[18,163,164,184,204,214,232,257,271,281,331,338,347,361,376,389,402,420,433,439,444,452,464,487,500,532,537,542,552,565,599,611,616,621,636,645,653,670,679,685,690,702,723,745,750,756,761,771,780,790,809,840,854,864,881,887,896,905],{"__ignoreMap":161},[165,166,169,173,177,181],"span",{"class":167,"line":168},"line",1,[165,170,172],{"class":171},"suds8","\u003C!",[165,174,176],{"class":175},"sne4z","doctype",[165,178,180],{"class":179},"s-5SL"," html",[165,182,183],{"class":171},">\n",[165,185,187,190,192,195,198,202],{"class":167,"line":186},2,[165,188,189],{"class":171},"\u003C",[165,191,160],{"class":175},[165,193,194],{"class":179}," lang",[165,196,197],{"class":171},"=",[165,199,201],{"class":200},"sT6z2","\"en\"",[165,203,183],{"class":171},[165,205,207,209,212],{"class":167,"line":206},3,[165,208,189],{"class":171},[165,210,211],{"class":175},"head",[165,213,183],{"class":171},[165,215,217,219,222,225,227,230],{"class":167,"line":216},4,[165,218,189],{"class":171},[165,220,221],{"class":175},"meta",[165,223,224],{"class":179}," charset",[165,226,197],{"class":171},[165,228,229],{"class":200},"\"utf-8\"",[165,231,183],{"class":171},[165,233,235,237,239,242,244,247,250,252,255],{"class":167,"line":234},5,[165,236,189],{"class":171},[165,238,221],{"class":175},[165,240,241],{"class":179}," name",[165,243,197],{"class":171},[165,245,246],{"class":200},"\"viewport\"",[165,248,249],{"class":179}," content",[165,251,197],{"class":171},[165,253,254],{"class":200},"\"width=device-width, initial-scale=1\"",[165,256,183],{"class":171},[165,258,260,262,264,267,269],{"class":167,"line":259},6,[165,261,189],{"class":171},[165,263,58],{"class":175},[165,265,266],{"class":171},">Scroll-driven parallax\u003C\u002F",[165,268,58],{"class":175},[165,270,183],{"class":171},[165,272,274,276,279],{"class":167,"line":273},7,[165,275,189],{"class":171},[165,277,278],{"class":175},"style",[165,280,183],{"class":171},[165,282,284,287,290,293,296,299,302,305,307,310,314,317,319,322,325,328],{"class":167,"line":283},8,[165,285,286],{"class":175},"  body",[165,288,289],{"class":171}," { ",[165,291,292],{"class":179},"margin",[165,294,295],{"class":171},": ",[165,297,298],{"class":179},"0",[165,300,301],{"class":171},"; ",[165,303,304],{"class":179},"font",[165,306,295],{"class":171},[165,308,309],{"class":179},"16",[165,311,313],{"class":312},"sHUrx","px",[165,315,316],{"class":171},"\u002F",[165,318,83],{"class":179},[165,320,321],{"class":179}," system-ui",[165,323,324],{"class":171},", ",[165,326,327],{"class":179},"sans-serif",[165,329,330],{"class":171},"; }\n",[165,332,334],{"class":167,"line":333},9,[165,335,337],{"emptyLinePlaceholder":336},true,"\n",[165,339,341,344],{"class":167,"line":340},10,[165,342,343],{"class":179},"  .scene",[165,345,346],{"class":171}," {\n",[165,348,350,353,355,358],{"class":167,"line":349},11,[165,351,352],{"class":179},"    position",[165,354,295],{"class":171},[165,356,357],{"class":179},"relative",[165,359,360],{"class":171},";\n",[165,362,364,367,369,371,374],{"class":167,"line":363},12,[165,365,366],{"class":179},"    min-block-size",[165,368,295],{"class":171},[165,370,93],{"class":179},[165,372,373],{"class":312},"vh",[165,375,360],{"class":171},[165,377,379,382,384,387],{"class":167,"line":378},13,[165,380,381],{"class":179},"    display",[165,383,295],{"class":171},[165,385,386],{"class":179},"grid",[165,388,360],{"class":171},[165,390,392,395,397,400],{"class":167,"line":391},14,[165,393,394],{"class":179},"    place-items",[165,396,295],{"class":171},[165,398,399],{"class":179},"center",[165,401,360],{"class":171},[165,403,405,408,410,413,416],{"class":167,"line":404},15,[165,406,407],{"class":179},"    overflow",[165,409,295],{"class":171},[165,411,412],{"class":179},"clip",[165,414,415],{"class":171},";           ",[165,417,419],{"class":418},"sLBg1","\u002F* hide the layer's oversized edges *\u002F\n",[165,421,423,426,428,431],{"class":167,"line":422},16,[165,424,425],{"class":179},"    isolation",[165,427,295],{"class":171},[165,429,430],{"class":179},"isolate",[165,432,360],{"class":171},[165,434,436],{"class":167,"line":435},17,[165,437,438],{"class":171},"  }\n",[165,440,442],{"class":167,"line":441},18,[165,443,337],{"emptyLinePlaceholder":336},[165,445,447,450],{"class":167,"line":446},19,[165,448,449],{"class":179},"  .scene__layer",[165,451,346],{"class":171},[165,453,455,457,459,462],{"class":167,"line":454},20,[165,456,352],{"class":179},[165,458,295],{"class":171},[165,460,461],{"class":179},"absolute",[165,463,360],{"class":171},[165,465,467,470,472,475,478,481,484],{"class":167,"line":466},21,[165,468,469],{"class":179},"    inset",[165,471,295],{"class":171},[165,473,474],{"class":179},"-15",[165,476,477],{"class":312},"%",[165,479,480],{"class":179}," 0",[165,482,483],{"class":171},";            ",[165,485,486],{"class":418},"\u002F* 15% taller at each end to cover the travel *\u002F\n",[165,488,490,493,495,498],{"class":167,"line":489},22,[165,491,492],{"class":179},"    z-index",[165,494,295],{"class":171},[165,496,497],{"class":179},"-1",[165,499,360],{"class":171},[165,501,503,506,508,511,514,516,519,521,524,526,529],{"class":167,"line":502},23,[165,504,505],{"class":179},"    background",[165,507,295],{"class":171},[165,509,510],{"class":179},"linear-gradient",[165,512,513],{"class":171},"(",[165,515,105],{"class":179},[165,517,518],{"class":312},"deg",[165,520,324],{"class":171},[165,522,523],{"class":179},"#1e3a8a",[165,525,324],{"class":171},[165,527,528],{"class":179},"#0ea5e9",[165,530,531],{"class":171},");\n",[165,533,535],{"class":167,"line":534},24,[165,536,438],{"class":171},[165,538,540],{"class":167,"line":539},25,[165,541,337],{"emptyLinePlaceholder":336},[165,543,545,547,550],{"class":167,"line":544},26,[165,546,343],{"class":179},[165,548,549],{"class":175}," h2",[165,551,346],{"class":171},[165,553,555,558,560,563],{"class":167,"line":554},27,[165,556,557],{"class":179},"    color",[165,559,295],{"class":171},[165,561,562],{"class":179},"#fff",[165,564,360],{"class":171},[165,566,568,571,573,576,578,580,583,585,587,590,592,595,597],{"class":167,"line":567},28,[165,569,570],{"class":179},"    font-size",[165,572,295],{"class":171},[165,574,575],{"class":179},"clamp",[165,577,513],{"class":171},[165,579,83],{"class":179},[165,581,582],{"class":312},"rem",[165,584,324],{"class":171},[165,586,95],{"class":179},[165,588,589],{"class":312},"vw",[165,591,324],{"class":171},[165,593,594],{"class":179},"3",[165,596,582],{"class":312},[165,598,531],{"class":171},[165,600,602,605,607,609],{"class":167,"line":601},29,[165,603,604],{"class":179},"    margin",[165,606,295],{"class":171},[165,608,298],{"class":179},[165,610,360],{"class":171},[165,612,614],{"class":167,"line":613},30,[165,615,438],{"class":171},[165,617,619],{"class":167,"line":618},31,[165,620,337],{"emptyLinePlaceholder":336},[165,622,624,627,630,633],{"class":167,"line":623},32,[165,625,626],{"class":312},"  @supports",[165,628,629],{"class":171}," (",[165,631,632],{"class":179},"animation-timeline",[165,634,635],{"class":171},": view()) {\n",[165,637,639,642],{"class":167,"line":638},33,[165,640,641],{"class":312},"    @media",[165,643,644],{"class":171}," (prefers-reduced-motion: no-preference) {\n",[165,646,648,651],{"class":167,"line":647},34,[165,649,650],{"class":179},"      .scene__layer",[165,652,346],{"class":171},[165,654,656,659,662,665,668],{"class":167,"line":655},35,[165,657,658],{"class":179},"        animation",[165,660,661],{"class":171},": parallax ",[165,663,664],{"class":179},"linear",[165,666,667],{"class":179}," both",[165,669,360],{"class":171},[165,671,673,676],{"class":167,"line":672},36,[165,674,675],{"class":179},"        animation-timeline",[165,677,678],{"class":171},": view();\n",[165,680,682],{"class":167,"line":681},37,[165,683,684],{"class":171},"      }\n",[165,686,688],{"class":167,"line":687},38,[165,689,337],{"emptyLinePlaceholder":336},[165,691,693,696,700],{"class":167,"line":692},39,[165,694,695],{"class":312},"      @keyframes",[165,697,699],{"class":698},"soyes"," parallax",[165,701,346],{"class":171},[165,703,705,708,710,712,714,716,719,721],{"class":167,"line":704},40,[165,706,707],{"class":179},"        from",[165,709,289],{"class":171},[165,711,24],{"class":179},[165,713,295],{"class":171},[165,715,298],{"class":179},[165,717,718],{"class":179}," -10",[165,720,477],{"class":312},[165,722,330],{"class":171},[165,724,726,729,732,734,736,738,741,743],{"class":167,"line":725},41,[165,727,728],{"class":179},"        to",[165,730,731],{"class":171},"   { ",[165,733,24],{"class":179},[165,735,295],{"class":171},[165,737,298],{"class":179},[165,739,740],{"class":179}," 10",[165,742,477],{"class":312},[165,744,330],{"class":171},[165,746,748],{"class":167,"line":747},42,[165,749,684],{"class":171},[165,751,753],{"class":167,"line":752},43,[165,754,755],{"class":171},"    }\n",[165,757,759],{"class":167,"line":758},44,[165,760,438],{"class":171},[165,762,764,767,769],{"class":167,"line":763},45,[165,765,766],{"class":171},"\u003C\u002F",[165,768,278],{"class":175},[165,770,183],{"class":171},[165,772,774,776,778],{"class":167,"line":773},46,[165,775,766],{"class":171},[165,777,211],{"class":175},[165,779,183],{"class":171},[165,781,783,785,788],{"class":167,"line":782},47,[165,784,189],{"class":171},[165,786,787],{"class":175},"body",[165,789,183],{"class":171},[165,791,793,796,799,802,804,807],{"class":167,"line":792},48,[165,794,795],{"class":171},"  \u003C",[165,797,798],{"class":175},"section",[165,800,801],{"class":179}," class",[165,803,197],{"class":171},[165,805,806],{"class":200},"\"scene\"",[165,808,183],{"class":171},[165,810,812,815,818,820,822,825,828,830,833,836,838],{"class":167,"line":811},49,[165,813,814],{"class":171},"    \u003C",[165,816,817],{"class":175},"div",[165,819,801],{"class":179},[165,821,197],{"class":171},[165,823,824],{"class":200},"\"scene__layer\"",[165,826,827],{"class":179}," aria-hidden",[165,829,197],{"class":171},[165,831,832],{"class":200},"\"true\"",[165,834,835],{"class":171},">\u003C\u002F",[165,837,817],{"class":175},[165,839,183],{"class":171},[165,841,843,845,847,850,852],{"class":167,"line":842},50,[165,844,814],{"class":171},[165,846,38],{"class":175},[165,848,849],{"class":171},">Mountains\u003C\u002F",[165,851,38],{"class":175},[165,853,183],{"class":171},[165,855,857,860,862],{"class":167,"line":856},51,[165,858,859],{"class":171},"  \u003C\u002F",[165,861,798],{"class":175},[165,863,183],{"class":171},[165,865,867,869,871,874,876,879],{"class":167,"line":866},52,[165,868,795],{"class":171},[165,870,14],{"class":175},[165,872,873],{"class":179}," style",[165,875,197],{"class":171},[165,877,878],{"class":200},"\"padding: 2rem; max-inline-size: 60ch;\"",[165,880,183],{"class":171},[165,882,884],{"class":167,"line":883},53,[165,885,886],{"class":171},"    Body content between scenes scrolls normally.\n",[165,888,890,892,894],{"class":167,"line":889},54,[165,891,859],{"class":171},[165,893,14],{"class":175},[165,895,183],{"class":171},[165,897,899,901,903],{"class":167,"line":898},55,[165,900,766],{"class":171},[165,902,787],{"class":175},[165,904,183],{"class":171},[165,906,908,910,912],{"class":167,"line":907},56,[165,909,766],{"class":171},[165,911,160],{"class":175},[165,913,183],{"class":171},[14,915,916,917,920,921,924,925,929,930,933],{},"A note on the direction. The keyframes move the layer from ",[18,918,919],{},"-10%"," to ",[18,922,923],{},"10%"," — ",[926,927,928],"em",{},"down"," over the course of the section's journey ",[926,931,932],{},"up"," the viewport. That downward drift subtracts from the upward scroll, so the layer appears to move more slowly. Reverse the values and the layer moves faster than the scroll, which reads as a foreground element sliding past rather than a distant backdrop.",[38,935,937],{"id":936},"the-key-technique-keep-the-layer-covered","The key technique: keep the layer covered",[14,939,940,941,944,945,948],{},"The failure every parallax implementation must avoid is exposing the edge of the moving layer. If the layer is exactly the size of its section and moves 10% down, a strip of empty section shows at the top. The implementation handles this two ways at once: ",[18,942,943],{},"inset: -15% 0"," makes the layer taller than the section by more than its maximum travel, and ",[18,946,947],{},"overflow: clip"," on the section hides the excess.",[49,950,56,953,56,956,56,959,56,962,56,971,56,975,56,980,56,983,56,986,56,990,56,993,56,996,56,1002],{"viewBox":951,"role":52,"ariaLabel":952,"xmlns":54,"style":55},"0 0 720 260","An oversized layer extends beyond the section's top and bottom by 15 percent; overflow clip hides the overhang while the layer moves 10 percent in either direction",[58,954,955],{},"Oversize the layer by more than its travel",[62,957,958],{},"A section outline with a dashed layer outline extending 15 percent above and below it. Arrows show the layer can move 10 percent of its own height up or down, which is about 13 percent of the section and less than the 15 percent overhang, so the section is always fully covered. The parts outside the section are clipped.",[66,960,961],{"textAnchor":68,"x":69,"y":70,"style":71},"Overhang must exceed travel",[74,963],{"x":964,"y":965,"width":966,"height":967,"rx":95,"fill":96,"opacity":968,"stroke":96,"strokeWidth":83,"strokeDashArray":969},"220","50","280","190","0.15",[970,95],"6",[972,973],"path",{"d":974,"fill":81,"stroke":82,"strokeWidth":594},"M220 80 H500 V210 H220 Z",[66,976,979],{"textAnchor":68,"x":69,"y":977,"style":978},"150","text-anchor:middle;fill:currentColor;font:600 13px sans-serif","section (overflow: clip)",[66,981,982],{"textAnchor":68,"x":69,"y":93,"style":110},"overhang 15%",[66,984,982],{"textAnchor":68,"x":69,"y":985,"style":110},"230",[167,987],{"x1":988,"y1":989,"x2":988,"y2":78,"stroke":96,"strokeWidth":594},"560","110",[972,991],{"d":992,"fill":96},"M552 118 L560 104 L568 118 Z",[972,994],{"d":995,"fill":96},"M552 172 L560 186 L568 172 Z",[66,997,1001],{"textAnchor":998,"x":999,"y":977,"style":1000},"start","578","text-anchor:start;fill:currentColor;font:12px sans-serif","travel ±10%",[66,1003,1004],{"textAnchor":68,"x":108,"y":977,"style":135},"dashed: layer",[14,1006,1007,1008,1010,1011,1014],{},"The percentages in ",[18,1009,24],{}," resolve against the layer's own height, and the percentages in ",[18,1012,1013],{},"inset"," resolve against the section's height, so the numbers are not in the same units. With a 15% overhang at each end, the layer is 130% of the section's height, and 10% of that is 13% of the section — safely inside the overhang. A travel of 12% would already be 15.6% of the section and expose a sliver of edge at the extremes. The safe rule is to keep the translate percentage at no more than about three quarters of the inset percentage, or to use an animation range that trims the extremes, as the next section shows.",[38,1016,1018],{"id":1017},"tuning-with-animation-range","Tuning with animation-range",[14,1020,1021,1022,1024,1025,1028,1029,1032],{},"By default a ",[18,1023,142],{}," timeline runs from the moment the section's leading edge enters to the moment its trailing edge leaves — the ",[18,1026,1027],{},"cover"," range. For a tall hero at the top of the page, the section is already visible at load, so the first part of that range never plays. ",[18,1030,1031],{},"animation-range"," narrows the timeline to the part that matters:",[156,1034,1038],{"className":1035,"code":1036,"language":1037,"meta":161,"style":161},"language-css shiki shiki-themes github-light-high-contrast github-dark-high-contrast",".hero__layer {\n  animation: parallax linear both;\n  animation-timeline: view();\n  \u002F* Only animate while the hero is leaving the viewport. *\u002F\n  animation-range: exit 0% exit 100%;\n}\n\n@keyframes parallax {\n  from { translate: 0 0; }\n  to   { translate: 0 10%; }  \u002F* with inset: 0 0 -15% on the layer *\u002F\n}\n","css",[18,1039,1040,1047,1060,1067,1072,1094,1099,1103,1112,1129,1152],{"__ignoreMap":161},[165,1041,1042,1045],{"class":167,"line":168},[165,1043,1044],{"class":179},".hero__layer",[165,1046,346],{"class":171},[165,1048,1049,1052,1054,1056,1058],{"class":167,"line":186},[165,1050,1051],{"class":179},"  animation",[165,1053,661],{"class":171},[165,1055,664],{"class":179},[165,1057,667],{"class":179},[165,1059,360],{"class":171},[165,1061,1062,1065],{"class":167,"line":206},[165,1063,1064],{"class":179},"  animation-timeline",[165,1066,678],{"class":171},[165,1068,1069],{"class":167,"line":216},[165,1070,1071],{"class":418},"  \u002F* Only animate while the hero is leaving the viewport. *\u002F\n",[165,1073,1074,1077,1080,1082,1084,1087,1090,1092],{"class":167,"line":234},[165,1075,1076],{"class":179},"  animation-range",[165,1078,1079],{"class":171},": exit ",[165,1081,298],{"class":179},[165,1083,477],{"class":312},[165,1085,1086],{"class":171}," exit ",[165,1088,1089],{"class":179},"100",[165,1091,477],{"class":312},[165,1093,360],{"class":171},[165,1095,1096],{"class":167,"line":259},[165,1097,1098],{"class":171},"}\n",[165,1100,1101],{"class":167,"line":273},[165,1102,337],{"emptyLinePlaceholder":336},[165,1104,1105,1108,1110],{"class":167,"line":283},[165,1106,1107],{"class":312},"@keyframes",[165,1109,699],{"class":698},[165,1111,346],{"class":171},[165,1113,1114,1117,1119,1121,1123,1125,1127],{"class":167,"line":333},[165,1115,1116],{"class":179},"  from",[165,1118,289],{"class":171},[165,1120,24],{"class":179},[165,1122,295],{"class":171},[165,1124,298],{"class":179},[165,1126,480],{"class":179},[165,1128,330],{"class":171},[165,1130,1131,1134,1136,1138,1140,1142,1144,1146,1149],{"class":167,"line":340},[165,1132,1133],{"class":179},"  to",[165,1135,731],{"class":171},[165,1137,24],{"class":179},[165,1139,295],{"class":171},[165,1141,298],{"class":179},[165,1143,740],{"class":179},[165,1145,477],{"class":312},[165,1147,1148],{"class":171},"; }  ",[165,1150,1151],{"class":418},"\u002F* with inset: 0 0 -15% on the layer *\u002F\n",[165,1153,1154],{"class":167,"line":349},[165,1155,1098],{"class":171},[14,1157,1158,1159,1163],{},"Now the layer starts at rest and drifts only as the hero scrolls away. Ranges are covered in depth, with every named range illustrated, in ",[27,1160,1162],{"href":1161},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range\u002F","View Timelines and animation-range",".",[38,1165,1167],{"id":1166},"variation-multiple-layers-for-stronger-depth","Variation: multiple layers for stronger depth",[14,1169,1170],{},"Several layers moving at different rates — distant hills slowest, near trees fastest — create a stronger depth illusion. Each layer gets its own keyframes or, more compactly, a custom property for its travel:",[156,1172,1174],{"className":1035,"code":1173,"language":1037,"meta":161,"style":161},"@property --travel {\n  syntax: \"\u003Cpercentage>\";\n  inherits: false;\n  initial-value: 10%;\n}\n\n.scene__layer {\n  animation: drift linear both;\n  animation-timeline: view();\n}\n.scene__layer--far  { --travel: 5%; }\n.scene__layer--mid  { --travel: 10%; }\n.scene__layer--near { --travel: -8%; }  \u002F* moves faster than scroll *\u002F\n\n@keyframes drift {\n  from { translate: 0 calc(var(--travel) * -1); }\n  to   { translate: 0 var(--travel); }\n}\n",[18,1175,1176,1184,1195,1200,1208,1212,1216,1223,1236,1242,1246,1266,1284,1305,1309,1318,1354,1375],{"__ignoreMap":161},[165,1177,1178,1181],{"class":167,"line":168},[165,1179,1180],{"class":312},"@property",[165,1182,1183],{"class":171}," --travel {\n",[165,1185,1186,1189,1192],{"class":167,"line":186},[165,1187,1188],{"class":171},"  syntax: \"\u003Cpercentage",[165,1190,1191],{"class":312},">",[165,1193,1194],{"class":171},"\";\n",[165,1196,1197],{"class":167,"line":206},[165,1198,1199],{"class":171},"  inherits: false;\n",[165,1201,1202,1205],{"class":167,"line":216},[165,1203,1204],{"class":175},"  initial-value",[165,1206,1207],{"class":171},": 10%;\n",[165,1209,1210],{"class":167,"line":234},[165,1211,1098],{"class":171},[165,1213,1214],{"class":167,"line":259},[165,1215,337],{"emptyLinePlaceholder":336},[165,1217,1218,1221],{"class":167,"line":273},[165,1219,1220],{"class":179},".scene__layer",[165,1222,346],{"class":171},[165,1224,1225,1227,1230,1232,1234],{"class":167,"line":283},[165,1226,1051],{"class":179},[165,1228,1229],{"class":171},": drift ",[165,1231,664],{"class":179},[165,1233,667],{"class":179},[165,1235,360],{"class":171},[165,1237,1238,1240],{"class":167,"line":333},[165,1239,1064],{"class":179},[165,1241,678],{"class":171},[165,1243,1244],{"class":167,"line":340},[165,1245,1098],{"class":171},[165,1247,1248,1251,1254,1257,1259,1262,1264],{"class":167,"line":349},[165,1249,1250],{"class":179},".scene__layer--far",[165,1252,1253],{"class":171},"  { ",[165,1255,1256],{"class":698},"--travel",[165,1258,295],{"class":171},[165,1260,1261],{"class":179},"5",[165,1263,477],{"class":312},[165,1265,330],{"class":171},[165,1267,1268,1271,1273,1275,1277,1280,1282],{"class":167,"line":363},[165,1269,1270],{"class":179},".scene__layer--mid",[165,1272,1253],{"class":171},[165,1274,1256],{"class":698},[165,1276,295],{"class":171},[165,1278,1279],{"class":179},"10",[165,1281,477],{"class":312},[165,1283,330],{"class":171},[165,1285,1286,1289,1291,1293,1295,1298,1300,1302],{"class":167,"line":378},[165,1287,1288],{"class":179},".scene__layer--near",[165,1290,289],{"class":171},[165,1292,1256],{"class":698},[165,1294,295],{"class":171},[165,1296,1297],{"class":179},"-8",[165,1299,477],{"class":312},[165,1301,1148],{"class":171},[165,1303,1304],{"class":418},"\u002F* moves faster than scroll *\u002F\n",[165,1306,1307],{"class":167,"line":391},[165,1308,337],{"emptyLinePlaceholder":336},[165,1310,1311,1313,1316],{"class":167,"line":404},[165,1312,1107],{"class":312},[165,1314,1315],{"class":698}," drift",[165,1317,346],{"class":171},[165,1319,1320,1322,1324,1326,1328,1330,1333,1335,1338,1340,1342,1345,1348,1351],{"class":167,"line":422},[165,1321,1116],{"class":179},[165,1323,289],{"class":171},[165,1325,24],{"class":179},[165,1327,295],{"class":171},[165,1329,298],{"class":179},[165,1331,1332],{"class":179}," calc",[165,1334,513],{"class":171},[165,1336,1337],{"class":179},"var",[165,1339,513],{"class":171},[165,1341,1256],{"class":698},[165,1343,1344],{"class":171},") ",[165,1346,1347],{"class":312},"*",[165,1349,1350],{"class":179}," -1",[165,1352,1353],{"class":171},"); }\n",[165,1355,1356,1358,1360,1362,1364,1366,1369,1371,1373],{"class":167,"line":435},[165,1357,1133],{"class":179},[165,1359,731],{"class":171},[165,1361,24],{"class":179},[165,1363,295],{"class":171},[165,1365,298],{"class":179},[165,1367,1368],{"class":179}," var",[165,1370,513],{"class":171},[165,1372,1256],{"class":698},[165,1374,1353],{"class":171},[165,1376,1377],{"class":167,"line":441},[165,1378,1098],{"class":171},[14,1380,1381,1382,1386],{},"Keep the number of animated layers small — two or three. Each is a composited layer with its own memory cost, and large layers covering the whole viewport are the most expensive kind. ",[27,1383,1385],{"href":1384},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fwill-change-and-the-compositor-thread\u002F","will-change and the Compositor Thread"," explains that cost.",[38,1388,1390],{"id":1389},"choosing-the-scroller-and-axis","Choosing the scroller and axis",[14,1392,1393,1395,1396,1399,1400,1403,1404,1407,1408,1411],{},[18,1394,142],{}," with no arguments finds the nearest ancestor that scrolls and tracks the element along the block axis. That is right for a page that scrolls vertically, but two situations need arguments. In a horizontal carousel, ",[18,1397,1398],{},"view(inline)"," tracks progress along the inline axis, so layers inside each slide drift sideways as the carousel scrolls. And when the element sits inside a nested scroller — a scrolling panel within a scrolling page — the timeline attaches to the ",[926,1401,1402],{},"inner"," scroller, which may be what you want or may leave the effect frozen while the page moves. If the effect should follow the page instead, give the page-level element a named timeline with ",[18,1405,1406],{},"view-timeline-name"," and reference it from the layer, widening its reach with ",[18,1409,1410],{},"timeline-scope"," when the layer is not a descendant.",[14,1413,1414,1415,1417,1418,1421],{},"The second argument to ",[18,1416,142],{}," is an inset that shrinks the area the timeline considers \"in view\". ",[18,1419,1420],{},"view(block 20% 0%)"," treats the top 20% of the viewport as outside, so the animation finishes before the section reaches a sticky header. Insets are useful when fixed chrome covers part of the scroller and a layer's motion should not be wasted underneath it.",[38,1423,1425],{"id":1424},"when-not-to-use-parallax","When not to use parallax",[14,1427,1428],{},"Parallax earns its place on a small number of pages: a product launch, a story-driven landing page, a portfolio. On documentation, forms, dashboards and anything read repeatedly, it adds motion that competes with the content and costs performance on every visit. Even where it fits, one parallax scene per page is usually enough; a stack of them turns scrolling into a ride. If a design calls for depth without motion, a fixed shadow or layered illustration delivers most of the impression with none of the risk.",[38,1430,1432],{"id":1431},"accessibility-parallax-is-a-known-trigger","Accessibility: parallax is a known trigger",[14,1434,1435,1436,1439,1440,1444],{},"Parallax is one of the motion patterns most often reported as causing dizziness and nausea for people with vestibular disorders, because the content moves in a way that disagrees with the scroll gesture. The implementation above only enables the animation inside ",[18,1437,1438],{},"@media (prefers-reduced-motion: no-preference)",", so anyone who has asked their operating system to reduce motion sees a static layout. That is the correct default: parallax is decorative, and removing it loses nothing. Beyond the media query, keep offsets small and avoid parallax on text itself. ",[27,1441,1443],{"href":1442},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns\u002F","Vestibular-Safe Animation Patterns"," sets out which motions are riskiest.",[38,1446,1448],{"id":1447},"browser-support","Browser support",[14,1450,1451,1453,1454,1456,1457,1460,1461,1463,1464,1467],{},[18,1452,632],{}," and ",[18,1455,1031],{}," are supported in Chrome and Edge 115+ and Safari 26+. In Firefox, scroll-driven animations are available only as a preview behind a flag, not in stable releases. The ",[18,1458,1459],{},"@supports (animation-timeline: view())"," wrapper gives every other browser the static layout. ",[18,1462,1180],{}," is supported in Chrome and Edge 85+, Firefox 128+ and Safari 16.4+; ",[18,1465,1466],{},"prefers-reduced-motion"," in Chrome 74+, Edge 79+, Firefox 63+ and Safari 10.1+.",[38,1469,1471],{"id":1470},"faq","FAQ",[14,1473,1474,1478,1479,1481,1482,1484],{},[1475,1476,1477],"strong",{},"How does CSS parallax work without JavaScript?","\nA ",[18,1480,142],{}," timeline tracks an element's progress through its scroll container. Animating a layer's ",[18,1483,24],{}," against that timeline moves it at a different rate from the page scroll, which is the parallax effect. The browser runs it off the main thread.",[14,1486,1487,1490],{},[1475,1488,1489],{},"How far should a parallax layer move?","\nLess than you think. A background that shifts by 10 to 20 percent of its own height reads as depth. Larger offsets expose the layer's edges, need oversized images, and are more likely to trouble people with vestibular sensitivity.",[14,1492,1493,1496,1497,1163],{},[1475,1494,1495],{},"Is parallax safe for people who get motion sickness?","\nLarge parallax is one of the most common triggers for vestibular discomfort because the content moves differently from the scroll gesture. Keep offsets small and remove the effect entirely under ",[18,1498,1466],{},[14,1500,1501,1504,1505,1507],{},[1475,1502,1503],{},"What happens in browsers without scroll-driven animations?","\nWrap the animation in ",[18,1506,1459],{},". Browsers without support render the layers in their resting positions, which is a complete static layout with no broken motion.",[38,1509,1511],{"id":1510},"related","Related",[1513,1514,1515,1521,1528,1535],"ul",{},[1516,1517,1518,1520],"li",{},[27,1519,30],{"href":29}," — the parent guide.",[1516,1522,1523,1527],{},[27,1524,1526],{"href":1525},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks\u002F","Scroll-Driven Animation Fallbacks"," — patterns for browsers without timelines.",[1516,1529,1530,1534],{},[27,1531,1533],{"href":1532},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations\u002F","Scroll-Triggered Reveal Animations"," — entry effects on the same timeline.",[1516,1536,1537,1541],{},[27,1538,1540],{"href":1539},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking\u002F","animation-composition and Stacking Animations"," — combining parallax with other transforms.",[278,1543,1544],{},"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 .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 pre.shiki code .soyes, html code.shiki .soyes{--shiki-default:#702C00;--shiki-dark:#FFB757}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":161,"searchDepth":186,"depth":186,"links":1546},[1547,1548,1549,1550,1551,1552,1553,1554,1555,1556,1557],{"id":40,"depth":186,"text":41},{"id":146,"depth":186,"text":147},{"id":936,"depth":186,"text":937},{"id":1017,"depth":186,"text":1018},{"id":1166,"depth":186,"text":1167},{"id":1389,"depth":186,"text":1390},{"id":1424,"depth":186,"text":1425},{"id":1431,"depth":186,"text":1432},{"id":1447,"depth":186,"text":1448},{"id":1470,"depth":186,"text":1471},{"id":1510,"depth":186,"text":1511},"Build parallax with a view() timeline instead of scroll listeners: layers that move at different rates, subtle ranges, overflow clipping, and a static fallback.","md",{"pageTitle":5,"datePublished":1561,"dateModified":1561,"faq":1562},"2026-09-18",[1563,1565,1567,1569],{"q":1477,"a":1564},"A view() timeline tracks an element's progress through its scroll container. Animating a layer's translate against that timeline moves it at a different rate from the page scroll, which is the parallax effect. The browser runs it off the main thread.",{"q":1489,"a":1566},"Less than you think. A background that shifts by 10 to 20 percent of its own height reads as depth. Larger offsets expose the layer's edges, need oversized images, and are more likely to trouble people with vestibular sensitivity.",{"q":1495,"a":1568},"Large parallax is one of the most common triggers for vestibular discomfort because the content moves differently from the scroll gesture. Keep offsets small and remove the effect entirely under prefers-reduced-motion.",{"q":1503,"a":1570},"Wrap the animation in @supports (animation-timeline: view()). Browsers without support render the layers in their resting positions, which is a complete static layout with no broken motion.","\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects",{"title":5,"description":1558},"css-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects\u002Findex","WdNj-lEzpKtMYyghCcf_-aEUJgB4WpdilZNPAXxUL7Y",[1576,1579,1582,1585,1588,1591,1594,1597,1600,1603,1606,1609,1612,1615,1618,1621,1624,1627,1630,1633,1636,1639,1642,1645,1648,1651,1654,1657,1660,1663,1666,1669,1672,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,1820,1823,1826,1829,1831,1834,1837,1840,1843,1846,1849,1852,1854,1857,1860,1863,1866,1869,1872,1875,1878,1881,1884,1887,1890,1893,1896,1899,1902,1905,1908,1911,1914,1917,1920,1923,1926,1929,1932,1935,1938,1941,1944,1947,1950,1953,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,2097,2100,2103,2106,2109,2112,2115,2118,2121,2124,2127,2130],{"path":1577,"title":1578},"\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":1580,"title":1581},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":1583,"title":1584},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":1586,"title":1587},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":1589,"title":1590},"\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":1592,"title":1593},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":1595,"title":1596},"\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":1598,"title":1599},"\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":1601,"title":1602},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":1604,"title":1605},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":1607,"title":1608},"\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":1610,"title":1611},"\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":1613,"title":1614},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":1616,"title":1617},"\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":1619,"title":1620},"\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":1622,"title":1623},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":1625,"title":1626},"\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":1628,"title":1629},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":1631,"title":1632},"\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":1634,"title":1635},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":1637,"title":1638},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":1640,"title":1641},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":1643,"title":1644},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":1646,"title":1647},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":1649,"title":1650},"\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":1652,"title":1653},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":1655,"title":1656},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":1658,"title":1659},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":1661,"title":1662},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":1664,"title":1665},"\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":1667,"title":1668},"\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":1670,"title":1671},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":1673,"title":1674},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":1676,"title":1677},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":1679,"title":1680},"\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":1682,"title":1683},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":1685,"title":1686},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":1688,"title":1689},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":1691,"title":1692},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":1694,"title":1695},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":1697,"title":1698},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":1700,"title":1701},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":1703,"title":1704},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":1706,"title":1707},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":1709,"title":1710},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"path":1712,"title":1713},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":1715,"title":1716},"\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":1718,"title":1719},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":1721,"title":1722},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":1724,"title":1725},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":1727,"title":1728},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":1730,"title":1731},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":1733,"title":1734},"\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":1736,"title":1737},"\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":1739,"title":1740},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":1742,"title":1743},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states","Button Press and  States",{"path":1745,"title":1746},"\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":1748,"title":1749},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":1751,"title":1752},"\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":1754,"title":1755},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":1757,"title":1758},"\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":1760,"title":1761},"\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":1763,"title":1764},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":1766,"title":1767},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking","Stacking Animations With animation-composition",{"path":1769,"title":1770},"\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":1772,"title":1773},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":1775,"title":1776},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":1778,"title":1779},"\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":1781,"title":1782},"\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":1784,"title":1785},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":1787,"title":1788},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":1790,"title":1791},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":1793,"title":1794},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply","Animating box-shadow and Filters Cheaply",{"path":1796,"title":1797},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":1799,"title":1800},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite","Layout, Paint and Composite: What Triggers What",{"path":1802,"title":1803},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":1805,"title":1806},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":1808,"title":1809},"\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":1811,"title":1812},"\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":1814,"title":1815},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":1817,"title":1818},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":1571,"title":5},{"path":1821,"title":1822},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":1824,"title":1825},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":1827,"title":1828},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":1830,"title":1162},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range",{"path":1832,"title":1833},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":1835,"title":1836},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":1838,"title":1839},"\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":1841,"title":1842},"\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":1844,"title":1845},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":1847,"title":1848},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":1850,"title":1851},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":316,"title":1853},"Modern CSS Layouts & Micro-Interactions",{"path":1855,"title":1856},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":1858,"title":1859},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":1861,"title":1862},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":1864,"title":1865},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":1867,"title":1868},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":1870,"title":1871},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":1873,"title":1874},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":1876,"title":1877},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":1879,"title":1880},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":1882,"title":1883},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":1885,"title":1886},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":1888,"title":1889},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":1891,"title":1892},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":1894,"title":1895},"\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":1897,"title":1898},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":1900,"title":1901},"\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":1903,"title":1904},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":1906,"title":1907},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":1909,"title":1910},"\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":1912,"title":1913},"\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":1915,"title":1916},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics","Container Query Syntax Basics",{"path":1918,"title":1919},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":1921,"title":1922},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":1924,"title":1925},"\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":1927,"title":1928},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":1930,"title":1931},"\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":1933,"title":1934},"\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":1936,"title":1937},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":1939,"title":1940},"\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":1942,"title":1943},"\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":1945,"title":1946},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":1948,"title":1949},"\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":1951,"title":1952},"\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":1954,"title":1955},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":1957,"title":1958},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":1960,"title":1961},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":1963,"title":1964},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":1966,"title":1967},"\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":1969,"title":1970},"\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":1972,"title":1973},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":1975,"title":1976},"\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":1978,"title":1979},"\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":1981,"title":1982},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":1984,"title":1985},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":1987,"title":1988},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":1990,"title":1991},"\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":1993,"title":1994},"\u002Fmastering-container-queries-responsive-layouts","Mastering Container Queries & Responsive Layouts",{"path":1996,"title":1997},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":1999,"title":2000},"\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":2002,"title":2003},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":2005,"title":2006},"\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":2008,"title":2009},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":2011,"title":2012},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":2014,"title":2015},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":2017,"title":2018},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":2020,"title":2021},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":2023,"title":2024},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":2026,"title":2027},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":2029,"title":2030},"\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":2032,"title":2033},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset","Writing a Minimal Modern CSS Reset: Every Line Justified",{"path":2035,"title":2036},"\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":2038,"title":2039},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has","Empty and Loading States With ()",{"path":2041,"title":2042},"\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":2044,"title":2045},"\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":2047,"title":2048},"\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":2050,"title":2051},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"path":2053,"title":2054},"\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":2056,"title":2057},"\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":2059,"title":2060},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":2062,"title":2063},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":2065,"title":2066},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":2068,"title":2069},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":2071,"title":2072},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":2074,"title":2075},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":2077,"title":2078},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":2080,"title":2081},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions","Tabs That Become an Accordion: One Component, Two Layouts",{"path":2083,"title":2084},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":2086,"title":2087},"\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":2089,"title":2090},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":2092,"title":2093},"\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":2095,"title":2096},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fscroll-margin-and-scroll-padding-for-sticky-headers","scroll-margin and scroll-padding: Keeping Targets Clear of Sticky Headers",{"path":2098,"title":2099},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":2101,"title":2102},"\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":2104,"title":2105},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":2107,"title":2108},"\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":2110,"title":2111},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":2113,"title":2114},"\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":2116,"title":2117},"\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":2119,"title":2120},"\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":2122,"title":2123},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":2125,"title":2126},"\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":2128,"title":2129},"\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":2131,"title":2132},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":2134,"caption":2135,"height":2136,"html":2137,"css":2138},"Parallax layers on a view() timeline","Scroll inside the frame. Each scene's background drifts against the scroll, so it moves more slowly than the heading. Browsers without scroll-driven animations show the static layout.",340,"\n\u003Cp class=\"pad\">Scroll down inside this frame.\u003C\u002Fp>\n\u003Csection class=\"scene\">\u003Cdiv class=\"scene__layer\" aria-hidden=\"true\">\u003C\u002Fdiv>\u003Ch2>Mountains\u003C\u002Fh2>\u003C\u002Fsection>\n\u003Cp class=\"pad\">Body content between scenes scrolls normally. The layer behind each heading is taller than its section and clipped.\u003C\u002Fp>\n\u003Csection class=\"scene scene--b\">\u003Cdiv class=\"scene__layer\" aria-hidden=\"true\">\u003C\u002Fdiv>\u003Ch2>Coastline\u003C\u002Fh2>\u003C\u002Fsection>\n\u003Cp class=\"pad\">End of the demo content.\u003C\u002Fp>","\nbody { margin: 0; }\n.pad { padding: 2rem 1.25rem; margin: 0; max-inline-size: 60ch; min-block-size: 40vh; color: var(--demo-muted); }\n.scene { position: relative; min-block-size: 70vh; display: grid; place-items: center; overflow: clip; isolation: isolate; }\n.scene__layer { position: absolute; inset: -15% 0; z-index: -1; background: linear-gradient(160deg, #1e3a8a, #0ea5e9); }\n.scene__layer::after { content: \"\"; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 38px, rgb(255 255 255 \u002F 0.14) 38px 40px); }\n.scene--b .scene__layer { background: linear-gradient(160deg, #134e4a, #f59e0b); }\n.scene h2 { color: #fff; font-size: clamp(1.5rem, 6vw, 2.5rem); margin: 0; }\n@supports (animation-timeline: view()) {\n  @media (prefers-reduced-motion: no-preference) {\n    .scene__layer { animation: parallax linear both; animation-timeline: view(); }\n    @keyframes parallax { from { transform: translateY(-10%); } to { transform: translateY(10%); } }\n  }\n}",1789717747443]