[{"data":1,"prerenderedAt":2637},["ShallowReactive",2],{"page-\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Flinear-easing-function-for-springs\u002F":3,"content-all-pages":2072,"live-demo:easing-linear-spring":2631},{"id":4,"title":5,"body":6,"description":2052,"extension":2053,"meta":2054,"navigation":671,"path":2068,"seo":2069,"stem":2070,"__hash__":2071},"content\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Flinear-easing-function-for-springs\u002Findex.md","Spring and Bounce Easing With linear(): Physical Motion Without JavaScript",{"type":7,"value":8,"toc":2041},"minimark",[9,19,40,45,52,58,154,161,164,198,225,229,232,236,1496,1499,1503,1506,1604,1610,1638,1642,1645,1911,1930,1934,1958,1962,1978,1987,1996,2006,2010,2038],[10,11,13,14,18],"h1",{"id":12},"spring-and-bounce-easing-with-linear-physical-motion-without-javascript","Spring and Bounce Easing With ",[15,16,17],"code",{},"linear()",": Physical Motion Without JavaScript",[20,21,22,23,25,26,28,29,34,35,39],"p",{},"Motion that overshoots its target and settles back feels physical: a panel that springs open, a toggle knob that lands with a little recoil, a notification that bounces once into place. For years this required a JavaScript animation library because CSS easing was limited to cubic Bezier curves, which can overshoot at most once and can never oscillate. The ",[15,24,17],{}," easing function changes that. It draws a polyline through as many points as you give it, so any curve — including a damped spring — can be approximated by sampling it. This page explains how ",[15,27,17],{}," points work, how to generate a spring, how many points are enough, and how to keep the motion fast and accessible. It belongs to ",[30,31,33],"a",{"href":32},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002F","Easing & Motion Design"," in the ",[30,36,38],{"href":37},"\u002Fcss-only-micro-interactions-animations\u002F","CSS-Only Micro-Interactions & Animations"," guide.",[41,42,44],"h2",{"id":43},"why-a-polyline-beats-a-bezier-for-springs","Why a polyline beats a Bezier for springs",[20,46,47,48,51],{},"A ",[15,49,50],{},"cubic-bezier(x1, y1, x2, y2)"," curve has a fixed start at (0, 0), a fixed end at (1, 1), and two control points. Pull a control point's y above 1 and the curve overshoots — useful for a single \"pop\". But a spring does not overshoot once. It overshoots, swings back under the target, overshoots again by less, and settles, each swing smaller than the last. No single cubic curve can describe that shape.",[20,53,54,57],{},[15,55,56],{},"linear(0, 0.25 10%, 0.9 40%, 1)"," means: output 0 at the start, 0.25 at 10% of the time, 0.9 at 40%, 1 at the end, with straight lines between. Output values may go above 1 or below 0, which is what allows overshoot and undershoot. With enough points, the straight segments become invisible and the polyline is indistinguishable from the smooth curve it samples.",[59,60,66,67,66,71,66,75,66,83,66,92,66,95,66,102,66,108,66,114,66,121,66,125,66,127,66,130,66,134,66,139,66,143,66,147,66,151],"svg",{"viewBox":61,"role":62,"ariaLabel":63,"xmlns":64,"style":65},"0 0 720 320","img","A cubic Bezier curve overshooting once compared with a linear() polyline approximating a damped spring that oscillates and settles","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[68,69,70],"title",{},"One overshoot versus a damped oscillation",[72,73,74],"desc",{},"Two plots of progress against time. The cubic Bezier rises, overshoots once above the target line and settles. The linear() spring overshoots, dips below the target, overshoots again by less, and settles, drawn as connected straight segments.",[76,77,82],"text",{"textAnchor":78,"x":79,"y":80,"style":81},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","What each easing type can express",[84,85],"line",{"x1":86,"y1":87,"x2":88,"y2":87,"stroke":89,"strokeWidth":90,"opacity":91},"50","260","330","currentColor","1.5","0.6",[84,93],{"x1":86,"y1":94,"x2":86,"y2":87,"stroke":89,"strokeWidth":90,"opacity":91},"60",[84,96],{"x1":86,"y1":97,"x2":88,"y2":97,"stroke":89,"strokeDashArray":98,"opacity":101},"110",[99,100],"5","4","0.5",[103,104],"path",{"d":105,"fill":106,"stroke":107,"strokeWidth":100},"M50 260 C120 60 160 70 330 110","none","#7aa2ff",[76,109,113],{"textAnchor":78,"x":110,"y":111,"style":112},"190","290","text-anchor:middle;fill:currentColor;font:600 12px ui-monospace,monospace","cubic-bezier(): one overshoot",[76,115,120],{"textAnchor":116,"x":117,"y":118,"style":119},"end","44","114","text-anchor:end;fill:currentColor;font:11px ui-monospace,monospace","1",[84,122],{"x1":123,"y1":87,"x2":124,"y2":87,"stroke":89,"strokeWidth":90,"opacity":91},"390","670",[84,126],{"x1":123,"y1":94,"x2":123,"y2":87,"stroke":89,"strokeWidth":90,"opacity":91},[84,128],{"x1":123,"y1":97,"x2":124,"y2":97,"stroke":89,"strokeDashArray":129,"opacity":101},[99,100],[131,132],"polyline",{"points":133,"fill":106,"stroke":107,"strokeWidth":100},"390,260 420,150 445,82 470,76 495,100 520,128 545,130 570,116 595,104 620,106 645,112 670,110",[135,136],"circle",{"cx":137,"cy":138,"r":100,"fill":89},"445","82",[135,140],{"cx":141,"cy":142,"r":100,"fill":89},"520","128",[135,144],{"cx":145,"cy":146,"r":100,"fill":89},"595","104",[76,148,150],{"textAnchor":78,"x":149,"y":111,"style":112},"530","linear(): damped spring",[76,152,120],{"textAnchor":116,"x":153,"y":118,"style":119},"384",[41,155,157,158,160],{"id":156},"the-anatomy-of-a-linear-value","The anatomy of a ",[15,159,17],{}," value",[20,162,163],{},"Each argument is an output value with an optional input position:",[165,166,167,178,184,191],"ul",{},[168,169,170,173,174,177],"li",{},[15,171,172],{},"linear(0, 1)"," is plain linear timing — identical to the ",[15,175,176],{},"linear"," keyword.",[168,179,180,183],{},[15,181,182],{},"linear(0, 0.5 25%, 1)"," reaches half its output at a quarter of the time: fast, then slow.",[168,185,186,187,190],{},"Points without a percentage are distributed evenly between their neighbours that have one, so ",[15,188,189],{},"linear(0, 0.3, 0.8, 1)"," places the middle two points at 33.3% and 66.7%.",[168,192,193,194,197],{},"A point may carry two percentages, ",[15,195,196],{},"0.5 20% 40%",", which holds the output at 0.5 for that interval — a pause built into the curve.",[20,199,200,201,204,205,208,209,212,213,216,217,220,221,224],{},"Outputs are not clamped. An animated ",[15,202,203],{},"translate"," from ",[15,206,207],{},"0"," to ",[15,210,211],{},"100px"," with an output of ",[15,214,215],{},"1.12"," at some point overshoots to ",[15,218,219],{},"112px",". That is exactly what a spring needs, and it is also why springs must only be applied to properties where overshoot makes sense — position, scale, rotation — and not to properties with hard limits such as ",[15,222,223],{},"opacity",", which clamps above 1 anyway.",[41,226,228],{"id":227},"the-complete-implementation","The complete implementation",[20,230,231],{},"The toggle below uses a 27-point spring for the knob. Compare it with the ease-out row underneath to feel the difference; both use the same duration.",[233,234],"live-demo",{"name":235},"easing-linear-spring",[237,238,243],"pre",{"className":239,"code":240,"language":241,"meta":242,"style":242},"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>linear() spring\u003C\u002Ftitle>\n\u003Cstyle>\n  :root {\n    \u002F* A moderately damped spring, sampled at 27 points (denser at the bends).\n       Outputs above 1 are the overshoot; below 1 after the peak, the rebound. *\u002F\n    --ease-spring: linear(\n      0, 0.0086, 0.0335, 0.0722, 0.1224, 0.1817 9.8%, 0.3137 13.3%,\n      0.4589 17.4%, 0.5991 21.7%, 0.7238 26%, 0.8277 30.4%, 0.9065 34.6%,\n      0.9681 39.2%, 1.0082 43.8%, 1.0296 48.2%, 1.0356 52.4%, 1.0319 56.4%,\n      1.0217 60.8%, 1.0097 65.3%, 1.0004 69.8%, 0.9951 74%, 0.9934 78.3%,\n      0.9945 82.8%, 0.9973 87.5%, 0.9996 92.2%, 1.0004 96%, 1\n    );\n  }\n\n  body { font: 15px\u002F1.5 system-ui, sans-serif; margin: 1.5rem; display: grid; gap: 1rem; }\n\n  .switch { display: inline-flex; align-items: center; gap: 0.75rem; cursor: pointer; }\n  .switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }\n\n  .switch__track {\n    width: 3.5rem;\n    height: 2rem;\n    padding: 0.25rem;\n    border-radius: 999px;\n    background: #cbd5e1;\n    transition: background-color 0.2s ease;\n  }\n\n  .switch__knob {\n    display: block;\n    width: 1.5rem;\n    height: 1.5rem;\n    border-radius: 50%;\n    background: #ffffff;\n    box-shadow: 0 1px 3px rgb(0 0 0 \u002F 0.3);\n    \u002F* translate is a standalone property, so the spring moves the knob\n       without interfering with any transform set elsewhere. *\u002F\n    transition: translate 0.6s var(--ease-spring);\n  }\n\n  .switch input:checked + .switch__track { background: #4f46e5; }\n  .switch input:checked + .switch__track .switch__knob { translate: 1.5rem 0; }\n  .switch input:focus-visible + .switch__track { outline: 2px solid #1e1b4b; outline-offset: 2px; }\n\n  \u002F* Comparison: same duration, a conventional ease-out. *\u002F\n  .switch--plain .switch__knob { transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }\n\n  \u002F* Reduced motion: no bounce, and a short, plain transition. *\u002F\n  @media (prefers-reduced-motion: reduce) {\n    .switch__knob { transition: translate 0.1s linear; }\n  }\n\u003C\u002Fstyle>\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Clabel class=\"switch\">\u003Cinput type=\"checkbox\">\u003Cspan class=\"switch__track\">\u003Cspan class=\"switch__knob\">\u003C\u002Fspan>\u003C\u002Fspan> Spring\u003C\u002Flabel>\n  \u003Clabel class=\"switch switch--plain\">\u003Cinput type=\"checkbox\">\u003Cspan class=\"switch__track\">\u003Cspan class=\"switch__knob\">\u003C\u002Fspan>\u003C\u002Fspan> Ease-out\u003C\u002Flabel>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n","html","",[15,244,245,264,284,294,312,337,351,361,370,377,383,398,450,503,556,609,654,660,666,673,743,748,796,846,851,859,875,890,905,920,933,953,958,963,971,984,997,1010,1023,1035,1077,1083,1089,1111,1116,1121,1149,1179,1223,1228,1234,1273,1278,1284,1293,1316,1321,1331,1340,1350,1419,1478,1487],{"__ignoreMap":242},[246,247,249,253,257,261],"span",{"class":84,"line":248},1,[246,250,252],{"class":251},"suds8","\u003C!",[246,254,256],{"class":255},"sne4z","doctype",[246,258,260],{"class":259},"s-5SL"," html",[246,262,263],{"class":251},">\n",[246,265,267,270,272,275,278,282],{"class":84,"line":266},2,[246,268,269],{"class":251},"\u003C",[246,271,241],{"class":255},[246,273,274],{"class":259}," lang",[246,276,277],{"class":251},"=",[246,279,281],{"class":280},"sT6z2","\"en\"",[246,283,263],{"class":251},[246,285,287,289,292],{"class":84,"line":286},3,[246,288,269],{"class":251},[246,290,291],{"class":255},"head",[246,293,263],{"class":251},[246,295,297,299,302,305,307,310],{"class":84,"line":296},4,[246,298,269],{"class":251},[246,300,301],{"class":255},"meta",[246,303,304],{"class":259}," charset",[246,306,277],{"class":251},[246,308,309],{"class":280},"\"utf-8\"",[246,311,263],{"class":251},[246,313,315,317,319,322,324,327,330,332,335],{"class":84,"line":314},5,[246,316,269],{"class":251},[246,318,301],{"class":255},[246,320,321],{"class":259}," name",[246,323,277],{"class":251},[246,325,326],{"class":280},"\"viewport\"",[246,328,329],{"class":259}," content",[246,331,277],{"class":251},[246,333,334],{"class":280},"\"width=device-width, initial-scale=1\"",[246,336,263],{"class":251},[246,338,340,342,344,347,349],{"class":84,"line":339},6,[246,341,269],{"class":251},[246,343,68],{"class":255},[246,345,346],{"class":251},">linear() spring\u003C\u002F",[246,348,68],{"class":255},[246,350,263],{"class":251},[246,352,354,356,359],{"class":84,"line":353},7,[246,355,269],{"class":251},[246,357,358],{"class":255},"style",[246,360,263],{"class":251},[246,362,364,367],{"class":84,"line":363},8,[246,365,366],{"class":259},"  :root",[246,368,369],{"class":251}," {\n",[246,371,373],{"class":84,"line":372},9,[246,374,376],{"class":375},"sLBg1","    \u002F* A moderately damped spring, sampled at 27 points (denser at the bends).\n",[246,378,380],{"class":84,"line":379},10,[246,381,382],{"class":375},"       Outputs above 1 are the overshoot; below 1 after the peak, the rebound. *\u002F\n",[246,384,386,390,393,395],{"class":84,"line":385},11,[246,387,389],{"class":388},"soyes","    --ease-spring",[246,391,392],{"class":251},": ",[246,394,176],{"class":259},[246,396,397],{"class":251},"(\n",[246,399,401,404,407,410,412,415,417,420,422,425,427,430,433,437,439,442,445,447],{"class":84,"line":400},12,[246,402,403],{"class":259},"      0",[246,405,406],{"class":251},", ",[246,408,409],{"class":259},"0.0086",[246,411,406],{"class":251},[246,413,414],{"class":259},"0.0335",[246,416,406],{"class":251},[246,418,419],{"class":259},"0.0722",[246,421,406],{"class":251},[246,423,424],{"class":259},"0.1224",[246,426,406],{"class":251},[246,428,429],{"class":259},"0.1817",[246,431,432],{"class":259}," 9.8",[246,434,436],{"class":435},"sHUrx","%",[246,438,406],{"class":251},[246,440,441],{"class":259},"0.3137",[246,443,444],{"class":259}," 13.3",[246,446,436],{"class":435},[246,448,449],{"class":251},",\n",[246,451,453,456,459,461,463,466,469,471,473,476,479,481,483,486,489,491,493,496,499,501],{"class":84,"line":452},13,[246,454,455],{"class":259},"      0.4589",[246,457,458],{"class":259}," 17.4",[246,460,436],{"class":435},[246,462,406],{"class":251},[246,464,465],{"class":259},"0.5991",[246,467,468],{"class":259}," 21.7",[246,470,436],{"class":435},[246,472,406],{"class":251},[246,474,475],{"class":259},"0.7238",[246,477,478],{"class":259}," 26",[246,480,436],{"class":435},[246,482,406],{"class":251},[246,484,485],{"class":259},"0.8277",[246,487,488],{"class":259}," 30.4",[246,490,436],{"class":435},[246,492,406],{"class":251},[246,494,495],{"class":259},"0.9065",[246,497,498],{"class":259}," 34.6",[246,500,436],{"class":435},[246,502,449],{"class":251},[246,504,506,509,512,514,516,519,522,524,526,529,532,534,536,539,542,544,546,549,552,554],{"class":84,"line":505},14,[246,507,508],{"class":259},"      0.9681",[246,510,511],{"class":259}," 39.2",[246,513,436],{"class":435},[246,515,406],{"class":251},[246,517,518],{"class":259},"1.0082",[246,520,521],{"class":259}," 43.8",[246,523,436],{"class":435},[246,525,406],{"class":251},[246,527,528],{"class":259},"1.0296",[246,530,531],{"class":259}," 48.2",[246,533,436],{"class":435},[246,535,406],{"class":251},[246,537,538],{"class":259},"1.0356",[246,540,541],{"class":259}," 52.4",[246,543,436],{"class":435},[246,545,406],{"class":251},[246,547,548],{"class":259},"1.0319",[246,550,551],{"class":259}," 56.4",[246,553,436],{"class":435},[246,555,449],{"class":251},[246,557,559,562,565,567,569,572,575,577,579,582,585,587,589,592,595,597,599,602,605,607],{"class":84,"line":558},15,[246,560,561],{"class":259},"      1.0217",[246,563,564],{"class":259}," 60.8",[246,566,436],{"class":435},[246,568,406],{"class":251},[246,570,571],{"class":259},"1.0097",[246,573,574],{"class":259}," 65.3",[246,576,436],{"class":435},[246,578,406],{"class":251},[246,580,581],{"class":259},"1.0004",[246,583,584],{"class":259}," 69.8",[246,586,436],{"class":435},[246,588,406],{"class":251},[246,590,591],{"class":259},"0.9951",[246,593,594],{"class":259}," 74",[246,596,436],{"class":435},[246,598,406],{"class":251},[246,600,601],{"class":259},"0.9934",[246,603,604],{"class":259}," 78.3",[246,606,436],{"class":435},[246,608,449],{"class":251},[246,610,612,615,618,620,622,625,628,630,632,635,638,640,642,644,647,649,651],{"class":84,"line":611},16,[246,613,614],{"class":259},"      0.9945",[246,616,617],{"class":259}," 82.8",[246,619,436],{"class":435},[246,621,406],{"class":251},[246,623,624],{"class":259},"0.9973",[246,626,627],{"class":259}," 87.5",[246,629,436],{"class":435},[246,631,406],{"class":251},[246,633,634],{"class":259},"0.9996",[246,636,637],{"class":259}," 92.2",[246,639,436],{"class":435},[246,641,406],{"class":251},[246,643,581],{"class":259},[246,645,646],{"class":259}," 96",[246,648,436],{"class":435},[246,650,406],{"class":251},[246,652,653],{"class":259},"1\n",[246,655,657],{"class":84,"line":656},17,[246,658,659],{"class":251},"    );\n",[246,661,663],{"class":84,"line":662},18,[246,664,665],{"class":251},"  }\n",[246,667,669],{"class":84,"line":668},19,[246,670,672],{"emptyLinePlaceholder":671},true,"\n",[246,674,676,679,682,685,687,690,693,696,698,701,703,706,709,712,714,716,719,721,724,726,729,731,734,736,738,740],{"class":84,"line":675},20,[246,677,678],{"class":255},"  body",[246,680,681],{"class":251}," { ",[246,683,684],{"class":259},"font",[246,686,392],{"class":251},[246,688,689],{"class":259},"15",[246,691,692],{"class":435},"px",[246,694,695],{"class":251},"\u002F",[246,697,90],{"class":259},[246,699,700],{"class":259}," system-ui",[246,702,406],{"class":251},[246,704,705],{"class":259},"sans-serif",[246,707,708],{"class":251},"; ",[246,710,711],{"class":259},"margin",[246,713,392],{"class":251},[246,715,90],{"class":259},[246,717,718],{"class":435},"rem",[246,720,708],{"class":251},[246,722,723],{"class":259},"display",[246,725,392],{"class":251},[246,727,728],{"class":259},"grid",[246,730,708],{"class":251},[246,732,733],{"class":259},"gap",[246,735,392],{"class":251},[246,737,120],{"class":259},[246,739,718],{"class":435},[246,741,742],{"class":251},"; }\n",[246,744,746],{"class":84,"line":745},21,[246,747,672],{"emptyLinePlaceholder":671},[246,749,751,754,756,758,760,763,765,768,770,773,775,777,779,782,784,786,789,791,794],{"class":84,"line":750},22,[246,752,753],{"class":259},"  .switch",[246,755,681],{"class":251},[246,757,723],{"class":259},[246,759,392],{"class":251},[246,761,762],{"class":259},"inline-flex",[246,764,708],{"class":251},[246,766,767],{"class":259},"align-items",[246,769,392],{"class":251},[246,771,772],{"class":259},"center",[246,774,708],{"class":251},[246,776,733],{"class":259},[246,778,392],{"class":251},[246,780,781],{"class":259},"0.75",[246,783,718],{"class":435},[246,785,708],{"class":251},[246,787,788],{"class":259},"cursor",[246,790,392],{"class":251},[246,792,793],{"class":259},"pointer",[246,795,742],{"class":251},[246,797,799,801,804,806,809,811,814,816,818,820,822,824,827,829,831,833,835,838,840,842,844],{"class":84,"line":798},23,[246,800,753],{"class":259},[246,802,803],{"class":255}," input",[246,805,681],{"class":251},[246,807,808],{"class":259},"position",[246,810,392],{"class":251},[246,812,813],{"class":259},"absolute",[246,815,708],{"class":251},[246,817,223],{"class":259},[246,819,392],{"class":251},[246,821,207],{"class":259},[246,823,708],{"class":251},[246,825,826],{"class":259},"width",[246,828,392],{"class":251},[246,830,120],{"class":259},[246,832,692],{"class":435},[246,834,708],{"class":251},[246,836,837],{"class":259},"height",[246,839,392],{"class":251},[246,841,120],{"class":259},[246,843,692],{"class":435},[246,845,742],{"class":251},[246,847,849],{"class":84,"line":848},24,[246,850,672],{"emptyLinePlaceholder":671},[246,852,854,857],{"class":84,"line":853},25,[246,855,856],{"class":259},"  .switch__track",[246,858,369],{"class":251},[246,860,862,865,867,870,872],{"class":84,"line":861},26,[246,863,864],{"class":259},"    width",[246,866,392],{"class":251},[246,868,869],{"class":259},"3.5",[246,871,718],{"class":435},[246,873,874],{"class":251},";\n",[246,876,878,881,883,886,888],{"class":84,"line":877},27,[246,879,880],{"class":259},"    height",[246,882,392],{"class":251},[246,884,885],{"class":259},"2",[246,887,718],{"class":435},[246,889,874],{"class":251},[246,891,893,896,898,901,903],{"class":84,"line":892},28,[246,894,895],{"class":259},"    padding",[246,897,392],{"class":251},[246,899,900],{"class":259},"0.25",[246,902,718],{"class":435},[246,904,874],{"class":251},[246,906,908,911,913,916,918],{"class":84,"line":907},29,[246,909,910],{"class":259},"    border-radius",[246,912,392],{"class":251},[246,914,915],{"class":259},"999",[246,917,692],{"class":435},[246,919,874],{"class":251},[246,921,923,926,928,931],{"class":84,"line":922},30,[246,924,925],{"class":259},"    background",[246,927,392],{"class":251},[246,929,930],{"class":259},"#cbd5e1",[246,932,874],{"class":251},[246,934,936,939,942,945,948,951],{"class":84,"line":935},31,[246,937,938],{"class":259},"    transition",[246,940,941],{"class":251},": background-color ",[246,943,944],{"class":259},"0.2",[246,946,947],{"class":435},"s",[246,949,950],{"class":259}," ease",[246,952,874],{"class":251},[246,954,956],{"class":84,"line":955},32,[246,957,665],{"class":251},[246,959,961],{"class":84,"line":960},33,[246,962,672],{"emptyLinePlaceholder":671},[246,964,966,969],{"class":84,"line":965},34,[246,967,968],{"class":259},"  .switch__knob",[246,970,369],{"class":251},[246,972,974,977,979,982],{"class":84,"line":973},35,[246,975,976],{"class":259},"    display",[246,978,392],{"class":251},[246,980,981],{"class":259},"block",[246,983,874],{"class":251},[246,985,987,989,991,993,995],{"class":84,"line":986},36,[246,988,864],{"class":259},[246,990,392],{"class":251},[246,992,90],{"class":259},[246,994,718],{"class":435},[246,996,874],{"class":251},[246,998,1000,1002,1004,1006,1008],{"class":84,"line":999},37,[246,1001,880],{"class":259},[246,1003,392],{"class":251},[246,1005,90],{"class":259},[246,1007,718],{"class":435},[246,1009,874],{"class":251},[246,1011,1013,1015,1017,1019,1021],{"class":84,"line":1012},38,[246,1014,910],{"class":259},[246,1016,392],{"class":251},[246,1018,86],{"class":259},[246,1020,436],{"class":435},[246,1022,874],{"class":251},[246,1024,1026,1028,1030,1033],{"class":84,"line":1025},39,[246,1027,925],{"class":259},[246,1029,392],{"class":251},[246,1031,1032],{"class":259},"#ffffff",[246,1034,874],{"class":251},[246,1036,1038,1041,1043,1045,1048,1050,1053,1055,1058,1061,1063,1066,1068,1071,1074],{"class":84,"line":1037},40,[246,1039,1040],{"class":259},"    box-shadow",[246,1042,392],{"class":251},[246,1044,207],{"class":259},[246,1046,1047],{"class":259}," 1",[246,1049,692],{"class":435},[246,1051,1052],{"class":259}," 3",[246,1054,692],{"class":435},[246,1056,1057],{"class":259}," rgb",[246,1059,1060],{"class":251},"(",[246,1062,207],{"class":259},[246,1064,1065],{"class":259}," 0",[246,1067,1065],{"class":259},[246,1069,1070],{"class":251}," \u002F ",[246,1072,1073],{"class":259},"0.3",[246,1075,1076],{"class":251},");\n",[246,1078,1080],{"class":84,"line":1079},41,[246,1081,1082],{"class":375},"    \u002F* translate is a standalone property, so the spring moves the knob\n",[246,1084,1086],{"class":84,"line":1085},42,[246,1087,1088],{"class":375},"       without interfering with any transform set elsewhere. *\u002F\n",[246,1090,1092,1094,1097,1099,1101,1104,1106,1109],{"class":84,"line":1091},43,[246,1093,938],{"class":259},[246,1095,1096],{"class":251},": translate ",[246,1098,91],{"class":259},[246,1100,947],{"class":435},[246,1102,1103],{"class":259}," var",[246,1105,1060],{"class":251},[246,1107,1108],{"class":388},"--ease-spring",[246,1110,1076],{"class":251},[246,1112,1114],{"class":84,"line":1113},44,[246,1115,665],{"class":251},[246,1117,1119],{"class":84,"line":1118},45,[246,1120,672],{"emptyLinePlaceholder":671},[246,1122,1124,1126,1128,1131,1134,1137,1139,1142,1144,1147],{"class":84,"line":1123},46,[246,1125,753],{"class":259},[246,1127,803],{"class":255},[246,1129,1130],{"class":259},":checked",[246,1132,1133],{"class":435}," +",[246,1135,1136],{"class":259}," .switch__track",[246,1138,681],{"class":251},[246,1140,1141],{"class":259},"background",[246,1143,392],{"class":251},[246,1145,1146],{"class":259},"#4f46e5",[246,1148,742],{"class":251},[246,1150,1152,1154,1156,1158,1160,1162,1165,1167,1169,1171,1173,1175,1177],{"class":84,"line":1151},47,[246,1153,753],{"class":259},[246,1155,803],{"class":255},[246,1157,1130],{"class":259},[246,1159,1133],{"class":435},[246,1161,1136],{"class":259},[246,1163,1164],{"class":259}," .switch__knob",[246,1166,681],{"class":251},[246,1168,203],{"class":259},[246,1170,392],{"class":251},[246,1172,90],{"class":259},[246,1174,718],{"class":435},[246,1176,1065],{"class":259},[246,1178,742],{"class":251},[246,1180,1182,1184,1186,1189,1191,1193,1195,1198,1200,1202,1204,1207,1210,1212,1215,1217,1219,1221],{"class":84,"line":1181},48,[246,1183,753],{"class":259},[246,1185,803],{"class":255},[246,1187,1188],{"class":259},":focus-visible",[246,1190,1133],{"class":435},[246,1192,1136],{"class":259},[246,1194,681],{"class":251},[246,1196,1197],{"class":259},"outline",[246,1199,392],{"class":251},[246,1201,885],{"class":259},[246,1203,692],{"class":435},[246,1205,1206],{"class":259}," solid",[246,1208,1209],{"class":259}," #1e1b4b",[246,1211,708],{"class":251},[246,1213,1214],{"class":259},"outline-offset",[246,1216,392],{"class":251},[246,1218,885],{"class":259},[246,1220,692],{"class":435},[246,1222,742],{"class":251},[246,1224,1226],{"class":84,"line":1225},49,[246,1227,672],{"emptyLinePlaceholder":671},[246,1229,1231],{"class":84,"line":1230},50,[246,1232,1233],{"class":375},"  \u002F* Comparison: same duration, a conventional ease-out. *\u002F\n",[246,1235,1237,1240,1242,1244,1247,1249,1252,1254,1257,1259,1261,1263,1266,1268,1270],{"class":84,"line":1236},51,[246,1238,1239],{"class":259},"  .switch--plain",[246,1241,1164],{"class":259},[246,1243,681],{"class":251},[246,1245,1246],{"class":259},"transition-timing-function",[246,1248,392],{"class":251},[246,1250,1251],{"class":259},"cubic-bezier",[246,1253,1060],{"class":251},[246,1255,1256],{"class":259},"0.22",[246,1258,406],{"class":251},[246,1260,120],{"class":259},[246,1262,406],{"class":251},[246,1264,1265],{"class":259},"0.36",[246,1267,406],{"class":251},[246,1269,120],{"class":259},[246,1271,1272],{"class":251},"); }\n",[246,1274,1276],{"class":84,"line":1275},52,[246,1277,672],{"emptyLinePlaceholder":671},[246,1279,1281],{"class":84,"line":1280},53,[246,1282,1283],{"class":375},"  \u002F* Reduced motion: no bounce, and a short, plain transition. *\u002F\n",[246,1285,1287,1290],{"class":84,"line":1286},54,[246,1288,1289],{"class":435},"  @media",[246,1291,1292],{"class":251}," (prefers-reduced-motion: reduce) {\n",[246,1294,1296,1299,1301,1304,1306,1309,1311,1314],{"class":84,"line":1295},55,[246,1297,1298],{"class":259},"    .switch__knob",[246,1300,681],{"class":251},[246,1302,1303],{"class":259},"transition",[246,1305,1096],{"class":251},[246,1307,1308],{"class":259},"0.1",[246,1310,947],{"class":435},[246,1312,1313],{"class":259}," linear",[246,1315,742],{"class":251},[246,1317,1319],{"class":84,"line":1318},56,[246,1320,665],{"class":251},[246,1322,1324,1327,1329],{"class":84,"line":1323},57,[246,1325,1326],{"class":251},"\u003C\u002F",[246,1328,358],{"class":255},[246,1330,263],{"class":251},[246,1332,1334,1336,1338],{"class":84,"line":1333},58,[246,1335,1326],{"class":251},[246,1337,291],{"class":255},[246,1339,263],{"class":251},[246,1341,1343,1345,1348],{"class":84,"line":1342},59,[246,1344,269],{"class":251},[246,1346,1347],{"class":255},"body",[246,1349,263],{"class":251},[246,1351,1353,1356,1359,1362,1364,1367,1370,1373,1376,1378,1381,1383,1385,1387,1389,1392,1394,1396,1398,1400,1403,1406,1408,1410,1412,1415,1417],{"class":84,"line":1352},60,[246,1354,1355],{"class":251},"  \u003C",[246,1357,1358],{"class":255},"label",[246,1360,1361],{"class":259}," class",[246,1363,277],{"class":251},[246,1365,1366],{"class":280},"\"switch\"",[246,1368,1369],{"class":251},">\u003C",[246,1371,1372],{"class":255},"input",[246,1374,1375],{"class":259}," type",[246,1377,277],{"class":251},[246,1379,1380],{"class":280},"\"checkbox\"",[246,1382,1369],{"class":251},[246,1384,246],{"class":255},[246,1386,1361],{"class":259},[246,1388,277],{"class":251},[246,1390,1391],{"class":280},"\"switch__track\"",[246,1393,1369],{"class":251},[246,1395,246],{"class":255},[246,1397,1361],{"class":259},[246,1399,277],{"class":251},[246,1401,1402],{"class":280},"\"switch__knob\"",[246,1404,1405],{"class":251},">\u003C\u002F",[246,1407,246],{"class":255},[246,1409,1405],{"class":251},[246,1411,246],{"class":255},[246,1413,1414],{"class":251},"> Spring\u003C\u002F",[246,1416,1358],{"class":255},[246,1418,263],{"class":251},[246,1420,1422,1424,1426,1428,1430,1433,1435,1437,1439,1441,1443,1445,1447,1449,1451,1453,1455,1457,1459,1461,1463,1465,1467,1469,1471,1474,1476],{"class":84,"line":1421},61,[246,1423,1355],{"class":251},[246,1425,1358],{"class":255},[246,1427,1361],{"class":259},[246,1429,277],{"class":251},[246,1431,1432],{"class":280},"\"switch switch--plain\"",[246,1434,1369],{"class":251},[246,1436,1372],{"class":255},[246,1438,1375],{"class":259},[246,1440,277],{"class":251},[246,1442,1380],{"class":280},[246,1444,1369],{"class":251},[246,1446,246],{"class":255},[246,1448,1361],{"class":259},[246,1450,277],{"class":251},[246,1452,1391],{"class":280},[246,1454,1369],{"class":251},[246,1456,246],{"class":255},[246,1458,1361],{"class":259},[246,1460,277],{"class":251},[246,1462,1402],{"class":280},[246,1464,1405],{"class":251},[246,1466,246],{"class":255},[246,1468,1405],{"class":251},[246,1470,246],{"class":255},[246,1472,1473],{"class":251},"> Ease-out\u003C\u002F",[246,1475,1358],{"class":255},[246,1477,263],{"class":251},[246,1479,1481,1483,1485],{"class":84,"line":1480},62,[246,1482,1326],{"class":251},[246,1484,1347],{"class":255},[246,1486,263],{"class":251},[246,1488,1490,1492,1494],{"class":84,"line":1489},63,[246,1491,1326],{"class":251},[246,1493,241],{"class":255},[246,1495,263],{"class":251},[20,1497,1498],{},"Storing the curve in a custom property keeps the long point list out of every rule that uses it, and makes the spring a design token that components reference by name. The overshoot peaks at about 1.036 — the knob travels 3.6% past its target, less than a pixel at this size, but enough to register as a physical landing.",[41,1500,1502],{"id":1501},"the-key-technique-sampling-a-spring-into-points","The key technique: sampling a spring into points",[20,1504,1505],{},"The points come from simulating a damped harmonic oscillator — a mass on a spring with friction — and recording its position at intervals. The equation of motion is standard physics; what matters for CSS is the procedure.",[59,1507,66,1510,66,1513,66,1516,66,1519,66,1528,66,1534,66,1538,66,1542,66,1546,66,1549,66,1553,66,1556,66,1559,66,1562,66,1565,66,1569,66,1572,66,1575,66,1578,66,1583,66,1587,66,1592,66,1596,66,1600],{"viewBox":1508,"role":62,"ariaLabel":1509,"xmlns":64,"style":65},"0 0 720 280","Four-step pipeline from spring parameters to a simulated curve to sampled points to a linear() value",[68,1511,1512],{},"From spring parameters to a linear() value",[72,1514,1515],{},"Choose stiffness, damping and mass; simulate position over time until it settles; sample the curve at points dense where it bends and sparse where it is straight; write the samples as a linear() argument list.",[76,1517,1518],{"textAnchor":78,"x":79,"y":80,"style":81},"A spring is a physics simulation, sampled once",[1520,1521],"rect",{"x":1522,"y":1523,"width":1524,"height":1525,"rx":1526,"fill":107,"opacity":1527},"20","56","160","120","10","0.18",[76,1529,1533],{"textAnchor":78,"x":1530,"y":1531,"style":1532},"100","84","text-anchor:middle;fill:currentColor;font:700 14px sans-serif","1. Parameters",[76,1535,1537],{"textAnchor":78,"x":1530,"y":97,"style":1536},"text-anchor:middle;fill:currentColor;font:12px sans-serif","stiffness",[76,1539,1541],{"textAnchor":78,"x":1530,"y":1540,"style":1536},"130","damping",[76,1543,1545],{"textAnchor":78,"x":1530,"y":1544,"style":1536},"150","mass",[1520,1547],{"x":1548,"y":1523,"width":1524,"height":1525,"rx":1526,"fill":107,"opacity":1527},"196",[76,1550,1552],{"textAnchor":78,"x":1551,"y":1531,"style":1532},"276","2. Simulate",[76,1554,1555],{"textAnchor":78,"x":1551,"y":97,"style":1536},"position over",[76,1557,1558],{"textAnchor":78,"x":1551,"y":1540,"style":1536},"time until it",[76,1560,1561],{"textAnchor":78,"x":1551,"y":1544,"style":1536},"settles",[1520,1563],{"x":1564,"y":1523,"width":1524,"height":1525,"rx":1526,"fill":107,"opacity":1527},"372",[76,1566,1568],{"textAnchor":78,"x":1567,"y":1531,"style":1532},"452","3. Sample",[76,1570,1571],{"textAnchor":78,"x":1567,"y":97,"style":1536},"dense at bends,",[76,1573,1574],{"textAnchor":78,"x":1567,"y":1540,"style":1536},"sparse on the",[76,1576,1577],{"textAnchor":78,"x":1567,"y":1544,"style":1536},"flat tail",[1520,1579],{"x":1580,"y":1523,"width":1581,"height":1525,"rx":1526,"fill":107,"opacity":1582},"548","152","0.34",[76,1584,1586],{"textAnchor":78,"x":1585,"y":1531,"style":1532},"624","4. Emit",[76,1588,1591],{"textAnchor":78,"x":1585,"y":1589,"style":1590},"116","text-anchor:middle;fill:currentColor;font:12px ui-monospace,monospace","linear(0,",[76,1593,1595],{"textAnchor":78,"x":1585,"y":1594,"style":1590},"136","0.18 9.8%, …)",[76,1597,1599],{"textAnchor":78,"x":79,"y":1598,"style":1536},"220","The duration in CSS should equal the simulated settle time,",[76,1601,1603],{"textAnchor":78,"x":79,"y":1602,"style":1536},"242","or the element will look finished long before the animation ends.",[20,1605,1606,1607,1609],{},"In practice, generate the points with a small script at build time or with one of the several online ",[15,1608,17],{}," generators, and paste the result into a custom property. A few rules make the output better:",[1611,1612,1613,1620,1626,1632],"ol",{},[168,1614,1615,1619],{},[1616,1617,1618],"strong",{},"Sample adaptively."," Put more points where the curve bends sharply — the initial rise and the first overshoot — and fewer on the nearly flat tail. Adjacent points on a straight stretch can be merged without visible change.",[168,1621,1622,1625],{},[1616,1623,1624],{},"Trim the tail."," Once the oscillation is below about half a percent of the travel, it is invisible. End the list there and set the CSS duration to that moment.",[168,1627,1628,1631],{},[1616,1629,1630],{},"Round to four decimal places."," More precision adds bytes and no visible difference.",[168,1633,1634,1637],{},[1616,1635,1636],{},"Test at the real distance."," A 3% overshoot is invisible on a 20-pixel knob and very visible on a 400-pixel drawer. Choose springs with less overshoot for larger movements.",[41,1639,1641],{"id":1640},"variation-a-bounce-not-a-spring","Variation: a bounce, not a spring",[20,1643,1644],{},"A bounce is a different physical model — a ball hitting a floor — and it has a characteristic shape: the output reaches exactly 1 several times, rebounding by less each time, and never goes past 1. It suits drop-in notifications and \"landing\" effects better than a spring.",[237,1646,1650],{"className":1647,"code":1648,"language":1649,"meta":242,"style":242},"language-css shiki shiki-themes github-light-high-contrast github-dark-high-contrast",":root {\n  \u002F* Three bounces with decreasing height; output never exceeds 1. *\u002F\n  --ease-bounce: linear(\n    0, 0.063, 0.25, 0.563, 1 36.4%,\n    0.812, 0.75, 0.813, 1 72.7%,\n    0.953, 0.938, 0.953, 1 90.9%,\n    0.984, 1 100%\n  );\n}\n\n.toast {\n  animation: drop-in 0.9s var(--ease-bounce) both;\n}\n\n@keyframes drop-in {\n  from { translate: 0 -120%; }\n  to   { translate: 0 0; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .toast { animation: none; }\n}\n","css",[15,1651,1652,1659,1664,1675,1705,1730,1756,1771,1776,1781,1785,1792,1820,1824,1828,1838,1858,1876,1880,1884,1891,1907],{"__ignoreMap":242},[246,1653,1654,1657],{"class":84,"line":248},[246,1655,1656],{"class":259},":root",[246,1658,369],{"class":251},[246,1660,1661],{"class":84,"line":266},[246,1662,1663],{"class":375},"  \u002F* Three bounces with decreasing height; output never exceeds 1. *\u002F\n",[246,1665,1666,1669,1671,1673],{"class":84,"line":286},[246,1667,1668],{"class":388},"  --ease-bounce",[246,1670,392],{"class":251},[246,1672,176],{"class":259},[246,1674,397],{"class":251},[246,1676,1677,1680,1682,1685,1687,1689,1691,1694,1696,1698,1701,1703],{"class":84,"line":296},[246,1678,1679],{"class":259},"    0",[246,1681,406],{"class":251},[246,1683,1684],{"class":259},"0.063",[246,1686,406],{"class":251},[246,1688,900],{"class":259},[246,1690,406],{"class":251},[246,1692,1693],{"class":259},"0.563",[246,1695,406],{"class":251},[246,1697,120],{"class":259},[246,1699,1700],{"class":259}," 36.4",[246,1702,436],{"class":435},[246,1704,449],{"class":251},[246,1706,1707,1710,1712,1714,1716,1719,1721,1723,1726,1728],{"class":84,"line":314},[246,1708,1709],{"class":259},"    0.812",[246,1711,406],{"class":251},[246,1713,781],{"class":259},[246,1715,406],{"class":251},[246,1717,1718],{"class":259},"0.813",[246,1720,406],{"class":251},[246,1722,120],{"class":259},[246,1724,1725],{"class":259}," 72.7",[246,1727,436],{"class":435},[246,1729,449],{"class":251},[246,1731,1732,1735,1737,1740,1742,1745,1747,1749,1752,1754],{"class":84,"line":339},[246,1733,1734],{"class":259},"    0.953",[246,1736,406],{"class":251},[246,1738,1739],{"class":259},"0.938",[246,1741,406],{"class":251},[246,1743,1744],{"class":259},"0.953",[246,1746,406],{"class":251},[246,1748,120],{"class":259},[246,1750,1751],{"class":259}," 90.9",[246,1753,436],{"class":435},[246,1755,449],{"class":251},[246,1757,1758,1761,1763,1765,1768],{"class":84,"line":353},[246,1759,1760],{"class":259},"    0.984",[246,1762,406],{"class":251},[246,1764,120],{"class":259},[246,1766,1767],{"class":259}," 100",[246,1769,1770],{"class":435},"%\n",[246,1772,1773],{"class":84,"line":363},[246,1774,1775],{"class":251},"  );\n",[246,1777,1778],{"class":84,"line":372},[246,1779,1780],{"class":251},"}\n",[246,1782,1783],{"class":84,"line":379},[246,1784,672],{"emptyLinePlaceholder":671},[246,1786,1787,1790],{"class":84,"line":385},[246,1788,1789],{"class":259},".toast",[246,1791,369],{"class":251},[246,1793,1794,1797,1800,1803,1805,1807,1809,1812,1815,1818],{"class":84,"line":400},[246,1795,1796],{"class":259},"  animation",[246,1798,1799],{"class":251},": drop-in ",[246,1801,1802],{"class":259},"0.9",[246,1804,947],{"class":435},[246,1806,1103],{"class":259},[246,1808,1060],{"class":251},[246,1810,1811],{"class":388},"--ease-bounce",[246,1813,1814],{"class":251},") ",[246,1816,1817],{"class":259},"both",[246,1819,874],{"class":251},[246,1821,1822],{"class":84,"line":452},[246,1823,1780],{"class":251},[246,1825,1826],{"class":84,"line":505},[246,1827,672],{"emptyLinePlaceholder":671},[246,1829,1830,1833,1836],{"class":84,"line":558},[246,1831,1832],{"class":435},"@keyframes",[246,1834,1835],{"class":388}," drop-in",[246,1837,369],{"class":251},[246,1839,1840,1843,1845,1847,1849,1851,1854,1856],{"class":84,"line":611},[246,1841,1842],{"class":259},"  from",[246,1844,681],{"class":251},[246,1846,203],{"class":259},[246,1848,392],{"class":251},[246,1850,207],{"class":259},[246,1852,1853],{"class":259}," -120",[246,1855,436],{"class":435},[246,1857,742],{"class":251},[246,1859,1860,1863,1866,1868,1870,1872,1874],{"class":84,"line":656},[246,1861,1862],{"class":259},"  to",[246,1864,1865],{"class":251},"   { ",[246,1867,203],{"class":259},[246,1869,392],{"class":251},[246,1871,207],{"class":259},[246,1873,1065],{"class":259},[246,1875,742],{"class":251},[246,1877,1878],{"class":84,"line":662},[246,1879,1780],{"class":251},[246,1881,1882],{"class":84,"line":668},[246,1883,672],{"emptyLinePlaceholder":671},[246,1885,1886,1889],{"class":84,"line":675},[246,1887,1888],{"class":435},"@media",[246,1890,1292],{"class":251},[246,1892,1893,1896,1898,1901,1903,1905],{"class":84,"line":745},[246,1894,1895],{"class":259},"  .toast",[246,1897,681],{"class":251},[246,1899,1900],{"class":259},"animation",[246,1902,392],{"class":251},[246,1904,106],{"class":259},[246,1906,742],{"class":251},[246,1908,1909],{"class":84,"line":750},[246,1910,1780],{"class":251},[20,1912,1913,1914,406,1917,1920,1921,1924,1925,1929],{},"The points at ",[15,1915,1916],{},"1 36.4%",[15,1918,1919],{},"1 72.7%"," and ",[15,1922,1923],{},"1 90.9%"," are the floor contacts: exactly the target position, at the moments of impact. Between them the output dips back below 1 — upward in visual terms, since the element came from above. Because nothing goes past 1, the toast never passes through its resting position, which is what distinguishes a bounce from a spring. Bounces call for restraint: use them for rare, celebratory moments, never for routine UI such as menus, where they quickly become irritating. The broader guidance on how much character an easing should carry is in ",[30,1926,1928],{"href":1927},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation\u002F","Cubic-Bezier Overshoot and Anticipation",".",[41,1931,1933],{"id":1932},"browser-support","Browser support",[20,1935,1936,1937,1939,1940,1943,1944,1947,1948,1950,1951,1954,1955,1957],{},"The ",[15,1938,17],{}," easing function is supported in Chrome and Edge 113+, Firefox 112+ and Safari 17.2+. In an engine without it, a declaration using ",[15,1941,1942],{},"linear(...)"," is invalid and dropped, so declare a cubic Bezier fallback first — ",[15,1945,1946],{},"transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1)"," followed by the ",[15,1949,17],{}," version — or wrap the token in ",[15,1952,1953],{},"@supports (transition-timing-function: linear(0, 1))",". The standalone ",[15,1956,203],{}," property is supported in Chrome and Edge 104+, Firefox 72+ and Safari 14.1+.",[41,1959,1961],{"id":1960},"faq","FAQ",[20,1963,1964,1974,1975,1977],{},[1616,1965,1966,1967,1969,1970,1973],{},"What does ",[15,1968,17],{}," do that ",[15,1971,1972],{},"cubic-bezier()"," cannot?","\nA cubic Bezier has one curve with two control points, so it can overshoot once at most and cannot oscillate. ",[15,1976,17],{}," draws a polyline through any number of points, so it can approximate springs that overshoot and settle, bounces that hit the floor several times, and any other curve sampled finely enough.",[20,1979,1980,1986],{},[1616,1981,1982,1983,1985],{},"How many points does a ",[15,1984,17],{}," spring need?","\nEnough that the straight segments between them are not visible at the element's speed. Twenty to forty points covers most UI springs; very bouncy or long animations may need more. Because each point is only a number and optional percentage, the cost is stylesheet size, not runtime.",[20,1988,1989,1992,1993,1995],{},[1616,1990,1991],{},"Does a spring easing change the animation's duration?","\nNo. ",[15,1994,17],{}," maps progress within the duration you set. A spring that visually settles at 60% of its curve will look finished early and then sit still, so choose the duration to match when the curve actually settles, or trim the tail of the point list.",[20,1997,1998,2001,2002,2005],{},[1616,1999,2000],{},"Should spring easing be disabled for reduced motion?","\nThe overshoot and oscillation are extra movement, so under ",[15,2003,2004],{},"prefers-reduced-motion"," switch to a plain ease-out or remove the transition entirely. A spring is decoration on top of a state change that should remain instant and clear for those users.",[41,2007,2009],{"id":2008},"related","Related",[165,2011,2012,2017,2024,2031],{},[168,2013,2014,2016],{},[30,2015,33],{"href":32}," — the parent guide to timing and character.",[168,2018,2019,2023],{},[30,2020,2022],{"href":2021},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions\u002F","CSS Transition Timing Functions"," — the full set of built-in and Bezier curves.",[168,2025,2026,2030],{},[30,2027,2029],{"href":2028},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations\u002F","Choosing Animation Durations"," — matching duration to the settle time.",[168,2032,2033,2037],{},[30,2034,2036],{"href":2035},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-toggle-switches-and-checkboxes\u002F","CSS-Only Toggle Switches and Checkboxes"," — the component the spring is applied to.",[358,2039,2040],{},"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 .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 pre.shiki code .sHUrx, html code.shiki .sHUrx{--shiki-default:#A0111F;--shiki-dark:#FF9492}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":242,"searchDepth":266,"depth":266,"links":2042},[2043,2044,2046,2047,2048,2049,2050,2051],{"id":43,"depth":266,"text":44},{"id":156,"depth":266,"text":2045},"The anatomy of a linear() value",{"id":227,"depth":266,"text":228},{"id":1501,"depth":266,"text":1502},{"id":1640,"depth":266,"text":1641},{"id":1932,"depth":266,"text":1933},{"id":1960,"depth":266,"text":1961},{"id":2008,"depth":266,"text":2009},"Approximate springs and bounces in pure CSS with the linear() easing function: how its stops work, how many points you need, and how to keep settle times honest","md",{"pageTitle":2055,"datePublished":2056,"dateModified":2056,"faq":2057},"Spring and Bounce Easing With linear()","2026-09-18",[2058,2061,2064,2066],{"q":2059,"a":2060},"What does linear() do that cubic-bezier() cannot?","A cubic Bezier has one curve with two control points, so it can overshoot once at most and cannot oscillate. linear() draws a polyline through any number of points, so it can approximate springs that overshoot and settle, bounces that hit the floor several times, and any other curve sampled finely enough.",{"q":2062,"a":2063},"How many points does a linear() spring need?","Enough that the straight segments between them are not visible at the element's speed. Twenty to forty points covers most UI springs; very bouncy or long animations may need more. Because each point is only a number and optional percentage, the cost is stylesheet size, not runtime.",{"q":1991,"a":2065},"No. linear() maps progress within the duration you set. A spring that visually settles at 60% of its curve will look finished early and then sit still, so choose the duration to match when the curve actually settles, or trim the tail of the point list.",{"q":2000,"a":2067},"The overshoot and oscillation are extra movement, so under prefers-reduced-motion switch to a plain ease-out or remove the transition entirely. A spring is decoration on top of a state change that should remain instant and clear for those users.","\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Flinear-easing-function-for-springs",{"title":5,"description":2052},"css-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Flinear-easing-function-for-springs\u002Findex","JciGlYRbh5EvsuXtdMfoLWu2fbgk8PE-m5TC-pz3nhw",[2073,2076,2079,2082,2085,2088,2091,2094,2097,2100,2103,2106,2109,2112,2115,2118,2121,2124,2127,2130,2133,2136,2139,2142,2145,2148,2151,2154,2157,2160,2163,2166,2169,2172,2175,2178,2181,2184,2187,2190,2193,2196,2199,2202,2205,2208,2211,2214,2217,2220,2223,2226,2229,2230,2233,2236,2239,2242,2245,2248,2251,2254,2257,2260,2263,2266,2269,2272,2275,2278,2281,2284,2287,2290,2293,2296,2299,2302,2305,2308,2311,2314,2317,2320,2323,2326,2329,2332,2335,2338,2341,2344,2347,2350,2352,2355,2358,2361,2364,2367,2370,2373,2376,2379,2382,2385,2388,2391,2394,2397,2400,2403,2406,2409,2412,2415,2418,2421,2424,2427,2430,2433,2436,2439,2442,2445,2448,2451,2454,2457,2460,2463,2466,2469,2472,2475,2478,2481,2484,2487,2490,2493,2496,2499,2502,2505,2508,2511,2514,2517,2520,2523,2526,2529,2532,2535,2538,2541,2544,2547,2550,2553,2556,2559,2562,2565,2568,2571,2574,2577,2580,2583,2586,2589,2592,2595,2598,2601,2604,2607,2610,2613,2616,2619,2622,2625,2628],{"path":2074,"title":2075},"\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":2077,"title":2078},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":2080,"title":2081},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":2083,"title":2084},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":2086,"title":2087},"\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":2089,"title":2090},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":2092,"title":2093},"\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":2095,"title":2096},"\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":2098,"title":2099},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":2101,"title":2102},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":2104,"title":2105},"\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":2107,"title":2108},"\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":2110,"title":2111},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":2113,"title":2114},"\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":2116,"title":2117},"\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":2119,"title":2120},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":2122,"title":2123},"\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":2125,"title":2126},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":2128,"title":2129},"\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":2131,"title":2132},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":2134,"title":2135},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":2137,"title":2138},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":2140,"title":2141},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":2143,"title":2144},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":2146,"title":2147},"\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":2149,"title":2150},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":2152,"title":2153},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":2155,"title":2156},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":2158,"title":2159},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":2161,"title":2162},"\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":2164,"title":2165},"\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":2167,"title":2168},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":2170,"title":2171},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":2173,"title":2174},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":2176,"title":2177},"\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":2179,"title":2180},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":2182,"title":2183},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":2185,"title":2186},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":2188,"title":2189},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":2191,"title":2192},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":2194,"title":2195},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":2197,"title":2198},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":2200,"title":2201},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":2203,"title":2204},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":2206,"title":2207},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"path":2209,"title":2210},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":2212,"title":2213},"\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":2215,"title":2216},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":2218,"title":2219},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":2221,"title":2222},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":2224,"title":2225},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":2227,"title":2228},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":2068,"title":5},{"path":2231,"title":2232},"\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":2234,"title":2235},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":2237,"title":2238},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states","Button Press and  States",{"path":2240,"title":2241},"\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":2243,"title":2244},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":2246,"title":2247},"\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":2249,"title":2250},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":2252,"title":2253},"\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":2255,"title":2256},"\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":2258,"title":2259},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":2261,"title":2262},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking","Stacking Animations With animation-composition",{"path":2264,"title":2265},"\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":2267,"title":2268},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":2270,"title":2271},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":2273,"title":2274},"\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":2276,"title":2277},"\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":2279,"title":2280},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":2282,"title":2283},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":2285,"title":2286},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":2288,"title":2289},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply","Animating box-shadow and Filters Cheaply",{"path":2291,"title":2292},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":2294,"title":2295},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite","Layout, Paint and Composite: What Triggers What",{"path":2297,"title":2298},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":2300,"title":2301},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":2303,"title":2304},"\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":2306,"title":2307},"\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":2309,"title":2310},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":2312,"title":2313},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":2315,"title":2316},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects","Scroll-Driven Parallax Effects in CSS",{"path":2318,"title":2319},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":2321,"title":2322},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":2324,"title":2325},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":2327,"title":2328},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range","View Timelines and animation-range",{"path":2330,"title":2331},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":2333,"title":2334},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":2336,"title":2337},"\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":2339,"title":2340},"\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":2342,"title":2343},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":2345,"title":2346},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":2348,"title":2349},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":695,"title":2351},"Modern CSS Layouts & Micro-Interactions",{"path":2353,"title":2354},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":2356,"title":2357},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":2359,"title":2360},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":2362,"title":2363},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":2365,"title":2366},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":2368,"title":2369},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":2371,"title":2372},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":2374,"title":2375},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":2377,"title":2378},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":2380,"title":2381},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":2383,"title":2384},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":2386,"title":2387},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":2389,"title":2390},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":2392,"title":2393},"\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":2395,"title":2396},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":2398,"title":2399},"\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":2401,"title":2402},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":2404,"title":2405},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":2407,"title":2408},"\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":2410,"title":2411},"\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":2413,"title":2414},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics","Container Query Syntax Basics",{"path":2416,"title":2417},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":2419,"title":2420},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":2422,"title":2423},"\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":2425,"title":2426},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":2428,"title":2429},"\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":2431,"title":2432},"\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":2434,"title":2435},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":2437,"title":2438},"\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":2440,"title":2441},"\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":2443,"title":2444},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":2446,"title":2447},"\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":2449,"title":2450},"\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":2452,"title":2453},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":2455,"title":2456},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":2458,"title":2459},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":2461,"title":2462},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":2464,"title":2465},"\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":2467,"title":2468},"\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":2470,"title":2471},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":2473,"title":2474},"\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":2476,"title":2477},"\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":2479,"title":2480},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":2482,"title":2483},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":2485,"title":2486},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":2488,"title":2489},"\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":2491,"title":2492},"\u002Fmastering-container-queries-responsive-layouts","Mastering Container Queries & Responsive Layouts",{"path":2494,"title":2495},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":2497,"title":2498},"\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":2500,"title":2501},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":2503,"title":2504},"\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":2506,"title":2507},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":2509,"title":2510},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":2512,"title":2513},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":2515,"title":2516},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":2518,"title":2519},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":2521,"title":2522},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":2524,"title":2525},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":2527,"title":2528},"\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":2530,"title":2531},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset","Writing a Minimal Modern CSS Reset: Every Line Justified",{"path":2533,"title":2534},"\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":2536,"title":2537},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has","Empty and Loading States With ()",{"path":2539,"title":2540},"\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":2542,"title":2543},"\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":2545,"title":2546},"\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":2548,"title":2549},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"path":2551,"title":2552},"\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":2554,"title":2555},"\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":2557,"title":2558},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":2560,"title":2561},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":2563,"title":2564},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":2566,"title":2567},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":2569,"title":2570},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":2572,"title":2573},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":2575,"title":2576},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":2578,"title":2579},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions","Tabs That Become an Accordion: One Component, Two Layouts",{"path":2581,"title":2582},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":2584,"title":2585},"\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":2587,"title":2588},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":2590,"title":2591},"\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":2593,"title":2594},"\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":2596,"title":2597},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":2599,"title":2600},"\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":2602,"title":2603},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":2605,"title":2606},"\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":2608,"title":2609},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":2611,"title":2612},"\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":2614,"title":2615},"\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":2617,"title":2618},"\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":2620,"title":2621},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":2623,"title":2624},"\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":2626,"title":2627},"\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":2629,"title":2630},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":2632,"caption":2633,"height":2634,"html":2635,"css":2636},"Spring easing from linear() versus a plain ease-out","Toggle both switches: the top knob overshoots and settles like a spring; the bottom one glides to a stop in the same 0.6s.",170,"\n\u003Clabel class=\"switch\">\u003Cinput type=\"checkbox\">\u003Cspan class=\"switch__track\">\u003Cspan class=\"switch__knob\">\u003C\u002Fspan>\u003C\u002Fspan> Spring\u003C\u002Flabel>\n\u003Clabel class=\"switch switch--plain\">\u003Cinput type=\"checkbox\">\u003Cspan class=\"switch__track\">\u003Cspan class=\"switch__knob\">\u003C\u002Fspan>\u003C\u002Fspan> Ease-out\u003C\u002Flabel>","\n:root {\n  --ease-spring: linear(\n    0, 0.0086, 0.0335, 0.0722, 0.1224, 0.1817 9.8%, 0.3137 13.3%,\n    0.4589 17.4%, 0.5991 21.7%, 0.7238 26%, 0.8277 30.4%, 0.9065 34.6%,\n    0.9681 39.2%, 1.0082 43.8%, 1.0296 48.2%, 1.0356 52.4%, 1.0319 56.4%,\n    1.0217 60.8%, 1.0097 65.3%, 1.0004 69.8%, 0.9951 74%, 0.9934 78.3%,\n    0.9945 82.8%, 0.9973 87.5%, 0.9996 92.2%, 1.0004 96%, 1\n  );\n}\nbody { display: grid; gap: 1rem; place-content: center; }\n.switch { display: inline-flex; align-items: center; gap: 0.75rem; cursor: pointer; }\n.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }\n.switch__track { width: 3.5rem; height: 2rem; padding: 0.25rem; border-radius: 999px; background: var(--demo-border); transition: background-color 0.2s ease; }\n.switch__knob { display: block; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 3px rgb(0 0 0 \u002F 0.3); transition: translate 0.6s var(--ease-spring); }\n.switch input:checked + .switch__track { background: var(--demo-accent); }\n.switch input:checked + .switch__track .switch__knob { translate: 1.5rem 0; }\n.switch input:focus-visible + .switch__track { outline: 2px solid var(--demo-fg); outline-offset: 2px; }\n.switch--plain .switch__knob { transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }\n@media (prefers-reduced-motion: reduce) { .switch__knob { transition: translate 0.1s linear; } }",1789717746666]