[{"data":1,"prerenderedAt":2235},["ShallowReactive",2],{"page-\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking\u002F":3,"content-all-pages":1670,"live-demo:animation-stacking":2229},{"id":4,"title":5,"body":6,"description":1650,"extension":1651,"meta":1652,"navigation":424,"path":1666,"seo":1667,"stem":1668,"__hash__":1669},"content\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking\u002Findex.md","Stacking Animations With animation-composition",{"type":7,"value":8,"toc":1639},"minimark",[9,18,40,45,57,78,185,189,215,219,1047,1058,1064,1071,1087,1147,1173,1176,1385,1398,1402,1408,1433,1455,1467,1471,1474,1514,1517,1521,1534,1538,1554,1570,1589,1604,1608,1636],[10,11,13,14],"h1",{"id":12},"stacking-animations-with-animation-composition","Stacking Animations With ",[15,16,17],"code",{},"animation-composition",[19,20,21,22,25,26,28,29,34,35,39],"p",{},"An icon that floats gently up and down, and also spins when hovered. A notification badge that pulses in scale, and also shakes when a new message arrives. A card that drifts in on a scroll timeline, and also lifts on hover. Each pair is two animations on the same element, and when both touch ",[15,23,24],{},"transform",", the second silently replaces the first: the icon stops floating the moment it starts spinning. This page explains why animations on the same property overwrite each other, how the individual transform properties sidestep the problem, and how ",[15,27,17],{}," combines animations when they genuinely share a property. It belongs to ",[30,31,33],"a",{"href":32},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002F","Keyframe Animation Patterns"," 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-the-second-animation-wins","Why the second animation wins",[19,46,47,48,51,52,56],{},"An element can run several animations at once by listing them: ",[15,49,50],{},"animation: float 3s infinite, spin 600ms",". Each animation produces a value for each property in its keyframes. When two animations produce a value for the same property, the browser must choose, and by default it uses the one later in the list — the ",[53,54,55],"em",{},"replace"," composite operation. The earlier animation keeps running internally, but its effect on that property is hidden.",[19,58,59,60,62,63,66,67,70,71,66,74,77],{},"For ",[15,61,24],{},", that is almost never what a designer intends. ",[15,64,65],{},"float"," animates ",[15,68,69],{},"transform: translateY(-4px)"," and ",[15,72,73],{},"spin",[15,75,76],{},"transform: rotate(360deg)","; while both run, only the rotation shows, and the icon drops back to its un-floated position for the duration of the spin.",[79,80,86,87,86,91,86,95,86,103,86,117,86,123,86,128,86,132,86,137,86,142,86,147,86,150,86,153,86,156,86,159,86,162,86,166,86,170,86,172,86,175,86,177,86,180],"svg",{"viewBox":81,"role":82,"ariaLabel":83,"xmlns":84,"style":85},"0 0 720 300","img","Two animations on transform: with replace only the later spin is visible; with separate translate and rotate properties, or with add composition, both effects combine","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[88,89,90],"title",{},"Replace versus combine",[92,93,94],"desc",{},"Three columns. Replace: the float and spin animations both set transform, and only the spin is applied. Separate properties: float sets translate and spin sets rotate, and both apply. animation-composition add: both set transform and their transforms are appended, and both apply.",[96,97,102],"text",{"textAnchor":98,"x":99,"y":100,"style":101},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","float + spin on the same element",[104,105],"rect",{"x":106,"y":107,"width":108,"height":108,"rx":109,"fill":110,"stroke":111,"strokeWidth":112,"strokeDashArray":113,"opacity":116},"30","50","200","12","none","currentColor","1.5",[114,115],"6","4","0.7",[96,118,122],{"textAnchor":98,"x":119,"y":120,"style":121},"130","78","text-anchor:middle;fill:currentColor;font:700 13px sans-serif","replace (default)",[96,124,127],{"textAnchor":98,"x":119,"y":125,"style":126},"108","text-anchor:middle;fill:currentColor;font:12px ui-monospace,monospace","transform: float",[96,129,131],{"textAnchor":98,"x":119,"y":130,"style":126},"128","transform: spin",[96,133,136],{"textAnchor":98,"x":119,"y":134,"style":135},"176","text-anchor:middle;fill:currentColor;font:600 12px sans-serif","only spin visible",[96,138,141],{"textAnchor":98,"x":119,"y":139,"style":140},"198","text-anchor:middle;fill:currentColor;font:12px sans-serif","float drops out",[104,143],{"x":144,"y":107,"width":108,"height":108,"rx":109,"fill":145,"opacity":146},"260","#7aa2ff","0.28",[96,148,149],{"textAnchor":98,"x":99,"y":120,"style":121},"separate properties",[96,151,152],{"textAnchor":98,"x":99,"y":125,"style":126},"translate: float",[96,154,155],{"textAnchor":98,"x":99,"y":130,"style":126},"rotate: spin",[96,157,158],{"textAnchor":98,"x":99,"y":134,"style":135},"both visible",[96,160,161],{"textAnchor":98,"x":99,"y":139,"style":140},"no conflict at all",[104,163],{"x":164,"y":107,"width":108,"height":108,"rx":109,"fill":145,"opacity":165},"490","0.18",[96,167,169],{"textAnchor":98,"x":168,"y":120,"style":121},"590","composition: add",[96,171,127],{"textAnchor":98,"x":168,"y":125,"style":126},[96,173,174],{"textAnchor":98,"x":168,"y":130,"style":126},"+ transform: spin",[96,176,158],{"textAnchor":98,"x":168,"y":134,"style":135},[96,178,179],{"textAnchor":98,"x":168,"y":139,"style":140},"values combined",[96,181,184],{"textAnchor":98,"x":99,"y":182,"style":183},"280","text-anchor:middle;fill:currentColor;font:12px sans-serif;opacity:0.8","Try separate properties first; use composition when they must share one.",[41,186,188],{"id":187},"the-first-fix-individual-transform-properties","The first fix: individual transform properties",[19,190,191,192,195,196,70,199,202,203,205,206,208,209,211,212,214],{},"The simplest solution is often not to share a property at all. CSS has individual ",[15,193,194],{},"translate",", ",[15,197,198],{},"rotate",[15,200,201],{},"scale"," properties, each independent of ",[15,204,24],{}," and of each other. An animation on ",[15,207,194],{}," and an animation on ",[15,210,198],{}," never conflict; the browser applies them in a fixed order — translate, then rotate, then scale, then the ",[15,213,24],{}," property — and both effects are visible.",[216,217],"live-demo",{"name":218},"animation-stacking",[220,221,226],"pre",{"className":222,"code":223,"language":224,"meta":225,"style":225},"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>Stacking animations\u003C\u002Ftitle>\n\u003Cstyle>\n  body { font: 14px\u002F1.5 system-ui, sans-serif; margin: 2rem; display: flex; gap: 3rem; }\n\n  .icon {\n    display: grid;\n    place-items: center;\n    inline-size: 3.5rem;\n    block-size: 3.5rem;\n    border-radius: 12px;\n    background: #6366f1;\n    color: #ffffff;\n    font-size: 1.5rem;\n  }\n\n  \u002F* BROKEN: both animations set transform; on hover the spin replaces the\n     float, so the icon drops to its resting height while spinning. *\u002F\n  .icon--broken {\n    animation: float-transform 3s ease-in-out infinite alternate;\n  }\n  .icon--broken:hover {\n    animation: float-transform 3s ease-in-out infinite alternate,\n               spin-transform 600ms cubic-bezier(0.22, 1, 0.36, 1);\n  }\n  @keyframes float-transform { to { transform: translateY(-8px); } }\n  @keyframes spin-transform  { to { transform: rotate(360deg); } }\n\n  \u002F* FIXED: each animation owns its own individual property. *\u002F\n  .icon--fixed {\n    animation: float 3s ease-in-out infinite alternate;\n  }\n  .icon--fixed:hover {\n    animation: float 3s ease-in-out infinite alternate,\n               spin 600ms cubic-bezier(0.22, 1, 0.36, 1);\n  }\n  @keyframes float { to { translate: 0 -8px; } }\n  @keyframes spin  { to { rotate: 360deg; } }\n\n  @media (prefers-reduced-motion: reduce) {\n    .icon, .icon:hover { animation: none; }\n  }\n\u003C\u002Fstyle>\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Cdiv class=\"icon icon--broken\" aria-hidden=\"true\">★\u003C\u002Fdiv>\n  \u003Cdiv class=\"icon icon--fixed\" aria-hidden=\"true\">★\u003C\u002Fdiv>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n","html","",[15,227,228,248,268,278,296,321,335,345,419,426,435,449,462,477,491,505,518,531,545,551,556,563,569,577,602,607,615,635,673,678,712,742,747,753,761,781,786,794,813,843,848,877,901,906,915,937,942,952,961,971,1003,1029,1038],{"__ignoreMap":225},[229,230,233,237,241,245],"span",{"class":231,"line":232},"line",1,[229,234,236],{"class":235},"suds8","\u003C!",[229,238,240],{"class":239},"sne4z","doctype",[229,242,244],{"class":243},"s-5SL"," html",[229,246,247],{"class":235},">\n",[229,249,251,254,256,259,262,266],{"class":231,"line":250},2,[229,252,253],{"class":235},"\u003C",[229,255,224],{"class":239},[229,257,258],{"class":243}," lang",[229,260,261],{"class":235},"=",[229,263,265],{"class":264},"sT6z2","\"en\"",[229,267,247],{"class":235},[229,269,271,273,276],{"class":231,"line":270},3,[229,272,253],{"class":235},[229,274,275],{"class":239},"head",[229,277,247],{"class":235},[229,279,281,283,286,289,291,294],{"class":231,"line":280},4,[229,282,253],{"class":235},[229,284,285],{"class":239},"meta",[229,287,288],{"class":243}," charset",[229,290,261],{"class":235},[229,292,293],{"class":264},"\"utf-8\"",[229,295,247],{"class":235},[229,297,299,301,303,306,308,311,314,316,319],{"class":231,"line":298},5,[229,300,253],{"class":235},[229,302,285],{"class":239},[229,304,305],{"class":243}," name",[229,307,261],{"class":235},[229,309,310],{"class":264},"\"viewport\"",[229,312,313],{"class":243}," content",[229,315,261],{"class":235},[229,317,318],{"class":264},"\"width=device-width, initial-scale=1\"",[229,320,247],{"class":235},[229,322,324,326,328,331,333],{"class":231,"line":323},6,[229,325,253],{"class":235},[229,327,88],{"class":239},[229,329,330],{"class":235},">Stacking animations\u003C\u002F",[229,332,88],{"class":239},[229,334,247],{"class":235},[229,336,338,340,343],{"class":231,"line":337},7,[229,339,253],{"class":235},[229,341,342],{"class":239},"style",[229,344,247],{"class":235},[229,346,348,351,354,357,360,363,367,370,372,375,377,380,383,386,388,391,394,396,399,401,404,406,409,411,414,416],{"class":231,"line":347},8,[229,349,350],{"class":239},"  body",[229,352,353],{"class":235}," { ",[229,355,356],{"class":243},"font",[229,358,359],{"class":235},": ",[229,361,362],{"class":243},"14",[229,364,366],{"class":365},"sHUrx","px",[229,368,369],{"class":235},"\u002F",[229,371,112],{"class":243},[229,373,374],{"class":243}," system-ui",[229,376,195],{"class":235},[229,378,379],{"class":243},"sans-serif",[229,381,382],{"class":235},"; ",[229,384,385],{"class":243},"margin",[229,387,359],{"class":235},[229,389,390],{"class":243},"2",[229,392,393],{"class":365},"rem",[229,395,382],{"class":235},[229,397,398],{"class":243},"display",[229,400,359],{"class":235},[229,402,403],{"class":243},"flex",[229,405,382],{"class":235},[229,407,408],{"class":243},"gap",[229,410,359],{"class":235},[229,412,413],{"class":243},"3",[229,415,393],{"class":365},[229,417,418],{"class":235},"; }\n",[229,420,422],{"class":231,"line":421},9,[229,423,425],{"emptyLinePlaceholder":424},true,"\n",[229,427,429,432],{"class":231,"line":428},10,[229,430,431],{"class":243},"  .icon",[229,433,434],{"class":235}," {\n",[229,436,438,441,443,446],{"class":231,"line":437},11,[229,439,440],{"class":243},"    display",[229,442,359],{"class":235},[229,444,445],{"class":243},"grid",[229,447,448],{"class":235},";\n",[229,450,452,455,457,460],{"class":231,"line":451},12,[229,453,454],{"class":243},"    place-items",[229,456,359],{"class":235},[229,458,459],{"class":243},"center",[229,461,448],{"class":235},[229,463,465,468,470,473,475],{"class":231,"line":464},13,[229,466,467],{"class":243},"    inline-size",[229,469,359],{"class":235},[229,471,472],{"class":243},"3.5",[229,474,393],{"class":365},[229,476,448],{"class":235},[229,478,480,483,485,487,489],{"class":231,"line":479},14,[229,481,482],{"class":243},"    block-size",[229,484,359],{"class":235},[229,486,472],{"class":243},[229,488,393],{"class":365},[229,490,448],{"class":235},[229,492,494,497,499,501,503],{"class":231,"line":493},15,[229,495,496],{"class":243},"    border-radius",[229,498,359],{"class":235},[229,500,109],{"class":243},[229,502,366],{"class":365},[229,504,448],{"class":235},[229,506,508,511,513,516],{"class":231,"line":507},16,[229,509,510],{"class":243},"    background",[229,512,359],{"class":235},[229,514,515],{"class":243},"#6366f1",[229,517,448],{"class":235},[229,519,521,524,526,529],{"class":231,"line":520},17,[229,522,523],{"class":243},"    color",[229,525,359],{"class":235},[229,527,528],{"class":243},"#ffffff",[229,530,448],{"class":235},[229,532,534,537,539,541,543],{"class":231,"line":533},18,[229,535,536],{"class":243},"    font-size",[229,538,359],{"class":235},[229,540,112],{"class":243},[229,542,393],{"class":365},[229,544,448],{"class":235},[229,546,548],{"class":231,"line":547},19,[229,549,550],{"class":235},"  }\n",[229,552,554],{"class":231,"line":553},20,[229,555,425],{"emptyLinePlaceholder":424},[229,557,559],{"class":231,"line":558},21,[229,560,562],{"class":561},"sLBg1","  \u002F* BROKEN: both animations set transform; on hover the spin replaces the\n",[229,564,566],{"class":231,"line":565},22,[229,567,568],{"class":561},"     float, so the icon drops to its resting height while spinning. *\u002F\n",[229,570,572,575],{"class":231,"line":571},23,[229,573,574],{"class":243},"  .icon--broken",[229,576,434],{"class":235},[229,578,580,583,586,588,591,594,597,600],{"class":231,"line":579},24,[229,581,582],{"class":243},"    animation",[229,584,585],{"class":235},": float-transform ",[229,587,413],{"class":243},[229,589,590],{"class":365},"s",[229,592,593],{"class":243}," ease-in-out",[229,595,596],{"class":243}," infinite",[229,598,599],{"class":243}," alternate",[229,601,448],{"class":235},[229,603,605],{"class":231,"line":604},25,[229,606,550],{"class":235},[229,608,610,613],{"class":231,"line":609},26,[229,611,612],{"class":243},"  .icon--broken:hover",[229,614,434],{"class":235},[229,616,618,620,622,624,626,628,630,632],{"class":231,"line":617},27,[229,619,582],{"class":243},[229,621,585],{"class":235},[229,623,413],{"class":243},[229,625,590],{"class":365},[229,627,593],{"class":243},[229,629,596],{"class":243},[229,631,599],{"class":243},[229,633,634],{"class":235},",\n",[229,636,638,641,644,647,650,653,656,658,661,663,666,668,670],{"class":231,"line":637},28,[229,639,640],{"class":235},"               spin-transform ",[229,642,643],{"class":243},"600",[229,645,646],{"class":365},"ms",[229,648,649],{"class":243}," cubic-bezier",[229,651,652],{"class":235},"(",[229,654,655],{"class":243},"0.22",[229,657,195],{"class":235},[229,659,660],{"class":243},"1",[229,662,195],{"class":235},[229,664,665],{"class":243},"0.36",[229,667,195],{"class":235},[229,669,660],{"class":243},[229,671,672],{"class":235},");\n",[229,674,676],{"class":231,"line":675},29,[229,677,550],{"class":235},[229,679,681,684,688,690,693,695,697,699,702,704,707,709],{"class":231,"line":680},30,[229,682,683],{"class":365},"  @keyframes",[229,685,687],{"class":686},"soyes"," float-transform",[229,689,353],{"class":235},[229,691,692],{"class":243},"to",[229,694,353],{"class":235},[229,696,24],{"class":243},[229,698,359],{"class":235},[229,700,701],{"class":243},"translateY",[229,703,652],{"class":235},[229,705,706],{"class":243},"-8",[229,708,366],{"class":365},[229,710,711],{"class":235},"); } }\n",[229,713,715,717,720,723,725,727,729,731,733,735,737,740],{"class":231,"line":714},31,[229,716,683],{"class":365},[229,718,719],{"class":686}," spin-transform",[229,721,722],{"class":235},"  { ",[229,724,692],{"class":243},[229,726,353],{"class":235},[229,728,24],{"class":243},[229,730,359],{"class":235},[229,732,198],{"class":243},[229,734,652],{"class":235},[229,736,99],{"class":243},[229,738,739],{"class":365},"deg",[229,741,711],{"class":235},[229,743,745],{"class":231,"line":744},32,[229,746,425],{"emptyLinePlaceholder":424},[229,748,750],{"class":231,"line":749},33,[229,751,752],{"class":561},"  \u002F* FIXED: each animation owns its own individual property. *\u002F\n",[229,754,756,759],{"class":231,"line":755},34,[229,757,758],{"class":243},"  .icon--fixed",[229,760,434],{"class":235},[229,762,764,766,769,771,773,775,777,779],{"class":231,"line":763},35,[229,765,582],{"class":243},[229,767,768],{"class":235},": float ",[229,770,413],{"class":243},[229,772,590],{"class":365},[229,774,593],{"class":243},[229,776,596],{"class":243},[229,778,599],{"class":243},[229,780,448],{"class":235},[229,782,784],{"class":231,"line":783},36,[229,785,550],{"class":235},[229,787,789,792],{"class":231,"line":788},37,[229,790,791],{"class":243},"  .icon--fixed:hover",[229,793,434],{"class":235},[229,795,797,799,801,803,805,807,809,811],{"class":231,"line":796},38,[229,798,582],{"class":243},[229,800,768],{"class":235},[229,802,413],{"class":243},[229,804,590],{"class":365},[229,806,593],{"class":243},[229,808,596],{"class":243},[229,810,599],{"class":243},[229,812,634],{"class":235},[229,814,816,819,821,823,825,827,829,831,833,835,837,839,841],{"class":231,"line":815},39,[229,817,818],{"class":235},"               spin ",[229,820,643],{"class":243},[229,822,646],{"class":365},[229,824,649],{"class":243},[229,826,652],{"class":235},[229,828,655],{"class":243},[229,830,195],{"class":235},[229,832,660],{"class":243},[229,834,195],{"class":235},[229,836,665],{"class":243},[229,838,195],{"class":235},[229,840,660],{"class":243},[229,842,672],{"class":235},[229,844,846],{"class":231,"line":845},40,[229,847,550],{"class":235},[229,849,851,853,856,858,860,862,864,866,869,872,874],{"class":231,"line":850},41,[229,852,683],{"class":365},[229,854,855],{"class":686}," float",[229,857,353],{"class":235},[229,859,692],{"class":243},[229,861,353],{"class":235},[229,863,194],{"class":243},[229,865,359],{"class":235},[229,867,868],{"class":243},"0",[229,870,871],{"class":243}," -8",[229,873,366],{"class":365},[229,875,876],{"class":235},"; } }\n",[229,878,880,882,885,887,889,891,893,895,897,899],{"class":231,"line":879},42,[229,881,683],{"class":365},[229,883,884],{"class":686}," spin",[229,886,722],{"class":235},[229,888,692],{"class":243},[229,890,353],{"class":235},[229,892,198],{"class":243},[229,894,359],{"class":235},[229,896,99],{"class":243},[229,898,739],{"class":365},[229,900,876],{"class":235},[229,902,904],{"class":231,"line":903},43,[229,905,425],{"emptyLinePlaceholder":424},[229,907,909,912],{"class":231,"line":908},44,[229,910,911],{"class":365},"  @media",[229,913,914],{"class":235}," (prefers-reduced-motion: reduce) {\n",[229,916,918,921,923,926,928,931,933,935],{"class":231,"line":917},45,[229,919,920],{"class":243},"    .icon",[229,922,195],{"class":235},[229,924,925],{"class":243},".icon:hover",[229,927,353],{"class":235},[229,929,930],{"class":243},"animation",[229,932,359],{"class":235},[229,934,110],{"class":243},[229,936,418],{"class":235},[229,938,940],{"class":231,"line":939},46,[229,941,550],{"class":235},[229,943,945,948,950],{"class":231,"line":944},47,[229,946,947],{"class":235},"\u003C\u002F",[229,949,342],{"class":239},[229,951,247],{"class":235},[229,953,955,957,959],{"class":231,"line":954},48,[229,956,947],{"class":235},[229,958,275],{"class":239},[229,960,247],{"class":235},[229,962,964,966,969],{"class":231,"line":963},49,[229,965,253],{"class":235},[229,967,968],{"class":239},"body",[229,970,247],{"class":235},[229,972,974,977,980,983,985,988,991,993,996,999,1001],{"class":231,"line":973},50,[229,975,976],{"class":235},"  \u003C",[229,978,979],{"class":239},"div",[229,981,982],{"class":243}," class",[229,984,261],{"class":235},[229,986,987],{"class":264},"\"icon icon--broken\"",[229,989,990],{"class":243}," aria-hidden",[229,992,261],{"class":235},[229,994,995],{"class":264},"\"true\"",[229,997,998],{"class":235},">★\u003C\u002F",[229,1000,979],{"class":239},[229,1002,247],{"class":235},[229,1004,1006,1008,1010,1012,1014,1017,1019,1021,1023,1025,1027],{"class":231,"line":1005},51,[229,1007,976],{"class":235},[229,1009,979],{"class":239},[229,1011,982],{"class":243},[229,1013,261],{"class":235},[229,1015,1016],{"class":264},"\"icon icon--fixed\"",[229,1018,990],{"class":243},[229,1020,261],{"class":235},[229,1022,995],{"class":264},[229,1024,998],{"class":235},[229,1026,979],{"class":239},[229,1028,247],{"class":235},[229,1030,1032,1034,1036],{"class":231,"line":1031},52,[229,1033,947],{"class":235},[229,1035,968],{"class":239},[229,1037,247],{"class":235},[229,1039,1041,1043,1045],{"class":231,"line":1040},53,[229,1042,947],{"class":235},[229,1044,224],{"class":239},[229,1046,247],{"class":235},[19,1048,1049,1050,1052,1053,70,1055,1057],{},"Hover each icon. The broken one snaps down to its resting height as the spin begins, because the spin's ",[15,1051,24],{}," replaces the float's. The fixed one keeps floating while it spins, because ",[15,1054,194],{},[15,1056,198],{}," are separate properties with separate animation values.",[19,1059,1060,1061,1063],{},"One caveat applies to the hover pattern itself: re-declaring ",[15,1062,930],{}," in the hover state restarts every animation in the list, including the float. The restart is barely noticeable here because the float is gentle, but for more prominent loops, keep the loop on a wrapper element and the hover effect on the child, so the loop is never re-declared.",[41,1065,1067,1068,1070],{"id":1066},"the-key-technique-animation-composition-for-shared-properties","The key technique: ",[15,1069,17],{}," for shared properties",[19,1072,1073,1074,1076,1077,1080,1081,1083,1084,1086],{},"Sometimes separate properties are not enough. Two effects may both need ",[15,1075,201],{}," — a continuous breathing pulse and a one-off pop on click — or both need ",[15,1078,1079],{},"filter",", or the element's own ",[15,1082,24],{}," must be preserved while an animation adds to it. ",[15,1085,17],{}," tells the browser to combine an animation's value with the underlying value instead of replacing it.",[79,1088,86,1091,86,1094,86,1097,86,1100,86,1106,86,1111,86,1115,86,1119,86,1121,86,1124,86,1127,86,1130,86,1133,86,1137,86,1140,86,1143],{"viewBox":1089,"role":82,"ariaLabel":1090,"xmlns":84,"style":85},"0 0 720 280","Underlying value plus animation value under replace, add and accumulate, shown for a scale property",[88,1092,1093],{},"replace, add and accumulate on scale",[92,1095,1096],{},"An element with an underlying scale of 1.1 runs an animation to scale 1.2. replace gives 1.2. add appends scale transforms, giving 1.1 times 1.2, about 1.32. accumulate adds the scale deltas, giving about 1.3.",[96,1098,1099],{"textAnchor":98,"x":99,"y":100,"style":101},"Underlying scale 1.1, animation to 1.2",[104,1101],{"x":1102,"y":1103,"width":108,"height":1104,"rx":109,"fill":110,"stroke":111,"strokeWidth":112,"opacity":1105},"40","56","150","0.6",[96,1107,55],{"textAnchor":98,"x":1108,"y":1109,"style":1110},"140","86","text-anchor:middle;fill:currentColor;font:700 13px ui-monospace,monospace",[96,1112,1114],{"textAnchor":98,"x":1108,"y":119,"style":1113},"text-anchor:middle;fill:currentColor;font:600 20px sans-serif","1.2",[96,1116,1118],{"textAnchor":98,"x":1108,"y":1117,"style":140},"170","underlying ignored",[104,1120],{"x":144,"y":1103,"width":108,"height":1104,"rx":109,"fill":145,"opacity":146},[96,1122,1123],{"textAnchor":98,"x":99,"y":1109,"style":1110},"add",[96,1125,1126],{"textAnchor":98,"x":99,"y":119,"style":1113},"≈ 1.32",[96,1128,1129],{"textAnchor":98,"x":99,"y":1117,"style":140},"1.1 × 1.2, applied in turn",[104,1131],{"x":1132,"y":1103,"width":108,"height":1104,"rx":109,"fill":145,"opacity":165},"480",[96,1134,1136],{"textAnchor":98,"x":1135,"y":1109,"style":1110},"580","accumulate",[96,1138,1139],{"textAnchor":98,"x":1135,"y":119,"style":1113},"≈ 1.3",[96,1141,1142],{"textAnchor":98,"x":1135,"y":1117,"style":140},"deltas summed: 1 + 0.1 + 0.2",[96,1144,1146],{"textAnchor":98,"x":99,"y":1145,"style":140},"250","For translate and rotate, add and accumulate give the same visible result.",[1148,1149,1150,1159,1166],"ul",{},[1151,1152,1153,1158],"li",{},[1154,1155,1156],"strong",{},[15,1157,55],{}," (default) — the animation's value replaces the underlying value.",[1151,1160,1161,1165],{},[1154,1162,1163],{},[15,1164,1123],{}," — the animation's value is added to the underlying value. For transforms, the lists are concatenated, so both are applied in sequence.",[1151,1167,1168,1172],{},[1154,1169,1170],{},[15,1171,1136],{}," — the values are combined numerically. Scale factors combine by adding their differences from 1, lengths and angles simply sum.",[19,1174,1175],{},"The underlying value is whatever the property would be without this animation: the element's own style, plus any animations earlier in the list. That makes composition a way to layer effects in a controlled order.",[220,1177,1181],{"className":1178,"code":1179,"language":1180,"meta":225,"style":225},"language-css shiki shiki-themes github-light-high-contrast github-dark-high-contrast",".badge {\n  scale: 1;\n  animation:\n    breathe 2.4s ease-in-out infinite alternate,\n    pop 300ms cubic-bezier(0.34, 1.56, 0.64, 1) var(--pop-delay, 0s) both;\n  \u002F* The second animation adds to whatever the first produces. *\u002F\n  animation-composition: replace, add;\n}\n\n@keyframes breathe { to { scale: 1.06; } }\n@keyframes pop     { 50% { scale: 1.25; } }\n\n@media (prefers-reduced-motion: reduce) {\n  .badge { animation: none; }\n}\n","css",[15,1182,1183,1190,1201,1209,1227,1282,1287,1299,1304,1308,1331,1355,1359,1366,1381],{"__ignoreMap":225},[229,1184,1185,1188],{"class":231,"line":232},[229,1186,1187],{"class":243},".badge",[229,1189,434],{"class":235},[229,1191,1192,1195,1197,1199],{"class":231,"line":250},[229,1193,1194],{"class":243},"  scale",[229,1196,359],{"class":235},[229,1198,660],{"class":243},[229,1200,448],{"class":235},[229,1202,1203,1206],{"class":231,"line":270},[229,1204,1205],{"class":243},"  animation",[229,1207,1208],{"class":235},":\n",[229,1210,1211,1214,1217,1219,1221,1223,1225],{"class":231,"line":280},[229,1212,1213],{"class":235},"    breathe ",[229,1215,1216],{"class":243},"2.4",[229,1218,590],{"class":365},[229,1220,593],{"class":243},[229,1222,596],{"class":243},[229,1224,599],{"class":243},[229,1226,634],{"class":235},[229,1228,1229,1232,1235,1237,1239,1241,1244,1246,1249,1251,1254,1256,1258,1261,1264,1266,1269,1271,1273,1275,1277,1280],{"class":231,"line":298},[229,1230,1231],{"class":235},"    pop ",[229,1233,1234],{"class":243},"300",[229,1236,646],{"class":365},[229,1238,649],{"class":243},[229,1240,652],{"class":235},[229,1242,1243],{"class":243},"0.34",[229,1245,195],{"class":235},[229,1247,1248],{"class":243},"1.56",[229,1250,195],{"class":235},[229,1252,1253],{"class":243},"0.64",[229,1255,195],{"class":235},[229,1257,660],{"class":243},[229,1259,1260],{"class":235},") ",[229,1262,1263],{"class":243},"var",[229,1265,652],{"class":235},[229,1267,1268],{"class":686},"--pop-delay",[229,1270,195],{"class":235},[229,1272,868],{"class":243},[229,1274,590],{"class":365},[229,1276,1260],{"class":235},[229,1278,1279],{"class":243},"both",[229,1281,448],{"class":235},[229,1283,1284],{"class":231,"line":323},[229,1285,1286],{"class":561},"  \u002F* The second animation adds to whatever the first produces. *\u002F\n",[229,1288,1289,1292,1295,1297],{"class":231,"line":337},[229,1290,1291],{"class":243},"  animation-composition",[229,1293,1294],{"class":235},": replace, ",[229,1296,1123],{"class":243},[229,1298,448],{"class":235},[229,1300,1301],{"class":231,"line":347},[229,1302,1303],{"class":235},"}\n",[229,1305,1306],{"class":231,"line":421},[229,1307,425],{"emptyLinePlaceholder":424},[229,1309,1310,1313,1316,1318,1320,1322,1324,1326,1329],{"class":231,"line":428},[229,1311,1312],{"class":365},"@keyframes",[229,1314,1315],{"class":686}," breathe",[229,1317,353],{"class":235},[229,1319,692],{"class":243},[229,1321,353],{"class":235},[229,1323,201],{"class":243},[229,1325,359],{"class":235},[229,1327,1328],{"class":243},"1.06",[229,1330,876],{"class":235},[229,1332,1333,1335,1338,1341,1344,1346,1348,1350,1353],{"class":231,"line":437},[229,1334,1312],{"class":365},[229,1336,1337],{"class":686}," pop",[229,1339,1340],{"class":235},"     { ",[229,1342,1343],{"class":243},"50%",[229,1345,353],{"class":235},[229,1347,201],{"class":243},[229,1349,359],{"class":235},[229,1351,1352],{"class":243},"1.25",[229,1354,876],{"class":235},[229,1356,1357],{"class":231,"line":451},[229,1358,425],{"emptyLinePlaceholder":424},[229,1360,1361,1364],{"class":231,"line":464},[229,1362,1363],{"class":365},"@media",[229,1365,914],{"class":235},[229,1367,1368,1371,1373,1375,1377,1379],{"class":231,"line":479},[229,1369,1370],{"class":243},"  .badge",[229,1372,353],{"class":235},[229,1374,930],{"class":243},[229,1376,359],{"class":235},[229,1378,110],{"class":243},[229,1380,418],{"class":235},[229,1382,1383],{"class":231,"line":493},[229,1384,1303],{"class":235},[19,1386,1387,1389,1390,1393,1394,1397],{},[15,1388,17],{}," is a list like the other animation longhands, paired by index with ",[15,1391,1392],{},"animation-name",". Here the breathing loop replaces the element's resting scale as usual, and the pop ",[53,1395,1396],{},"adds"," on top of it, so the pop starts from wherever the breathing currently is rather than snapping to a fixed scale.",[41,1399,1401],{"id":1400},"order-of-application","Order of application",[19,1403,1404,1405,1407],{},"When several transform sources apply to one element — the individual properties, the ",[15,1406,24],{}," property, and several animations with different composite modes — the result depends on a fixed order, and it helps to know it when effects combine unexpectedly.",[19,1409,1410,1411,1413,1414,1416,1417,1419,1420,1422,1423,1426,1427,1429,1430,1432],{},"The individual properties are always applied in the same sequence: ",[15,1412,194],{}," first, then ",[15,1415,198],{},", then ",[15,1418,201],{},", and finally whatever ",[15,1421,24],{}," contains. Because transforms compose right to left in their effect on the element's coordinate space, that sequence means scaling happens around the element's own origin ",[53,1424,1425],{},"before"," it is rotated and moved, which is almost always what designers expect. It is why a card can scale up on hover with ",[15,1428,201],{}," while an unrelated animation moves it with ",[15,1431,194],{},", without the move distance being scaled.",[19,1434,1435,1436,1438,1439,1441,1442,1444,1445,1447,1448,1450,1451,1454],{},"Within a single property, animations are layered in the order they appear in the ",[15,1437,1392],{}," list, each composing onto the result of those before it according to its own ",[15,1440,17],{}," value. A ",[15,1443,55],{}," animation later in the list discards everything below it for that property; an ",[15,1446,1123],{}," animation builds on it. Putting the \"base\" loop first and the momentary effects after it, with ",[15,1449,1123],{},", gives the intuitive result that momentary effects happen ",[53,1452,1453],{},"on top of"," the loop.",[19,1456,1457,1458,1460,1461,1463,1464,1466],{},"Transitions sit below animations in this stack. A transitioning ",[15,1459,194],{}," provides the underlying value for any animation on ",[15,1462,194],{},", so an ",[15,1465,1123],{}," animation can bob an element while a transition slides it to a new position — both visible.",[41,1468,1470],{"id":1469},"composition-beyond-transforms","Composition beyond transforms",[19,1472,1473],{},"Composition applies to any animatable property, which enables layering that would otherwise need extra wrapper elements:",[1148,1475,1476,1488,1497],{},[1151,1477,1478,1481,1482,1484,1485,1487],{},[1154,1479,1480],{},"Filters."," A continuous hue shift and a one-off brightness flash both on ",[15,1483,1079],{}," can coexist with ",[15,1486,1123],{},", since filter lists concatenate.",[1151,1489,1490,1493,1494,1496],{},[1154,1491,1492],{},"Colours and lengths."," With ",[15,1495,1136],{},", an animation can nudge a length relative to the element's current value — \"8px more than whatever the layout gave it\" — rather than to a fixed number.",[1151,1498,1499,1502,1503,1505,1506,1508,1509,1513],{},[1154,1500,1501],{},"Scroll-driven plus time-based."," A scroll-linked parallax on ",[15,1504,194],{}," and a hover lift on the same property can combine with ",[15,1507,1123],{},", so hovering a card mid-scroll lifts it from its scrolled position. ",[30,1510,1512],{"href":1511},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects\u002F","Scroll-Driven Parallax Effects"," uses this combination.",[19,1515,1516],{},"Composition does not replace good structure. When effects belong to conceptually different things — a card's position in a list and a hover affordance — separate elements or separate properties remain clearer. Composition is for effects that truly modify the same visual quality.",[41,1518,1520],{"id":1519},"browser-support","Browser support",[19,1522,1523,1524,195,1526,70,1528,1530,1531,1533],{},"The individual ",[15,1525,194],{},[15,1527,198],{},[15,1529,201],{}," properties are supported in Chrome and Edge 104+, Firefox 72+ and Safari 14.1+. ",[15,1532,17],{}," is supported in current versions of Chrome, Edge, Firefox and Safari; in an engine without it, the declaration is ignored and animations replace each other as before, so layered effects degrade to the later animation only. Running multiple animations on one element via a comma-separated list has been supported since CSS animations were introduced: Chrome 43, Edge 12, Firefox 16, Safari 9.",[41,1535,1537],{"id":1536},"faq","FAQ",[19,1539,1540,1543,1544,1546,1547,1550,1551,1553],{},[1154,1541,1542],{},"What happens when two animations target the same property?","\nBy default the later animation in the ",[15,1545,1392],{}," list replaces the earlier one's value for that property, so only one effect is visible. ",[15,1548,1549],{},"animation-composition: add"," or ",[15,1552,1136],{}," changes that, combining the values instead.",[19,1555,1556,1564,1566,1567,1569],{},[1154,1557,1558,1559,70,1561,1563],{},"What is the difference between ",[15,1560,1123],{},[15,1562,1136],{},"?",[15,1565,1123],{}," appends values where the property allows lists, so two transforms become one longer transform list applied in sequence. ",[15,1568,1136],{}," combines values numerically, adding lengths, angles and scale factors together. For most transforms both look similar; for filters and scale they can differ.",[19,1571,1572,1578,1579,195,1581,70,1583,1585,1586,1588],{},[1154,1573,1574,1575,1577],{},"Can I avoid ",[15,1576,17],{}," by using separate properties?","\nOften yes. The individual transform properties ",[15,1580,194],{},[15,1582,198],{},[15,1584,201],{}," each animate independently, so a bobbing translate animation and a spinning rotate animation never conflict. Reach for ",[15,1587,17],{}," when both effects genuinely need the same property.",[19,1590,1591,1597,1598,70,1600,1603],{},[1154,1592,1593,1594,1596],{},"Does ",[15,1595,17],{}," affect performance?","\nNo meaningful difference. Composited properties such as ",[15,1599,24],{},[15,1601,1602],{},"opacity"," remain on the compositor whether their values are replaced or combined.",[41,1605,1607],{"id":1606},"related","Related",[1148,1609,1610,1615,1622,1629],{},[1151,1611,1612,1614],{},[30,1613,33],{"href":32}," — the parent guide.",[1151,1616,1617,1621],{},[30,1618,1620],{"href":1619},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-fill-mode-explained\u002F","animation-fill-mode: none, forwards, both"," — what stacked animations leave behind.",[1151,1623,1624,1628],{},[30,1625,1627],{"href":1626},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fwill-change-and-the-compositor-thread\u002F","Will-Change and the Compositor Thread"," — why these stay smooth.",[1151,1630,1631,1635],{},[30,1632,1634],{"href":1633},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-that-scales-with-container-size\u002F","Motion That Scales With Container Size"," — composing size-aware motion.",[342,1637,1638],{},"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":225,"searchDepth":250,"depth":250,"links":1640},[1641,1642,1643,1645,1646,1647,1648,1649],{"id":43,"depth":250,"text":44},{"id":187,"depth":250,"text":188},{"id":1066,"depth":250,"text":1644},"The key technique: animation-composition for shared properties",{"id":1400,"depth":250,"text":1401},{"id":1469,"depth":250,"text":1470},{"id":1519,"depth":250,"text":1520},{"id":1536,"depth":250,"text":1537},{"id":1606,"depth":250,"text":1607},"Run several animations on one property without overwriting each other: animation-composition add and accumulate, individual transform properties and layering.","md",{"pageTitle":5,"datePublished":1653,"dateModified":1653,"faq":1654},"2026-09-18",[1655,1657,1660,1663],{"q":1542,"a":1656},"By default the later animation in the animation-name list replaces the earlier one's value for that property, so only one effect is visible. animation-composition: add or accumulate changes that, combining the values instead.",{"q":1658,"a":1659},"What is the difference between add and accumulate?","add appends values where the property allows lists, so two transforms become one longer transform list applied in sequence. accumulate combines values numerically, adding lengths, angles and scale factors together. For most transforms both look similar; for filters and scale they can differ.",{"q":1661,"a":1662},"Can I avoid animation-composition by using separate properties?","Often yes. The individual transform properties translate, rotate and scale each animate independently, so a bobbing translate animation and a spinning rotate animation never conflict. Reach for animation-composition when both effects genuinely need the same property.",{"q":1664,"a":1665},"Does animation-composition affect performance?","No meaningful difference. Composited properties such as transform and opacity remain on the compositor whether their values are replaced or combined.","\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking",{"title":5,"description":1650},"css-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking\u002Findex","beyZBuD4_Z9VNj-xIfmIzpeyVHnBEhcrNsIOS3T1QgU",[1671,1674,1677,1680,1683,1686,1689,1692,1695,1698,1701,1704,1707,1710,1713,1716,1719,1722,1725,1728,1731,1734,1737,1740,1743,1746,1749,1752,1755,1758,1761,1764,1767,1770,1773,1776,1779,1782,1785,1788,1791,1794,1797,1800,1803,1806,1809,1812,1815,1818,1821,1824,1827,1830,1833,1836,1839,1842,1845,1848,1851,1854,1857,1860,1861,1864,1867,1870,1873,1876,1879,1882,1885,1888,1891,1894,1897,1900,1903,1906,1909,1912,1915,1918,1921,1924,1927,1930,1933,1936,1939,1942,1945,1948,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,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],{"path":1672,"title":1673},"\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":1675,"title":1676},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":1678,"title":1679},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":1681,"title":1682},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":1684,"title":1685},"\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":1687,"title":1688},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":1690,"title":1691},"\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":1693,"title":1694},"\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":1696,"title":1697},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":1699,"title":1700},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":1702,"title":1703},"\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":1705,"title":1706},"\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":1708,"title":1709},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":1711,"title":1712},"\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":1714,"title":1715},"\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":1717,"title":1718},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":1720,"title":1721},"\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":1723,"title":1724},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":1726,"title":1727},"\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":1729,"title":1730},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":1732,"title":1733},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":1735,"title":1736},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":1738,"title":1739},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":1741,"title":1742},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":1744,"title":1745},"\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":1747,"title":1748},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":1750,"title":1751},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":1753,"title":1754},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":1756,"title":1757},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":1759,"title":1760},"\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":1762,"title":1763},"\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":1765,"title":1766},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":1768,"title":1769},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":1771,"title":1772},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":1774,"title":1775},"\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":1777,"title":1778},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":1780,"title":1781},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":1783,"title":1784},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":1786,"title":1787},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":1789,"title":1790},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":1792,"title":1793},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":1795,"title":1796},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":1798,"title":1799},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":1801,"title":1802},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":1804,"title":1805},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"path":1807,"title":1808},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":1810,"title":1811},"\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":1813,"title":1814},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":1816,"title":1817},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":1819,"title":1820},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":1822,"title":1823},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":1825,"title":1826},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":1828,"title":1829},"\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":1831,"title":1832},"\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":1834,"title":1835},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":1837,"title":1838},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states","Button Press and  States",{"path":1840,"title":1841},"\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":1843,"title":1844},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":1846,"title":1847},"\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":1849,"title":1850},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":1852,"title":1853},"\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":1855,"title":1856},"\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":1858,"title":1859},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":1666,"title":5},{"path":1862,"title":1863},"\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":1865,"title":1866},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":1868,"title":1869},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":1871,"title":1872},"\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":1874,"title":1875},"\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":1877,"title":1878},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":1880,"title":1881},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":1883,"title":1884},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":1886,"title":1887},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply","Animating box-shadow and Filters Cheaply",{"path":1889,"title":1890},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":1892,"title":1893},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite","Layout, Paint and Composite: What Triggers What",{"path":1895,"title":1896},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":1898,"title":1899},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":1901,"title":1902},"\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":1904,"title":1905},"\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":1907,"title":1908},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":1910,"title":1911},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":1913,"title":1914},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects","Scroll-Driven Parallax Effects in CSS",{"path":1916,"title":1917},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":1919,"title":1920},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":1922,"title":1923},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":1925,"title":1926},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range","View Timelines and animation-range",{"path":1928,"title":1929},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":1931,"title":1932},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":1934,"title":1935},"\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":1937,"title":1938},"\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":1940,"title":1941},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":1943,"title":1944},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":1946,"title":1947},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":369,"title":1949},"Modern CSS Layouts & Micro-Interactions",{"path":1951,"title":1952},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":1954,"title":1955},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":1957,"title":1958},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":1960,"title":1961},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":1963,"title":1964},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":1966,"title":1967},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":1969,"title":1970},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":1972,"title":1973},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":1975,"title":1976},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":1978,"title":1979},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":1981,"title":1982},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":1984,"title":1985},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":1987,"title":1988},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":1990,"title":1991},"\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":1993,"title":1994},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":1996,"title":1997},"\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":1999,"title":2000},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":2002,"title":2003},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":2005,"title":2006},"\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":2008,"title":2009},"\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":2011,"title":2012},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics","Container Query Syntax Basics",{"path":2014,"title":2015},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":2017,"title":2018},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":2020,"title":2021},"\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":2023,"title":2024},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":2026,"title":2027},"\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":2029,"title":2030},"\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":2032,"title":2033},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":2035,"title":2036},"\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":2038,"title":2039},"\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":2041,"title":2042},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":2044,"title":2045},"\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":2047,"title":2048},"\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":2050,"title":2051},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":2053,"title":2054},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":2056,"title":2057},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":2059,"title":2060},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":2062,"title":2063},"\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":2065,"title":2066},"\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":2068,"title":2069},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":2071,"title":2072},"\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":2074,"title":2075},"\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":2077,"title":2078},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":2080,"title":2081},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":2083,"title":2084},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":2086,"title":2087},"\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":2089,"title":2090},"\u002Fmastering-container-queries-responsive-layouts","Mastering Container Queries & Responsive Layouts",{"path":2092,"title":2093},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":2095,"title":2096},"\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":2098,"title":2099},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":2101,"title":2102},"\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":2104,"title":2105},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":2107,"title":2108},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":2110,"title":2111},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":2113,"title":2114},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":2116,"title":2117},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":2119,"title":2120},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":2122,"title":2123},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":2125,"title":2126},"\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":2128,"title":2129},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset","Writing a Minimal Modern CSS Reset: Every Line Justified",{"path":2131,"title":2132},"\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":2134,"title":2135},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has","Empty and Loading States With ()",{"path":2137,"title":2138},"\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":2140,"title":2141},"\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":2143,"title":2144},"\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":2146,"title":2147},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"path":2149,"title":2150},"\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":2152,"title":2153},"\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":2155,"title":2156},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":2158,"title":2159},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":2161,"title":2162},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":2164,"title":2165},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":2167,"title":2168},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":2170,"title":2171},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":2173,"title":2174},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":2176,"title":2177},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions","Tabs That Become an Accordion: One Component, Two Layouts",{"path":2179,"title":2180},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":2182,"title":2183},"\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":2185,"title":2186},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":2188,"title":2189},"\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":2191,"title":2192},"\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":2194,"title":2195},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":2197,"title":2198},"\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":2200,"title":2201},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":2203,"title":2204},"\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":2206,"title":2207},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":2209,"title":2210},"\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":2212,"title":2213},"\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":2215,"title":2216},"\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":2218,"title":2219},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":2221,"title":2222},"\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":2224,"title":2225},"\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":2227,"title":2228},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":2230,"caption":2231,"height":2232,"html":2233,"css":2234},"Two animations sharing transform versus separate properties","Both icons float. Hover each: the left one drops to its resting height while it spins; the right one keeps floating as it spins.",180,"\n\u003Cdiv class=\"pair\">\n  \u003Cdiv class=\"icon icon--broken\" aria-hidden=\"true\">★\u003C\u002Fdiv>\n  \u003Cdiv class=\"icon icon--fixed\" aria-hidden=\"true\">★\u003C\u002Fdiv>\n\u003C\u002Fdiv>","\n.pair { display: flex; gap: 3rem; }\n.icon { display: grid; place-items: center; inline-size: 3.5rem; block-size: 3.5rem; border-radius: 12px; background: #6366f1; color: #ffffff; font-size: 1.5rem; }\n.icon--broken { animation: float-transform 3s ease-in-out infinite alternate; }\n.icon--broken:hover { animation: float-transform 3s ease-in-out infinite alternate, spin-transform 600ms cubic-bezier(0.22, 1, 0.36, 1); }\n@keyframes float-transform { to { transform: translateY(-8px); } }\n@keyframes spin-transform { to { transform: rotate(360deg); } }\n.icon--fixed { animation: float 3s ease-in-out infinite alternate; }\n.icon--fixed:hover { animation: float 3s ease-in-out infinite alternate, spin 600ms cubic-bezier(0.22, 1, 0.36, 1); }\n@keyframes float { to { translate: 0 -8px; } }\n@keyframes spin { to { rotate: 360deg; } }\n@media (prefers-reduced-motion: reduce) { .icon, .icon:hover { animation: none; } }",1789717749473]