[{"data":1,"prerenderedAt":2087},["ShallowReactive",2],{"page-\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply":3,"content-all-pages":1523,"live-demo:cheap-shadow-glow":2081},{"id":4,"title":5,"body":6,"description":1506,"extension":1507,"meta":1508,"navigation":394,"path":1519,"seo":1520,"stem":1521,"__hash__":1522},"content\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply\u002Findex.md","Animating box-shadow and Filters Cheaply",{"type":7,"value":8,"toc":1494},"minimark",[9,13,28,33,49,141,145,148,152,1215,1234,1238,1241,1295,1305,1309,1312,1328,1332,1351,1355,1373,1377,1396,1400,1422,1426,1436,1442,1448,1457,1461,1491],[10,11,5],"h1",{"id":12},"animating-box-shadow-and-filters-cheaply",[14,15,16,17,22,23,27],"p",{},"Shadows and filters make interfaces feel physical: a card lifts on hover, a button glows when focused, a background blurs behind a dialog. They are also among the most expensive things to animate, because each frame changes pixels the browser must repaint — and blurred pixels are costly to compute. Performance advice often says \"only animate transform and opacity\", which sounds like a ban on these effects. It is not. With a few techniques, every one of them can be expressed as an opacity or transform change over something painted once. This page shows those techniques and when each is worth the extra markup. It belongs to ",[18,19,21],"a",{"href":20},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002F","Performance & GPU Acceleration"," in the ",[18,24,26],{"href":25},"\u002Fcss-only-micro-interactions-animations\u002F","CSS-Only Micro-Interactions & Animations"," guide.",[29,30,32],"h2",{"id":31},"why-these-effects-are-costly","Why these effects are costly",[14,34,35,36,40,41,44,45,48],{},"A ",[37,38,39],"code",{},"box-shadow"," with a blur radius is rasterised by drawing the shape and blurring it; the cost grows with the blur radius and the area covered. When the shadow's offset, blur or colour changes, the browser repaints it. ",[37,42,43],{},"filter: blur()"," blurs the element's own pixels, and ",[37,46,47],{},"backdrop-filter"," blurs whatever lies behind the element — which must be recomputed whenever that background changes. None of these can be animated by simply moving an existing layer, so they fall back to paint on every frame.",[50,51,57,58,57,62,57,66,57,74,57,84,57,87,57,90,57,98,57,103,57,109,57,113,57,117,57,121,57,125,57,127,57,130,57,135,57,138],"svg",{"viewBox":52,"role":53,"ariaLabel":54,"xmlns":55,"style":56},"0 0 720 280","img","Cost comparison for three effects: an animated box-shadow repaints each frame, an animated blur filter re-blurs each frame, and a backdrop-filter re-blurs whenever the content behind changes","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[59,60,61],"title",{},"Three effects, three per-frame costs",[63,64,65],"desc",{},"Three cards. The first shows a shadow growing, labelled repaint shadow every frame. The second shows content going from sharp to blurred, labelled re-blur pixels every frame. The third shows a frosted panel over scrolling content, labelled re-blur backdrop whenever content behind moves.",[67,68,73],"text",{"textAnchor":69,"x":70,"y":71,"style":72},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","Why shadows and blurs are paint-bound",[75,76],"rect",{"x":77,"y":78,"width":79,"height":80,"rx":81,"fill":82,"opacity":83},"40","60","190","150","10","currentColor","0.08",[75,85],{"x":86,"y":78,"width":79,"height":80,"rx":81,"fill":82,"opacity":83},"265",[75,88],{"x":89,"y":78,"width":79,"height":80,"rx":81,"fill":82,"opacity":83},"490",[75,91],{"x":92,"y":93,"width":94,"height":78,"rx":95,"fill":96,"opacity":97},"85","95","100","8","#7aa2ff","0.45",[99,100],"path",{"d":101,"fill":82,"opacity":102},"M81 159 H189 V167 H81 Z","0.2",[104,105],"circle",{"cx":70,"cy":106,"r":107,"fill":96,"opacity":108},"125","32","0.25",[104,110],{"cx":70,"cy":106,"r":111,"fill":96,"opacity":112},"20","0.5",[99,114],{"d":115,"fill":82,"opacity":116},"M510 84 H660 V102 H510 Z M510 110 H660 V128 H510 Z M510 136 H660 V154 H510 Z","0.18",[99,118],{"d":119,"fill":96,"opacity":120},"M530 96 H640 V146 H530 Z","0.35",[67,122,39],{"textAnchor":69,"x":123,"y":79,"style":124},"135","text-anchor:middle;fill:currentColor;font:12px ui-monospace,monospace",[67,126,43],{"textAnchor":69,"x":70,"y":79,"style":124},[67,128,47],{"textAnchor":69,"x":129,"y":79,"style":124},"585",[67,131,134],{"textAnchor":69,"x":123,"y":132,"style":133},"240","text-anchor:middle;fill:currentColor;font:12px sans-serif","repaint every frame",[67,136,137],{"textAnchor":69,"x":70,"y":132,"style":133},"re-blur every frame",[67,139,140],{"textAnchor":69,"x":129,"y":132,"style":133},"re-blur as content moves",[29,142,144],{"id":143},"the-complete-implementation","The complete implementation",[14,146,147],{},"Two effects in one demo: a card that lifts on hover, and a glow on focus. Both use pre-painted layers whose opacity is animated.",[149,150],"live-demo",{"name":151},"cheap-shadow-glow",[153,154,159],"pre",{"className":155,"code":156,"language":157,"meta":158,"style":158},"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>Cheap shadows and glows\u003C\u002Ftitle>\n\u003Cstyle>\n  body { font: 15px\u002F1.5 system-ui, sans-serif; margin: 2rem; display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }\n\n  \u002F* Elevation: a resting shadow plus a pre-painted \"lifted\" shadow. *\u002F\n  .card {\n    position: relative;\n    padding: 1.25rem;\n    border-radius: 12px;\n    background: #fff;\n    box-shadow: 0 1px 3px rgb(0 0 0 \u002F 0.12);   \u002F* static, painted once *\u002F\n    transition: translate 200ms cubic-bezier(0.2, 0, 0, 1);\n  }\n  .card::after {\n    content: \"\";\n    position: absolute;\n    inset: 0;\n    border-radius: inherit;\n    box-shadow: 0 14px 30px rgb(0 0 0 \u002F 0.2);  \u002F* the lifted shadow *\u002F\n    pointer-events: none;\n    opacity: 0;\n    transition: opacity 200ms cubic-bezier(0.2, 0, 0, 1);\n  }\n  .card:hover { translate: 0 -3px; }\n  .card:hover::after { opacity: 1; }\n\n  \u002F* Glow: a soft halo painted once, faded in on hover and focus. *\u002F\n  .glow-btn {\n    position: relative;\n    padding: 0.75rem 1.25rem;\n    border: 0;\n    border-radius: 999px;\n    background: #7c3aed;\n    color: #fff;\n    font: inherit;\n  }\n  .glow-btn::before {\n    content: \"\";\n    position: absolute;\n    inset: 0;\n    border-radius: inherit;\n    box-shadow: 0 0 18px 6px #a78bfa;   \u002F* rasterised once; never animated *\u002F\n    pointer-events: none;\n    opacity: 0;\n    transition: opacity 180ms ease-out;\n  }\n  .glow-btn:focus-visible { outline: 2px solid #4c1d95; outline-offset: 3px; }\n  .glow-btn:focus-visible::before,\n  .glow-btn:hover::before { opacity: 0.8; }\n\n  @media (prefers-reduced-motion: reduce) {\n    .card:hover { translate: none; }\n  }\n\u003C\u002Fstyle>\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Carticle class=\"card\">\u003Ch3>Lifted card\u003C\u002Fh3>\u003Cp>Hover me.\u003C\u002Fp>\u003C\u002Farticle>\n  \u003Cbutton class=\"glow-btn\" type=\"button\">Glowing button\u003C\u002Fbutton>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n","html","",[37,160,161,181,201,211,229,254,268,278,389,396,403,412,426,441,455,468,513,550,556,564,577,589,601,613,652,665,677,709,714,737,754,759,765,773,784,803,815,829,841,853,865,870,878,889,900,911,922,952,963,974,991,996,1033,1042,1059,1064,1073,1089,1094,1104,1113,1123,1167,1197,1206],{"__ignoreMap":158},[162,163,166,170,174,178],"span",{"class":164,"line":165},"line",1,[162,167,169],{"class":168},"suds8","\u003C!",[162,171,173],{"class":172},"sne4z","doctype",[162,175,177],{"class":176},"s-5SL"," html",[162,179,180],{"class":168},">\n",[162,182,184,187,189,192,195,199],{"class":164,"line":183},2,[162,185,186],{"class":168},"\u003C",[162,188,157],{"class":172},[162,190,191],{"class":176}," lang",[162,193,194],{"class":168},"=",[162,196,198],{"class":197},"sT6z2","\"en\"",[162,200,180],{"class":168},[162,202,204,206,209],{"class":164,"line":203},3,[162,205,186],{"class":168},[162,207,208],{"class":172},"head",[162,210,180],{"class":168},[162,212,214,216,219,222,224,227],{"class":164,"line":213},4,[162,215,186],{"class":168},[162,217,218],{"class":172},"meta",[162,220,221],{"class":176}," charset",[162,223,194],{"class":168},[162,225,226],{"class":197},"\"utf-8\"",[162,228,180],{"class":168},[162,230,232,234,236,239,241,244,247,249,252],{"class":164,"line":231},5,[162,233,186],{"class":168},[162,235,218],{"class":172},[162,237,238],{"class":176}," name",[162,240,194],{"class":168},[162,242,243],{"class":197},"\"viewport\"",[162,245,246],{"class":176}," content",[162,248,194],{"class":168},[162,250,251],{"class":197},"\"width=device-width, initial-scale=1\"",[162,253,180],{"class":168},[162,255,257,259,261,264,266],{"class":164,"line":256},6,[162,258,186],{"class":168},[162,260,59],{"class":172},[162,262,263],{"class":168},">Cheap shadows and glows\u003C\u002F",[162,265,59],{"class":172},[162,267,180],{"class":168},[162,269,271,273,276],{"class":164,"line":270},7,[162,272,186],{"class":168},[162,274,275],{"class":172},"style",[162,277,180],{"class":168},[162,279,281,284,287,290,293,296,300,303,306,309,312,315,318,321,323,326,329,331,334,336,339,341,344,346,348,350,352,355,357,360,363,366,368,371,373,376,378,380,383,386],{"class":164,"line":280},8,[162,282,283],{"class":172},"  body",[162,285,286],{"class":168}," { ",[162,288,289],{"class":176},"font",[162,291,292],{"class":168},": ",[162,294,295],{"class":176},"15",[162,297,299],{"class":298},"sHUrx","px",[162,301,302],{"class":168},"\u002F",[162,304,305],{"class":176},"1.5",[162,307,308],{"class":176}," system-ui",[162,310,311],{"class":168},", ",[162,313,314],{"class":176},"sans-serif",[162,316,317],{"class":168},"; ",[162,319,320],{"class":176},"margin",[162,322,292],{"class":168},[162,324,325],{"class":176},"2",[162,327,328],{"class":298},"rem",[162,330,317],{"class":168},[162,332,333],{"class":176},"display",[162,335,292],{"class":168},[162,337,338],{"class":176},"grid",[162,340,317],{"class":168},[162,342,343],{"class":176},"gap",[162,345,292],{"class":168},[162,347,325],{"class":176},[162,349,328],{"class":298},[162,351,317],{"class":168},[162,353,354],{"class":176},"grid-template-columns",[162,356,292],{"class":168},[162,358,359],{"class":176},"repeat",[162,361,362],{"class":168},"(",[162,364,365],{"class":176},"auto-fit",[162,367,311],{"class":168},[162,369,370],{"class":176},"minmax",[162,372,362],{"class":168},[162,374,375],{"class":176},"12",[162,377,328],{"class":298},[162,379,311],{"class":168},[162,381,382],{"class":176},"1",[162,384,385],{"class":298},"fr",[162,387,388],{"class":168},")); }\n",[162,390,392],{"class":164,"line":391},9,[162,393,395],{"emptyLinePlaceholder":394},true,"\n",[162,397,399],{"class":164,"line":398},10,[162,400,402],{"class":401},"sLBg1","  \u002F* Elevation: a resting shadow plus a pre-painted \"lifted\" shadow. *\u002F\n",[162,404,406,409],{"class":164,"line":405},11,[162,407,408],{"class":176},"  .card",[162,410,411],{"class":168}," {\n",[162,413,415,418,420,423],{"class":164,"line":414},12,[162,416,417],{"class":176},"    position",[162,419,292],{"class":168},[162,421,422],{"class":176},"relative",[162,424,425],{"class":168},";\n",[162,427,429,432,434,437,439],{"class":164,"line":428},13,[162,430,431],{"class":176},"    padding",[162,433,292],{"class":168},[162,435,436],{"class":176},"1.25",[162,438,328],{"class":298},[162,440,425],{"class":168},[162,442,444,447,449,451,453],{"class":164,"line":443},14,[162,445,446],{"class":176},"    border-radius",[162,448,292],{"class":168},[162,450,375],{"class":176},[162,452,299],{"class":298},[162,454,425],{"class":168},[162,456,458,461,463,466],{"class":164,"line":457},15,[162,459,460],{"class":176},"    background",[162,462,292],{"class":168},[162,464,465],{"class":176},"#fff",[162,467,425],{"class":168},[162,469,471,474,476,479,482,484,487,489,492,494,496,499,501,504,507,510],{"class":164,"line":470},16,[162,472,473],{"class":176},"    box-shadow",[162,475,292],{"class":168},[162,477,478],{"class":176},"0",[162,480,481],{"class":176}," 1",[162,483,299],{"class":298},[162,485,486],{"class":176}," 3",[162,488,299],{"class":298},[162,490,491],{"class":176}," rgb",[162,493,362],{"class":168},[162,495,478],{"class":176},[162,497,498],{"class":176}," 0",[162,500,498],{"class":176},[162,502,503],{"class":168}," \u002F ",[162,505,506],{"class":176},"0.12",[162,508,509],{"class":168},");   ",[162,511,512],{"class":401},"\u002F* static, painted once *\u002F\n",[162,514,516,519,522,525,528,531,533,535,537,539,541,543,545,547],{"class":164,"line":515},17,[162,517,518],{"class":176},"    transition",[162,520,521],{"class":168},": translate ",[162,523,524],{"class":176},"200",[162,526,527],{"class":298},"ms",[162,529,530],{"class":176}," cubic-bezier",[162,532,362],{"class":168},[162,534,102],{"class":176},[162,536,311],{"class":168},[162,538,478],{"class":176},[162,540,311],{"class":168},[162,542,478],{"class":176},[162,544,311],{"class":168},[162,546,382],{"class":176},[162,548,549],{"class":168},");\n",[162,551,553],{"class":164,"line":552},18,[162,554,555],{"class":168},"  }\n",[162,557,559,562],{"class":164,"line":558},19,[162,560,561],{"class":176},"  .card::after",[162,563,411],{"class":168},[162,565,567,570,572,575],{"class":164,"line":566},20,[162,568,569],{"class":176},"    content",[162,571,292],{"class":168},[162,573,574],{"class":197},"\"\"",[162,576,425],{"class":168},[162,578,580,582,584,587],{"class":164,"line":579},21,[162,581,417],{"class":176},[162,583,292],{"class":168},[162,585,586],{"class":176},"absolute",[162,588,425],{"class":168},[162,590,592,595,597,599],{"class":164,"line":591},22,[162,593,594],{"class":176},"    inset",[162,596,292],{"class":168},[162,598,478],{"class":176},[162,600,425],{"class":168},[162,602,604,606,608,611],{"class":164,"line":603},23,[162,605,446],{"class":176},[162,607,292],{"class":168},[162,609,610],{"class":176},"inherit",[162,612,425],{"class":168},[162,614,616,618,620,622,625,627,630,632,634,636,638,640,642,644,646,649],{"class":164,"line":615},24,[162,617,473],{"class":176},[162,619,292],{"class":168},[162,621,478],{"class":176},[162,623,624],{"class":176}," 14",[162,626,299],{"class":298},[162,628,629],{"class":176}," 30",[162,631,299],{"class":298},[162,633,491],{"class":176},[162,635,362],{"class":168},[162,637,478],{"class":176},[162,639,498],{"class":176},[162,641,498],{"class":176},[162,643,503],{"class":168},[162,645,102],{"class":176},[162,647,648],{"class":168},");  ",[162,650,651],{"class":401},"\u002F* the lifted shadow *\u002F\n",[162,653,655,658,660,663],{"class":164,"line":654},25,[162,656,657],{"class":176},"    pointer-events",[162,659,292],{"class":168},[162,661,662],{"class":176},"none",[162,664,425],{"class":168},[162,666,668,671,673,675],{"class":164,"line":667},26,[162,669,670],{"class":176},"    opacity",[162,672,292],{"class":168},[162,674,478],{"class":176},[162,676,425],{"class":168},[162,678,680,682,685,687,689,691,693,695,697,699,701,703,705,707],{"class":164,"line":679},27,[162,681,518],{"class":176},[162,683,684],{"class":168},": opacity ",[162,686,524],{"class":176},[162,688,527],{"class":298},[162,690,530],{"class":176},[162,692,362],{"class":168},[162,694,102],{"class":176},[162,696,311],{"class":168},[162,698,478],{"class":176},[162,700,311],{"class":168},[162,702,478],{"class":176},[162,704,311],{"class":168},[162,706,382],{"class":176},[162,708,549],{"class":168},[162,710,712],{"class":164,"line":711},28,[162,713,555],{"class":168},[162,715,717,720,722,725,727,729,732,734],{"class":164,"line":716},29,[162,718,719],{"class":176},"  .card:hover",[162,721,286],{"class":168},[162,723,724],{"class":176},"translate",[162,726,292],{"class":168},[162,728,478],{"class":176},[162,730,731],{"class":176}," -3",[162,733,299],{"class":298},[162,735,736],{"class":168},"; }\n",[162,738,740,743,745,748,750,752],{"class":164,"line":739},30,[162,741,742],{"class":176},"  .card:hover::after",[162,744,286],{"class":168},[162,746,747],{"class":176},"opacity",[162,749,292],{"class":168},[162,751,382],{"class":176},[162,753,736],{"class":168},[162,755,757],{"class":164,"line":756},31,[162,758,395],{"emptyLinePlaceholder":394},[162,760,762],{"class":164,"line":761},32,[162,763,764],{"class":401},"  \u002F* Glow: a soft halo painted once, faded in on hover and focus. *\u002F\n",[162,766,768,771],{"class":164,"line":767},33,[162,769,770],{"class":176},"  .glow-btn",[162,772,411],{"class":168},[162,774,776,778,780,782],{"class":164,"line":775},34,[162,777,417],{"class":176},[162,779,292],{"class":168},[162,781,422],{"class":176},[162,783,425],{"class":168},[162,785,787,789,791,794,796,799,801],{"class":164,"line":786},35,[162,788,431],{"class":176},[162,790,292],{"class":168},[162,792,793],{"class":176},"0.75",[162,795,328],{"class":298},[162,797,798],{"class":176}," 1.25",[162,800,328],{"class":298},[162,802,425],{"class":168},[162,804,806,809,811,813],{"class":164,"line":805},36,[162,807,808],{"class":176},"    border",[162,810,292],{"class":168},[162,812,478],{"class":176},[162,814,425],{"class":168},[162,816,818,820,822,825,827],{"class":164,"line":817},37,[162,819,446],{"class":176},[162,821,292],{"class":168},[162,823,824],{"class":176},"999",[162,826,299],{"class":298},[162,828,425],{"class":168},[162,830,832,834,836,839],{"class":164,"line":831},38,[162,833,460],{"class":176},[162,835,292],{"class":168},[162,837,838],{"class":176},"#7c3aed",[162,840,425],{"class":168},[162,842,844,847,849,851],{"class":164,"line":843},39,[162,845,846],{"class":176},"    color",[162,848,292],{"class":168},[162,850,465],{"class":176},[162,852,425],{"class":168},[162,854,856,859,861,863],{"class":164,"line":855},40,[162,857,858],{"class":176},"    font",[162,860,292],{"class":168},[162,862,610],{"class":176},[162,864,425],{"class":168},[162,866,868],{"class":164,"line":867},41,[162,869,555],{"class":168},[162,871,873,876],{"class":164,"line":872},42,[162,874,875],{"class":176},"  .glow-btn::before",[162,877,411],{"class":168},[162,879,881,883,885,887],{"class":164,"line":880},43,[162,882,569],{"class":176},[162,884,292],{"class":168},[162,886,574],{"class":197},[162,888,425],{"class":168},[162,890,892,894,896,898],{"class":164,"line":891},44,[162,893,417],{"class":176},[162,895,292],{"class":168},[162,897,586],{"class":176},[162,899,425],{"class":168},[162,901,903,905,907,909],{"class":164,"line":902},45,[162,904,594],{"class":176},[162,906,292],{"class":168},[162,908,478],{"class":176},[162,910,425],{"class":168},[162,912,914,916,918,920],{"class":164,"line":913},46,[162,915,446],{"class":176},[162,917,292],{"class":168},[162,919,610],{"class":176},[162,921,425],{"class":168},[162,923,925,927,929,931,933,936,938,941,943,946,949],{"class":164,"line":924},47,[162,926,473],{"class":176},[162,928,292],{"class":168},[162,930,478],{"class":176},[162,932,498],{"class":176},[162,934,935],{"class":176}," 18",[162,937,299],{"class":298},[162,939,940],{"class":176}," 6",[162,942,299],{"class":298},[162,944,945],{"class":176}," #a78bfa",[162,947,948],{"class":168},";   ",[162,950,951],{"class":401},"\u002F* rasterised once; never animated *\u002F\n",[162,953,955,957,959,961],{"class":164,"line":954},48,[162,956,657],{"class":176},[162,958,292],{"class":168},[162,960,662],{"class":176},[162,962,425],{"class":168},[162,964,966,968,970,972],{"class":164,"line":965},49,[162,967,670],{"class":176},[162,969,292],{"class":168},[162,971,478],{"class":176},[162,973,425],{"class":168},[162,975,977,979,981,984,986,989],{"class":164,"line":976},50,[162,978,518],{"class":176},[162,980,684],{"class":168},[162,982,983],{"class":176},"180",[162,985,527],{"class":298},[162,987,988],{"class":176}," ease-out",[162,990,425],{"class":168},[162,992,994],{"class":164,"line":993},51,[162,995,555],{"class":168},[162,997,999,1002,1004,1007,1009,1011,1013,1016,1019,1021,1024,1026,1029,1031],{"class":164,"line":998},52,[162,1000,1001],{"class":176},"  .glow-btn:focus-visible",[162,1003,286],{"class":168},[162,1005,1006],{"class":176},"outline",[162,1008,292],{"class":168},[162,1010,325],{"class":176},[162,1012,299],{"class":298},[162,1014,1015],{"class":176}," solid",[162,1017,1018],{"class":176}," #4c1d95",[162,1020,317],{"class":168},[162,1022,1023],{"class":176},"outline-offset",[162,1025,292],{"class":168},[162,1027,1028],{"class":176},"3",[162,1030,299],{"class":298},[162,1032,736],{"class":168},[162,1034,1036,1039],{"class":164,"line":1035},53,[162,1037,1038],{"class":176},"  .glow-btn:focus-visible::before",[162,1040,1041],{"class":168},",\n",[162,1043,1045,1048,1050,1052,1054,1057],{"class":164,"line":1044},54,[162,1046,1047],{"class":176},"  .glow-btn:hover::before",[162,1049,286],{"class":168},[162,1051,747],{"class":176},[162,1053,292],{"class":168},[162,1055,1056],{"class":176},"0.8",[162,1058,736],{"class":168},[162,1060,1062],{"class":164,"line":1061},55,[162,1063,395],{"emptyLinePlaceholder":394},[162,1065,1067,1070],{"class":164,"line":1066},56,[162,1068,1069],{"class":298},"  @media",[162,1071,1072],{"class":168}," (prefers-reduced-motion: reduce) {\n",[162,1074,1076,1079,1081,1083,1085,1087],{"class":164,"line":1075},57,[162,1077,1078],{"class":176},"    .card:hover",[162,1080,286],{"class":168},[162,1082,724],{"class":176},[162,1084,292],{"class":168},[162,1086,662],{"class":176},[162,1088,736],{"class":168},[162,1090,1092],{"class":164,"line":1091},58,[162,1093,555],{"class":168},[162,1095,1097,1100,1102],{"class":164,"line":1096},59,[162,1098,1099],{"class":168},"\u003C\u002F",[162,1101,275],{"class":172},[162,1103,180],{"class":168},[162,1105,1107,1109,1111],{"class":164,"line":1106},60,[162,1108,1099],{"class":168},[162,1110,208],{"class":172},[162,1112,180],{"class":168},[162,1114,1116,1118,1121],{"class":164,"line":1115},61,[162,1117,186],{"class":168},[162,1119,1120],{"class":172},"body",[162,1122,180],{"class":168},[162,1124,1126,1129,1132,1135,1137,1140,1143,1146,1149,1151,1153,1155,1158,1160,1163,1165],{"class":164,"line":1125},62,[162,1127,1128],{"class":168},"  \u003C",[162,1130,1131],{"class":172},"article",[162,1133,1134],{"class":176}," class",[162,1136,194],{"class":168},[162,1138,1139],{"class":197},"\"card\"",[162,1141,1142],{"class":168},">\u003C",[162,1144,1145],{"class":172},"h3",[162,1147,1148],{"class":168},">Lifted card\u003C\u002F",[162,1150,1145],{"class":172},[162,1152,1142],{"class":168},[162,1154,14],{"class":172},[162,1156,1157],{"class":168},">Hover me.\u003C\u002F",[162,1159,14],{"class":172},[162,1161,1162],{"class":168},">\u003C\u002F",[162,1164,1131],{"class":172},[162,1166,180],{"class":168},[162,1168,1170,1172,1175,1177,1179,1182,1185,1187,1190,1193,1195],{"class":164,"line":1169},63,[162,1171,1128],{"class":168},[162,1173,1174],{"class":172},"button",[162,1176,1134],{"class":176},[162,1178,194],{"class":168},[162,1180,1181],{"class":197},"\"glow-btn\"",[162,1183,1184],{"class":176}," type",[162,1186,194],{"class":168},[162,1188,1189],{"class":197},"\"button\"",[162,1191,1192],{"class":168},">Glowing button\u003C\u002F",[162,1194,1174],{"class":172},[162,1196,180],{"class":168},[162,1198,1200,1202,1204],{"class":164,"line":1199},64,[162,1201,1099],{"class":168},[162,1203,1120],{"class":172},[162,1205,180],{"class":168},[162,1207,1209,1211,1213],{"class":164,"line":1208},65,[162,1210,1099],{"class":168},[162,1212,157],{"class":172},[162,1214,180],{"class":168},[14,1216,1217,1218,1220,1221,1225,1226,1229,1230,1233],{},"Both pseudo-elements rely on a detail of ",[37,1219,39],{},": an outer shadow is only drawn ",[1222,1223,1224],"em",{},"outside"," its element's border box. The pseudo-elements have no background and cover exactly the card or button, so their shadows appear around the edges and nothing is painted over the content — no ",[37,1227,1228],{},"z-index"," juggling is needed. ",[37,1231,1232],{},"pointer-events: none"," keeps them from intercepting clicks and hovers. Each shadow is rasterised once, when the page first paints; hovering and focusing only change the pseudo-element's opacity.",[29,1235,1237],{"id":1236},"the-key-technique-crossfade-between-pre-rendered-states","The key technique: crossfade between pre-rendered states",[14,1239,1240],{},"Every technique on this page is the same move: render the expensive end state once, then crossfade to it. For shadows, the end state is a second shadow on a pseudo-element. For blur, it can be a pre-blurred duplicate of an image, faded in over the sharp one. For a colour glow, it is a blurred shape whose opacity changes.",[50,1242,57,1245,57,1248,57,1251,57,1254,57,1258,57,1261,57,1268,57,1273,57,1277,57,1280,57,1285,57,1288,57,1292],{"viewBox":1243,"role":53,"ariaLabel":1244,"xmlns":55,"style":56},"0 0 720 260","Crossfade approach: a static base layer and a pre-rendered effect layer; only the effect layer's opacity animates from 0 to 1",[59,1246,1247],{},"Two layers, one opacity",[63,1249,1250],{},"A stack of two layers. The bottom layer is the element in its resting state, painted once. The top layer is the expensive effect, such as a large shadow or a blur, also painted once. An opacity slider from 0 to 1 on the top layer is the only thing that changes during the animation.",[67,1252,1253],{"textAnchor":69,"x":70,"y":71,"style":72},"Only the opacity moves",[99,1255],{"d":1256,"fill":82,"opacity":1257},"M180 150 L330 110 L540 150 L390 190 Z","0.15",[99,1259],{"d":1260,"fill":96,"opacity":120},"M180 100 L330 60 L540 100 L390 140 Z",[67,1262,1267],{"textAnchor":1263,"x":1264,"y":1265,"style":1266},"start","590","104","text-anchor:start;fill:currentColor;font:12px sans-serif","effect layer",[67,1269,1272],{"textAnchor":1263,"x":1264,"y":1270,"style":1271},"120","text-anchor:start;fill:currentColor;font:11px sans-serif","painted once",[67,1274,1276],{"textAnchor":1263,"x":1264,"y":1275,"style":1266},"154","base layer",[67,1278,1272],{"textAnchor":1263,"x":1264,"y":1279,"style":1271},"170",[164,1281],{"x1":1270,"y1":1282,"x2":1283,"y2":1282,"stroke":82,"strokeWidth":325,"opacity":1284},"220","600","0.6",[104,1286],{"cx":70,"cy":1282,"r":1287,"fill":96},"9",[67,1289,1291],{"textAnchor":69,"x":1270,"y":1290,"style":124},"246","opacity 0",[67,1293,1294],{"textAnchor":69,"x":1283,"y":1290,"style":124},"opacity 1",[14,1296,1297,1298,1300,1301,1304],{},"The crossfade is not identical to animating the property. A shadow that animates from small to large grows smoothly; a crossfade blends two shadows, and at the midpoint both are half-visible. For elevation changes of a few pixels, the difference is imperceptible. For dramatic changes, add a small ",[37,1299,724],{}," or ",[37,1302,1303],{},"scale"," on the effect layer so the shadow appears to spread, which is still composite-only.",[29,1306,1308],{"id":1307},"grids-multiply-the-cost","Grids multiply the cost",[14,1310,1311],{},"A single card repainting its shadow for 200 milliseconds rarely causes a visible problem. The trouble starts in grids. Moving the pointer across a product grid enters and leaves several cards per second; each one starts a shadow transition in, and the one before it starts a transition out. At any moment three or four large blurred shadows may be repainting simultaneously, alongside whatever else the page is doing. That is where frame drops appear, and it is why the pseudo-element approach is worth adopting as the default for any repeated component, even though a one-off hero card would be fine either way.",[14,1313,1314,1315,1318,1319,1322,1323,1327],{},"The pre-painted layers are not free either. Each pseudo-element that animates opacity may be promoted to its own compositor layer while it animates, and each layer costs memory proportional to its area — including the shadow's blur extent. On a grid of fifty cards, that memory is only claimed for the cards currently animating, so the trade is favourable. Declaring ",[37,1316,1317],{},"will-change: opacity"," on all fifty pseudo-elements in advance, by contrast, would claim it for all of them at once; leave ",[37,1320,1321],{},"will-change"," off and let the browser promote layers on demand. ",[18,1324,1326],{"href":1325},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fwill-change-and-the-compositor-thread\u002F","will-change and the Compositor Thread"," explains when promoting early is worth it.",[29,1329,1331],{"id":1330},"blur-transitions","Blur transitions",[14,1333,1334,1335,1338,1339,1342,1343,1346,1347,1350],{},"Animating ",[37,1336,1337],{},"filter: blur(0)"," to ",[37,1340,1341],{},"blur(8px)"," on a large image is one of the most expensive animations available: every frame re-blurs every pixel at a new radius. Two cheaper routes exist. The first is the crossfade: stack a pre-blurred copy — a second ",[37,1344,1345],{},"\u003Cimg>"," with a static ",[37,1348,1349],{},"filter: blur(8px)",", or a separately exported blurred image — and fade it in. The second, for background dimming behind modals, is to skip blur altogether: a semi-transparent dark overlay faded in with opacity conveys \"the background is inactive\" almost as well at a fraction of the cost.",[29,1352,1354],{"id":1353},"backdrop-filter-price-it-per-frame","backdrop-filter: price it per frame",[14,1356,1357,1360,1361,1364,1365,1367,1368,1372],{},[37,1358,1359],{},"backdrop-filter: blur()"," produces frosted-glass panels by blurring whatever is behind the element. It is not animated in the usual sense, but it is recomputed whenever the backdrop changes: during scrolling, under an animated background, or while the panel itself moves. A sticky frosted header over a scrolling page re-blurs a header-sized area on every scroll frame. That is acceptable for a small header on a capable device and noticeable on a large panel or a slow phone. Keep frosted areas small, keep the blur radius modest, and consider a solid, slightly translucent background as the fallback under ",[37,1362,1363],{},"prefers-reduced-transparency"," where it is supported. Animating the ",[37,1366,47],{}," value itself — fading a blur in behind a dialog — combines both costs and is best replaced with an opacity-animated overlay. ",[18,1369,1371],{"href":1370},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations\u002F","Backdrop Animations"," covers dialog backdrops specifically.",[29,1374,1376],{"id":1375},"drop-shadow-versus-box-shadow","drop-shadow versus box-shadow",[14,1378,1379,1382,1383,1385,1386,1389,1390,1392,1393,1395],{},[37,1380,1381],{},"filter: drop-shadow()"," follows the element's alpha shape — useful for transparent PNGs, SVG icons and clipped shapes — while ",[37,1384,39],{}," follows the border box. Both are paint-bound, and ",[37,1387,1388],{},"drop-shadow"," is often the more expensive of the two because it must trace the alpha channel. When the shape is a rectangle or rounded rectangle, prefer ",[37,1391,39],{},". When an irregular shape needs an animated shadow, the pseudo-element technique still applies: a second copy of the shape with a static ",[37,1394,1388],{},", faded in.",[29,1397,1399],{"id":1398},"browser-support","Browser support",[14,1401,1402,311,1404,1407,1408,1410,1411,1414,1415,1417,1418,1421],{},[37,1403,39],{},[37,1405,1406],{},"filter"," and opacity transitions are supported in every current browser. The standalone ",[37,1409,724],{}," property used in the implementation is supported in Chrome and Edge 104+, Firefox 72+ and Safari 14.1+, and ",[37,1412,1413],{},"prefers-reduced-motion"," in Chrome 74+, Edge 79+, Firefox 63+ and Safari 10.1+. ",[37,1416,47],{}," is widely supported in current browsers but has historically needed a ",[37,1419,1420],{},"-webkit-"," prefix in Safari; include both forms. Whether any engine can composite filters without repainting varies by version, so measure before relying on it.",[29,1423,1425],{"id":1424},"faq","FAQ",[14,1427,1428,1432,1433,1435],{},[1429,1430,1431],"strong",{},"Why is animating box-shadow slow?","\nA ",[37,1434,39],{}," change repaints the shadow on every frame, and blurred shadows are expensive to rasterise, especially large ones. On a grid of cards, several shadows repainting at once can exceed the frame budget.",[14,1437,1438,1441],{},[1429,1439,1440],{},"How do I animate a shadow cheaply?","\nPaint the final shadow once on a pseudo-element and animate its opacity. The shadow's pixels are drawn a single time and each frame only changes how transparent the layer is, which the compositor handles.",[14,1443,1444,1447],{},[1429,1445,1446],{},"Is animating filter: blur() expensive?","\nUsually yes, because the blur radius changes the rendered pixels every frame and blur cost grows with radius and area. Crossfading between an unblurred element and a pre-blurred copy with opacity is typically much cheaper.",[14,1449,1450,1453,1454,1456],{},[1429,1451,1452],{},"Should I avoid backdrop-filter?","\nUse it sparingly. ",[37,1455,47],{}," blurs whatever is behind the element every frame that the content behind it changes, including while scrolling. A small, static frosted panel is fine; a large one over animated or scrolling content is costly.",[29,1458,1460],{"id":1459},"related","Related",[1462,1463,1464,1470,1477,1484],"ul",{},[1465,1466,1467,1469],"li",{},[18,1468,21],{"href":20}," — the parent guide.",[1465,1471,1472,1476],{},[18,1473,1475],{"href":1474},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite\u002F","Layout, Paint and Composite: What Triggers What"," — where shadows sit in the pipeline.",[1465,1478,1479,1483],{},[18,1480,1482],{"href":1481},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fsmooth-hover-effects-without-javascript\u002F","Smooth Hover Effects Without JavaScript"," — hover lifts in context.",[1465,1485,1486,1490],{},[18,1487,1489],{"href":1488},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations\u002Fanimated-gradient-borders-with-property\u002F","Animated Gradient Borders With @property"," — another glow technique.",[275,1492,1493],{},"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 .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":158,"searchDepth":183,"depth":183,"links":1495},[1496,1497,1498,1499,1500,1501,1502,1503,1504,1505],{"id":31,"depth":183,"text":32},{"id":143,"depth":183,"text":144},{"id":1236,"depth":183,"text":1237},{"id":1307,"depth":183,"text":1308},{"id":1330,"depth":183,"text":1331},{"id":1353,"depth":183,"text":1354},{"id":1375,"depth":183,"text":1376},{"id":1398,"depth":183,"text":1399},{"id":1424,"depth":183,"text":1425},{"id":1459,"depth":183,"text":1460},"Elevation, glow and blur effects without per-frame repaints: pre-painted shadow layers, opacity crossfades between blur states, and backdrop-filter costs.","md",{"pageTitle":5,"datePublished":1509,"dateModified":1509,"faq":1510},"2026-09-18",[1511,1513,1515,1517],{"q":1431,"a":1512},"A box-shadow change repaints the shadow on every frame, and blurred shadows are expensive to rasterise, especially large ones. On a grid of cards, several shadows repainting at once can exceed the frame budget.",{"q":1440,"a":1514},"Paint the final shadow once on a pseudo-element and animate its opacity. The shadow's pixels are drawn a single time and each frame only changes how transparent the layer is, which the compositor handles.",{"q":1446,"a":1516},"Usually yes, because the blur radius changes the rendered pixels every frame and blur cost grows with radius and area. Crossfading between an unblurred element and a pre-blurred copy with opacity is typically much cheaper.",{"q":1452,"a":1518},"Use it sparingly. backdrop-filter blurs whatever is behind the element every frame that the content behind it changes, including while scrolling. A small, static frosted panel is fine; a large one over animated or scrolling content is costly.","\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply",{"title":5,"description":1506},"css-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply\u002Findex","ZCdfEspIwx-fUdLUromZogscpMCsd7jylrhzJy9AJe4",[1524,1527,1530,1533,1536,1539,1542,1545,1548,1551,1554,1557,1560,1563,1566,1569,1572,1575,1578,1581,1584,1587,1590,1593,1596,1599,1602,1605,1608,1611,1614,1617,1620,1623,1626,1629,1632,1635,1638,1641,1644,1647,1650,1653,1656,1659,1662,1665,1668,1671,1674,1677,1680,1683,1686,1689,1692,1695,1698,1701,1704,1707,1710,1713,1716,1719,1722,1725,1728,1731,1734,1737,1740,1741,1744,1746,1749,1752,1755,1758,1761,1764,1767,1770,1773,1776,1779,1782,1785,1788,1791,1794,1797,1800,1802,1805,1808,1811,1814,1817,1820,1823,1826,1829,1832,1835,1838,1841,1844,1847,1850,1853,1856,1859,1862,1865,1868,1871,1874,1877,1880,1883,1886,1889,1892,1895,1898,1901,1904,1907,1910,1913,1916,1919,1922,1925,1928,1931,1934,1937,1940,1943,1946,1949,1952,1955,1958,1961,1964,1967,1970,1973,1976,1979,1982,1985,1988,1991,1994,1997,2000,2003,2006,2009,2012,2015,2018,2021,2024,2027,2030,2033,2036,2039,2042,2045,2048,2051,2054,2057,2060,2063,2066,2069,2072,2075,2078],{"path":1525,"title":1526},"\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":1528,"title":1529},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":1531,"title":1532},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":1534,"title":1535},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":1537,"title":1538},"\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":1540,"title":1541},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":1543,"title":1544},"\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":1546,"title":1547},"\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":1549,"title":1550},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":1552,"title":1553},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":1555,"title":1556},"\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":1558,"title":1559},"\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":1561,"title":1562},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":1564,"title":1565},"\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":1567,"title":1568},"\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":1570,"title":1571},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":1573,"title":1574},"\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":1576,"title":1577},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":1579,"title":1580},"\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":1582,"title":1583},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":1585,"title":1586},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":1588,"title":1589},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":1591,"title":1592},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":1594,"title":1595},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":1597,"title":1598},"\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":1600,"title":1601},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":1603,"title":1604},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":1606,"title":1607},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":1609,"title":1610},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":1612,"title":1613},"\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":1615,"title":1616},"\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":1618,"title":1619},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":1621,"title":1622},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":1624,"title":1625},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":1627,"title":1628},"\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":1630,"title":1631},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":1633,"title":1634},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":1636,"title":1637},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":1639,"title":1640},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":1642,"title":1643},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":1645,"title":1646},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":1648,"title":1649},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":1651,"title":1652},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":1654,"title":1655},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":1657,"title":1658},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"path":1660,"title":1661},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":1663,"title":1664},"\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":1666,"title":1667},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":1669,"title":1670},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":1672,"title":1673},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":1675,"title":1676},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":1678,"title":1679},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":1681,"title":1682},"\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":1684,"title":1685},"\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":1687,"title":1688},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":1690,"title":1691},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states","Button Press and  States",{"path":1693,"title":1694},"\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":1696,"title":1697},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":1699,"title":1700},"\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":1702,"title":1703},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":1705,"title":1706},"\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":1708,"title":1709},"\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":1711,"title":1712},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":1714,"title":1715},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking","Stacking Animations With animation-composition",{"path":1717,"title":1718},"\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":1720,"title":1721},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":1723,"title":1724},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":1726,"title":1727},"\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":1729,"title":1730},"\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":1732,"title":1733},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":1735,"title":1736},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":1738,"title":1739},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":1519,"title":5},{"path":1742,"title":1743},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":1745,"title":1475},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite",{"path":1747,"title":1748},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":1750,"title":1751},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":1753,"title":1754},"\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":1756,"title":1757},"\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":1759,"title":1760},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":1762,"title":1763},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":1765,"title":1766},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects","Scroll-Driven Parallax Effects in CSS",{"path":1768,"title":1769},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":1771,"title":1772},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":1774,"title":1775},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":1777,"title":1778},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range","View Timelines and animation-range",{"path":1780,"title":1781},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":1783,"title":1784},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":1786,"title":1787},"\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":1789,"title":1790},"\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":1792,"title":1793},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":1795,"title":1796},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":1798,"title":1799},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":302,"title":1801},"Modern CSS Layouts & Micro-Interactions",{"path":1803,"title":1804},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":1806,"title":1807},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":1809,"title":1810},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":1812,"title":1813},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":1815,"title":1816},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":1818,"title":1819},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":1821,"title":1822},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":1824,"title":1825},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":1827,"title":1828},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":1830,"title":1831},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":1833,"title":1834},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":1836,"title":1837},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":1839,"title":1840},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":1842,"title":1843},"\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":1845,"title":1846},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":1848,"title":1849},"\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":1851,"title":1852},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":1854,"title":1855},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":1857,"title":1858},"\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":1860,"title":1861},"\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":1863,"title":1864},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics","Container Query Syntax Basics",{"path":1866,"title":1867},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":1869,"title":1870},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":1872,"title":1873},"\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":1875,"title":1876},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":1878,"title":1879},"\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":1881,"title":1882},"\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":1884,"title":1885},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":1887,"title":1888},"\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":1890,"title":1891},"\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":1893,"title":1894},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":1896,"title":1897},"\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":1899,"title":1900},"\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":1902,"title":1903},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":1905,"title":1906},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":1908,"title":1909},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":1911,"title":1912},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":1914,"title":1915},"\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":1917,"title":1918},"\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":1920,"title":1921},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":1923,"title":1924},"\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":1926,"title":1927},"\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":1929,"title":1930},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":1932,"title":1933},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":1935,"title":1936},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":1938,"title":1939},"\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":1941,"title":1942},"\u002Fmastering-container-queries-responsive-layouts","Mastering Container Queries & Responsive Layouts",{"path":1944,"title":1945},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":1947,"title":1948},"\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":1950,"title":1951},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":1953,"title":1954},"\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":1956,"title":1957},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":1959,"title":1960},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":1962,"title":1963},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":1965,"title":1966},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":1968,"title":1969},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":1971,"title":1972},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":1974,"title":1975},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":1977,"title":1978},"\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":1980,"title":1981},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset","Writing a Minimal Modern CSS Reset: Every Line Justified",{"path":1983,"title":1984},"\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":1986,"title":1987},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has","Empty and Loading States With ()",{"path":1989,"title":1990},"\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":1992,"title":1993},"\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":1995,"title":1996},"\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":1998,"title":1999},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"path":2001,"title":2002},"\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":2004,"title":2005},"\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":2007,"title":2008},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":2010,"title":2011},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":2013,"title":2014},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":2016,"title":2017},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":2019,"title":2020},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":2022,"title":2023},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":2025,"title":2026},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":2028,"title":2029},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions","Tabs That Become an Accordion: One Component, Two Layouts",{"path":2031,"title":2032},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":2034,"title":2035},"\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":2037,"title":2038},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":2040,"title":2041},"\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":2043,"title":2044},"\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":2046,"title":2047},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":2049,"title":2050},"\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":2052,"title":2053},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":2055,"title":2056},"\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":2058,"title":2059},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":2061,"title":2062},"\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":2064,"title":2065},"\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":2067,"title":2068},"\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":2070,"title":2071},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":2073,"title":2074},"\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":2076,"title":2077},"\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":2079,"title":2080},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":2082,"caption":2083,"height":2084,"html":2085,"css":2086},"Elevation and glow from pre-painted layers","Hover the card to lift it, and hover or tab to the button to show its glow. Both effects fade a shadow that was painted once; nothing repaints per frame.",220,"\n\u003Cdiv class=\"grid\">\n  \u003Carticle class=\"card\">\u003Ch3>Lifted card\u003C\u002Fh3>\u003Cp>Hover me.\u003C\u002Fp>\u003C\u002Farticle>\n  \u003Cdiv class=\"cell\">\u003Cbutton class=\"glow-btn\" type=\"button\">Glowing button\u003C\u002Fbutton>\u003C\u002Fdiv>\n\u003C\u002Fdiv>","\n.grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); padding: 1.5rem; align-items: center; }\n.cell { display: grid; place-items: center; }\n.card { position: relative; padding: 1.25rem; border-radius: 12px; background: var(--demo-surface); border: 1px solid var(--demo-border); box-shadow: 0 1px 3px rgb(0 0 0 \u002F 0.12); transition: translate 200ms cubic-bezier(0.2, 0, 0, 1); }\n.card h3 { margin: 0 0 0.25rem; font-size: 1rem; }\n.card p { margin: 0; color: var(--demo-muted); }\n.card::after { content: \"\"; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 14px 30px rgb(0 0 0 \u002F 0.2); pointer-events: none; opacity: 0; transition: opacity 200ms cubic-bezier(0.2, 0, 0, 1); }\n.card:hover { translate: 0 -3px; }\n.card:hover::after { opacity: 1; }\n.glow-btn { position: relative; padding: 0.75rem 1.25rem; border: 0; border-radius: 999px; background: #7c3aed; color: #fff; font: inherit; cursor: pointer; }\n.glow-btn::before { content: \"\"; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 18px 6px #a78bfa; pointer-events: none; opacity: 0; transition: opacity 180ms ease-out; }\n.glow-btn:focus-visible { outline: 2px solid var(--demo-accent); outline-offset: 3px; }\n.glow-btn:focus-visible::before, .glow-btn:hover::before { opacity: 0.8; }\n@media (prefers-reduced-motion: reduce) { .card:hover { translate: none; } }",1789717748248]