[{"data":1,"prerenderedAt":2407},["ShallowReactive",2],{"page-\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations\u002F":3,"content-all-pages":1842,"live-demo:backdrop-fade-blur":2401},{"id":4,"title":5,"body":6,"description":1821,"extension":1822,"meta":1823,"navigation":343,"path":1838,"seo":1839,"stem":1840,"__hash__":1841},"content\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations\u002Findex.md","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"type":7,"value":8,"toc":1810},"minimark",[9,19,41,46,49,73,76,148,152,159,1300,1307,1311,1321,1325,1335,1406,1416,1420,1423,1437,1441,1452,1455,1485,1499,1503,1509,1690,1702,1706,1724,1728,1744,1759,1768,1777,1781,1807],[10,11,13,14,18],"h1",{"id":12},"animating-backdrop-fades-and-blurs-behind-dialogs-and-popovers","Animating ",[15,16,17],"code",{},"::backdrop",": Fades and Blurs Behind Dialogs and Popovers",[20,21,22,23,25,26,29,30,35,36,40],"p",{},"The ",[15,24,17],{}," pseudo-element sits directly beneath any element in the top layer — a modal ",[15,27,28],{},"\u003Cdialog>",", an open popover, an element in fullscreen — and covers the whole viewport. For modal dialogs it is the visual signal that the rest of the page is unavailable. By default it is a faint translucent layer that appears and disappears instantly, which makes even a carefully animated dialog feel abrupt, because the page behind it jumps from bright to dim in one frame. This page shows how to fade and blur the backdrop in both directions, how to theme it with custom properties, and how to keep blur from costing frames. It belongs to ",[31,32,34],"a",{"href":33},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002F","Dialog & Popover Animations"," in the ",[31,37,39],{"href":38},"\u002Fcss-only-micro-interactions-animations\u002F","CSS-Only Micro-Interactions & Animations"," guide.",[42,43,45],"h2",{"id":44},"why-the-backdrop-needs-its-own-animation","Why the backdrop needs its own animation",[20,47,48],{},"The backdrop is not a child of the dialog, and it is not part of the page. It is rendered as a separate box in the top layer, immediately below its element. That has three consequences:",[50,51,52,56,59],"ol",{},[53,54,55],"li",{},"It does not inherit the dialog's opacity or transforms. Fading the dialog does not fade the backdrop.",[53,57,58],{},"It only exists while its element is in the top layer. The instant a dialog closes, the backdrop is removed — unless the dialog's removal from the top layer is deferred.",[53,60,61,62,64,65,68,69,72],{},"It is styled only through the ",[15,63,17],{}," selector, so it needs its own ",[15,66,67],{},"transition"," and its own ",[15,70,71],{},"@starting-style",".",[20,74,75],{},"Handled well, the backdrop is half of what makes a modal feel smooth: the page dims gradually as the dialog arrives and brightens gradually as it leaves, and the two motions together read as a single event.",[77,78,84,85,84,89,84,93,84,101,84,107,84,113,84,118,84,123,84,127,84,132,84,143],"svg",{"viewBox":79,"role":80,"ariaLabel":81,"xmlns":82,"style":83},"0 0 720 320","img","Layer stack: page content at the bottom, the backdrop covering the viewport above it, and the dialog on top in the top layer","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[86,87,88],"title",{},"Where ::backdrop sits",[90,91,92],"desc",{},"Three stacked layers drawn in perspective. The page is at the bottom. The backdrop, a full-viewport translucent layer, sits above the page. The dialog sits on top. The dialog and backdrop are both in the top layer; the backdrop is not a child of the dialog.",[94,95,100],"text",{"textAnchor":96,"x":97,"y":98,"style":99},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","Top layer: element above, backdrop below it",[102,103],"path",{"d":104,"fill":105,"opacity":106},"M120 250 L520 250 L620 200 L220 200 Z","currentColor","0.12",[94,108,112],{"textAnchor":96,"x":109,"y":110,"style":111},"370","232","text-anchor:middle;fill:currentColor;font:600 13px sans-serif","page content",[102,114],{"d":115,"fill":116,"opacity":117},"M120 180 L520 180 L620 130 L220 130 Z","#7aa2ff","0.28",[94,119,122],{"textAnchor":96,"x":109,"y":120,"style":121},"162","text-anchor:middle;fill:currentColor;font:600 13px ui-monospace,monospace","::backdrop (full viewport)",[102,124],{"d":125,"fill":116,"opacity":126},"M270 110 L450 110 L500 80 L320 80 Z","0.6",[94,128,131],{"textAnchor":96,"x":129,"y":130,"style":121},"385","100","dialog",[133,134],"rect",{"x":135,"y":136,"width":137,"height":138,"rx":139,"fill":140,"stroke":105,"strokeWidth":141,"opacity":142},"30","266","660","40","8","none","1.5","0.5",[94,144,147],{"textAnchor":96,"x":97,"y":145,"style":146},"291","text-anchor:middle;fill:currentColor;font:12px sans-serif","The backdrop is a separate box: it needs its own transition and @starting-style.",[42,149,151],{"id":150},"the-complete-implementation","The complete implementation",[20,153,154,155,158],{},"The dialog below fades and scales in while its backdrop fades from transparent to a dim, blurred layer. On close, both reverse, and the dialog's ",[15,156,157],{},"overlay"," transition keeps the backdrop alive until the exit finishes.",[160,161,166],"pre",{"className":162,"code":163,"language":164,"meta":165,"style":165},"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>Animated backdrop\u003C\u002Ftitle>\n\u003Cstyle>\n  body { font: 16px\u002F1.5 system-ui, sans-serif; margin: 2rem; }\n\n  dialog {\n    \u002F* Theme tokens for the backdrop, set on the dialog so ::backdrop\n       inherits them. *\u002F\n    --scrim: rgb(15 23 42 \u002F 0.5);\n    --scrim-blur: 4px;\n\n    border: 0;\n    border-radius: 14px;\n    padding: 1.5rem;\n    opacity: 0;\n    transition:\n      opacity 180ms ease-in,\n      display 180ms allow-discrete,\n      overlay 180ms allow-discrete;       \u002F* keeps the backdrop alive on close *\u002F\n  }\n\n  dialog[open] {\n    opacity: 1;\n    transition:\n      opacity 240ms ease-out,\n      display 240ms allow-discrete,\n      overlay 240ms allow-discrete;\n  }\n\n  @starting-style {\n    dialog[open] { opacity: 0; }\n  }\n\n  \u002F* The backdrop: closed values and its exit transition. *\u002F\n  dialog::backdrop {\n    background-color: rgb(15 23 42 \u002F 0);\n    backdrop-filter: blur(0);\n    transition:\n      background-color 180ms ease-in,\n      backdrop-filter 180ms ease-in,\n      display 180ms allow-discrete,\n      overlay 180ms allow-discrete;\n  }\n\n  \u002F* Open backdrop and its entry transition. *\u002F\n  dialog[open]::backdrop {\n    background-color: var(--scrim, rgb(15 23 42 \u002F 0.5));\n    backdrop-filter: blur(var(--scrim-blur, 4px));\n    transition:\n      background-color 240ms ease-out,\n      backdrop-filter 240ms ease-out,\n      display 240ms allow-discrete,\n      overlay 240ms allow-discrete;\n  }\n\n  @starting-style {\n    dialog[open]::backdrop {\n      background-color: rgb(15 23 42 \u002F 0);\n      backdrop-filter: blur(0);\n    }\n  }\n\n  \u002F* Dark theme: a deeper scrim reads better on dark pages. *\u002F\n  :root[data-theme=\"dark\"] dialog { --scrim: rgb(0 0 0 \u002F 0.6); }\n\n  @media (prefers-reduced-motion: reduce) {\n    dialog::backdrop, dialog[open]::backdrop { transition-duration: 1ms; }\n  }\n\u003C\u002Fstyle>\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Cbutton type=\"button\" onclick=\"document.getElementById('d').showModal()\">Open settings\u003C\u002Fbutton>\n  \u003Cdialog id=\"d\" aria-labelledby=\"d-title\">\n    \u003Ch2 id=\"d-title\">Settings\u003C\u002Fh2>\n    \u003Cform method=\"dialog\">\u003Cbutton>Close\u003C\u002Fbutton>\u003C\u002Fform>\n  \u003C\u002Fdialog>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n","html","",[15,167,168,188,208,218,236,261,275,285,338,345,354,361,367,399,415,420,433,448,462,474,483,501,514,531,537,542,556,568,575,590,601,614,619,624,632,654,659,664,670,679,703,720,727,741,755,766,777,782,787,793,809,843,869,876,889,902,913,924,929,934,941,956,980,996,1002,1007,1012,1018,1063,1068,1077,1109,1114,1124,1133,1143,1193,1218,1239,1272,1282,1291],{"__ignoreMap":165},[169,170,173,177,181,185],"span",{"class":171,"line":172},"line",1,[169,174,176],{"class":175},"suds8","\u003C!",[169,178,180],{"class":179},"sne4z","doctype",[169,182,184],{"class":183},"s-5SL"," html",[169,186,187],{"class":175},">\n",[169,189,191,194,196,199,202,206],{"class":171,"line":190},2,[169,192,193],{"class":175},"\u003C",[169,195,164],{"class":179},[169,197,198],{"class":183}," lang",[169,200,201],{"class":175},"=",[169,203,205],{"class":204},"sT6z2","\"en\"",[169,207,187],{"class":175},[169,209,211,213,216],{"class":171,"line":210},3,[169,212,193],{"class":175},[169,214,215],{"class":179},"head",[169,217,187],{"class":175},[169,219,221,223,226,229,231,234],{"class":171,"line":220},4,[169,222,193],{"class":175},[169,224,225],{"class":179},"meta",[169,227,228],{"class":183}," charset",[169,230,201],{"class":175},[169,232,233],{"class":204},"\"utf-8\"",[169,235,187],{"class":175},[169,237,239,241,243,246,248,251,254,256,259],{"class":171,"line":238},5,[169,240,193],{"class":175},[169,242,225],{"class":179},[169,244,245],{"class":183}," name",[169,247,201],{"class":175},[169,249,250],{"class":204},"\"viewport\"",[169,252,253],{"class":183}," content",[169,255,201],{"class":175},[169,257,258],{"class":204},"\"width=device-width, initial-scale=1\"",[169,260,187],{"class":175},[169,262,264,266,268,271,273],{"class":171,"line":263},6,[169,265,193],{"class":175},[169,267,86],{"class":179},[169,269,270],{"class":175},">Animated backdrop\u003C\u002F",[169,272,86],{"class":179},[169,274,187],{"class":175},[169,276,278,280,283],{"class":171,"line":277},7,[169,279,193],{"class":175},[169,281,282],{"class":179},"style",[169,284,187],{"class":175},[169,286,288,291,294,297,300,303,307,310,312,315,318,321,324,327,329,332,335],{"class":171,"line":287},8,[169,289,290],{"class":179},"  body",[169,292,293],{"class":175}," { ",[169,295,296],{"class":183},"font",[169,298,299],{"class":175},": ",[169,301,302],{"class":183},"16",[169,304,306],{"class":305},"sHUrx","px",[169,308,309],{"class":175},"\u002F",[169,311,141],{"class":183},[169,313,314],{"class":183}," system-ui",[169,316,317],{"class":175},", ",[169,319,320],{"class":183},"sans-serif",[169,322,323],{"class":175},"; ",[169,325,326],{"class":183},"margin",[169,328,299],{"class":175},[169,330,331],{"class":183},"2",[169,333,334],{"class":305},"rem",[169,336,337],{"class":175},"; }\n",[169,339,341],{"class":171,"line":340},9,[169,342,344],{"emptyLinePlaceholder":343},true,"\n",[169,346,348,351],{"class":171,"line":347},10,[169,349,350],{"class":179},"  dialog",[169,352,353],{"class":175}," {\n",[169,355,357],{"class":171,"line":356},11,[169,358,360],{"class":359},"sLBg1","    \u002F* Theme tokens for the backdrop, set on the dialog so ::backdrop\n",[169,362,364],{"class":171,"line":363},12,[169,365,366],{"class":359},"       inherits them. *\u002F\n",[169,368,370,374,376,379,382,385,388,391,394,396],{"class":171,"line":369},13,[169,371,373],{"class":372},"soyes","    --scrim",[169,375,299],{"class":175},[169,377,378],{"class":183},"rgb",[169,380,381],{"class":175},"(",[169,383,384],{"class":183},"15",[169,386,387],{"class":183}," 23",[169,389,390],{"class":183}," 42",[169,392,393],{"class":175}," \u002F ",[169,395,142],{"class":183},[169,397,398],{"class":175},");\n",[169,400,402,405,407,410,412],{"class":171,"line":401},14,[169,403,404],{"class":372},"    --scrim-blur",[169,406,299],{"class":175},[169,408,409],{"class":183},"4",[169,411,306],{"class":305},[169,413,414],{"class":175},";\n",[169,416,418],{"class":171,"line":417},15,[169,419,344],{"emptyLinePlaceholder":343},[169,421,423,426,428,431],{"class":171,"line":422},16,[169,424,425],{"class":183},"    border",[169,427,299],{"class":175},[169,429,430],{"class":183},"0",[169,432,414],{"class":175},[169,434,436,439,441,444,446],{"class":171,"line":435},17,[169,437,438],{"class":183},"    border-radius",[169,440,299],{"class":175},[169,442,443],{"class":183},"14",[169,445,306],{"class":305},[169,447,414],{"class":175},[169,449,451,454,456,458,460],{"class":171,"line":450},18,[169,452,453],{"class":183},"    padding",[169,455,299],{"class":175},[169,457,141],{"class":183},[169,459,334],{"class":305},[169,461,414],{"class":175},[169,463,465,468,470,472],{"class":171,"line":464},19,[169,466,467],{"class":183},"    opacity",[169,469,299],{"class":175},[169,471,430],{"class":183},[169,473,414],{"class":175},[169,475,477,480],{"class":171,"line":476},20,[169,478,479],{"class":183},"    transition",[169,481,482],{"class":175},":\n",[169,484,486,489,492,495,498],{"class":171,"line":485},21,[169,487,488],{"class":175},"      opacity ",[169,490,491],{"class":183},"180",[169,493,494],{"class":305},"ms",[169,496,497],{"class":183}," ease-in",[169,499,500],{"class":175},",\n",[169,502,504,507,509,511],{"class":171,"line":503},22,[169,505,506],{"class":175},"      display ",[169,508,491],{"class":183},[169,510,494],{"class":305},[169,512,513],{"class":175}," allow-discrete,\n",[169,515,517,520,523,525,528],{"class":171,"line":516},23,[169,518,519],{"class":183},"      overlay",[169,521,522],{"class":183}," 180",[169,524,494],{"class":305},[169,526,527],{"class":175}," allow-discrete;       ",[169,529,530],{"class":359},"\u002F* keeps the backdrop alive on close *\u002F\n",[169,532,534],{"class":171,"line":533},24,[169,535,536],{"class":175},"  }\n",[169,538,540],{"class":171,"line":539},25,[169,541,344],{"emptyLinePlaceholder":343},[169,543,545,547,550,553],{"class":171,"line":544},26,[169,546,350],{"class":179},[169,548,549],{"class":175},"[",[169,551,552],{"class":183},"open",[169,554,555],{"class":175},"] {\n",[169,557,559,561,563,566],{"class":171,"line":558},27,[169,560,467],{"class":183},[169,562,299],{"class":175},[169,564,565],{"class":183},"1",[169,567,414],{"class":175},[169,569,571,573],{"class":171,"line":570},28,[169,572,479],{"class":183},[169,574,482],{"class":175},[169,576,578,580,583,585,588],{"class":171,"line":577},29,[169,579,488],{"class":175},[169,581,582],{"class":183},"240",[169,584,494],{"class":305},[169,586,587],{"class":183}," ease-out",[169,589,500],{"class":175},[169,591,593,595,597,599],{"class":171,"line":592},30,[169,594,506],{"class":175},[169,596,582],{"class":183},[169,598,494],{"class":305},[169,600,513],{"class":175},[169,602,604,606,609,611],{"class":171,"line":603},31,[169,605,519],{"class":183},[169,607,608],{"class":183}," 240",[169,610,494],{"class":305},[169,612,613],{"class":175}," allow-discrete;\n",[169,615,617],{"class":171,"line":616},32,[169,618,536],{"class":175},[169,620,622],{"class":171,"line":621},33,[169,623,344],{"emptyLinePlaceholder":343},[169,625,627,630],{"class":171,"line":626},34,[169,628,629],{"class":305},"  @starting-style",[169,631,353],{"class":175},[169,633,635,638,640,642,645,648,650,652],{"class":171,"line":634},35,[169,636,637],{"class":179},"    dialog",[169,639,549],{"class":175},[169,641,552],{"class":183},[169,643,644],{"class":175},"] { ",[169,646,647],{"class":183},"opacity",[169,649,299],{"class":175},[169,651,430],{"class":183},[169,653,337],{"class":175},[169,655,657],{"class":171,"line":656},36,[169,658,536],{"class":175},[169,660,662],{"class":171,"line":661},37,[169,663,344],{"emptyLinePlaceholder":343},[169,665,667],{"class":171,"line":666},38,[169,668,669],{"class":359},"  \u002F* The backdrop: closed values and its exit transition. *\u002F\n",[169,671,673,675,677],{"class":171,"line":672},39,[169,674,350],{"class":179},[169,676,17],{"class":183},[169,678,353],{"class":175},[169,680,682,685,687,689,691,693,695,697,699,701],{"class":171,"line":681},40,[169,683,684],{"class":183},"    background-color",[169,686,299],{"class":175},[169,688,378],{"class":183},[169,690,381],{"class":175},[169,692,384],{"class":183},[169,694,387],{"class":183},[169,696,390],{"class":183},[169,698,393],{"class":175},[169,700,430],{"class":183},[169,702,398],{"class":175},[169,704,706,709,711,714,716,718],{"class":171,"line":705},41,[169,707,708],{"class":183},"    backdrop-filter",[169,710,299],{"class":175},[169,712,713],{"class":183},"blur",[169,715,381],{"class":175},[169,717,430],{"class":183},[169,719,398],{"class":175},[169,721,723,725],{"class":171,"line":722},42,[169,724,479],{"class":183},[169,726,482],{"class":175},[169,728,730,733,735,737,739],{"class":171,"line":729},43,[169,731,732],{"class":175},"      background-color ",[169,734,491],{"class":183},[169,736,494],{"class":305},[169,738,497],{"class":183},[169,740,500],{"class":175},[169,742,744,747,749,751,753],{"class":171,"line":743},44,[169,745,746],{"class":175},"      backdrop-filter ",[169,748,491],{"class":183},[169,750,494],{"class":305},[169,752,497],{"class":183},[169,754,500],{"class":175},[169,756,758,760,762,764],{"class":171,"line":757},45,[169,759,506],{"class":175},[169,761,491],{"class":183},[169,763,494],{"class":305},[169,765,513],{"class":175},[169,767,769,771,773,775],{"class":171,"line":768},46,[169,770,519],{"class":183},[169,772,522],{"class":183},[169,774,494],{"class":305},[169,776,613],{"class":175},[169,778,780],{"class":171,"line":779},47,[169,781,536],{"class":175},[169,783,785],{"class":171,"line":784},48,[169,786,344],{"emptyLinePlaceholder":343},[169,788,790],{"class":171,"line":789},49,[169,791,792],{"class":359},"  \u002F* Open backdrop and its entry transition. *\u002F\n",[169,794,796,798,800,802,805,807],{"class":171,"line":795},50,[169,797,350],{"class":179},[169,799,549],{"class":175},[169,801,552],{"class":183},[169,803,804],{"class":175},"]",[169,806,17],{"class":183},[169,808,353],{"class":175},[169,810,812,814,816,819,821,824,826,828,830,832,834,836,838,840],{"class":171,"line":811},51,[169,813,684],{"class":183},[169,815,299],{"class":175},[169,817,818],{"class":183},"var",[169,820,381],{"class":175},[169,822,823],{"class":372},"--scrim",[169,825,317],{"class":175},[169,827,378],{"class":183},[169,829,381],{"class":175},[169,831,384],{"class":183},[169,833,387],{"class":183},[169,835,390],{"class":183},[169,837,393],{"class":175},[169,839,142],{"class":183},[169,841,842],{"class":175},"));\n",[169,844,846,848,850,852,854,856,858,861,863,865,867],{"class":171,"line":845},52,[169,847,708],{"class":183},[169,849,299],{"class":175},[169,851,713],{"class":183},[169,853,381],{"class":175},[169,855,818],{"class":183},[169,857,381],{"class":175},[169,859,860],{"class":372},"--scrim-blur",[169,862,317],{"class":175},[169,864,409],{"class":183},[169,866,306],{"class":305},[169,868,842],{"class":175},[169,870,872,874],{"class":171,"line":871},53,[169,873,479],{"class":183},[169,875,482],{"class":175},[169,877,879,881,883,885,887],{"class":171,"line":878},54,[169,880,732],{"class":175},[169,882,582],{"class":183},[169,884,494],{"class":305},[169,886,587],{"class":183},[169,888,500],{"class":175},[169,890,892,894,896,898,900],{"class":171,"line":891},55,[169,893,746],{"class":175},[169,895,582],{"class":183},[169,897,494],{"class":305},[169,899,587],{"class":183},[169,901,500],{"class":175},[169,903,905,907,909,911],{"class":171,"line":904},56,[169,906,506],{"class":175},[169,908,582],{"class":183},[169,910,494],{"class":305},[169,912,513],{"class":175},[169,914,916,918,920,922],{"class":171,"line":915},57,[169,917,519],{"class":183},[169,919,608],{"class":183},[169,921,494],{"class":305},[169,923,613],{"class":175},[169,925,927],{"class":171,"line":926},58,[169,928,536],{"class":175},[169,930,932],{"class":171,"line":931},59,[169,933,344],{"emptyLinePlaceholder":343},[169,935,937,939],{"class":171,"line":936},60,[169,938,629],{"class":305},[169,940,353],{"class":175},[169,942,944,946,948,950,952,954],{"class":171,"line":943},61,[169,945,637],{"class":179},[169,947,549],{"class":175},[169,949,552],{"class":183},[169,951,804],{"class":175},[169,953,17],{"class":183},[169,955,353],{"class":175},[169,957,959,962,964,966,968,970,972,974,976,978],{"class":171,"line":958},62,[169,960,961],{"class":183},"      background-color",[169,963,299],{"class":175},[169,965,378],{"class":183},[169,967,381],{"class":175},[169,969,384],{"class":183},[169,971,387],{"class":183},[169,973,390],{"class":183},[169,975,393],{"class":175},[169,977,430],{"class":183},[169,979,398],{"class":175},[169,981,983,986,988,990,992,994],{"class":171,"line":982},63,[169,984,985],{"class":183},"      backdrop-filter",[169,987,299],{"class":175},[169,989,713],{"class":183},[169,991,381],{"class":175},[169,993,430],{"class":183},[169,995,398],{"class":175},[169,997,999],{"class":171,"line":998},64,[169,1000,1001],{"class":175},"    }\n",[169,1003,1005],{"class":171,"line":1004},65,[169,1006,536],{"class":175},[169,1008,1010],{"class":171,"line":1009},66,[169,1011,344],{"emptyLinePlaceholder":343},[169,1013,1015],{"class":171,"line":1014},67,[169,1016,1017],{"class":359},"  \u002F* Dark theme: a deeper scrim reads better on dark pages. *\u002F\n",[169,1019,1021,1024,1026,1029,1031,1034,1037,1039,1041,1043,1045,1047,1049,1051,1054,1056,1058,1060],{"class":171,"line":1020},68,[169,1022,1023],{"class":183},"  :root",[169,1025,549],{"class":175},[169,1027,1028],{"class":183},"data-theme",[169,1030,201],{"class":305},[169,1032,1033],{"class":204},"\"dark\"",[169,1035,1036],{"class":175},"] ",[169,1038,131],{"class":179},[169,1040,293],{"class":175},[169,1042,823],{"class":372},[169,1044,299],{"class":175},[169,1046,378],{"class":183},[169,1048,381],{"class":175},[169,1050,430],{"class":183},[169,1052,1053],{"class":183}," 0",[169,1055,1053],{"class":183},[169,1057,393],{"class":175},[169,1059,126],{"class":183},[169,1061,1062],{"class":175},"); }\n",[169,1064,1066],{"class":171,"line":1065},69,[169,1067,344],{"emptyLinePlaceholder":343},[169,1069,1071,1074],{"class":171,"line":1070},70,[169,1072,1073],{"class":305},"  @media",[169,1075,1076],{"class":175}," (prefers-reduced-motion: reduce) {\n",[169,1078,1080,1082,1084,1086,1088,1090,1092,1094,1096,1098,1101,1103,1105,1107],{"class":171,"line":1079},71,[169,1081,637],{"class":179},[169,1083,17],{"class":183},[169,1085,317],{"class":175},[169,1087,131],{"class":179},[169,1089,549],{"class":175},[169,1091,552],{"class":183},[169,1093,804],{"class":175},[169,1095,17],{"class":183},[169,1097,293],{"class":175},[169,1099,1100],{"class":183},"transition-duration",[169,1102,299],{"class":175},[169,1104,565],{"class":183},[169,1106,494],{"class":305},[169,1108,337],{"class":175},[169,1110,1112],{"class":171,"line":1111},72,[169,1113,536],{"class":175},[169,1115,1117,1120,1122],{"class":171,"line":1116},73,[169,1118,1119],{"class":175},"\u003C\u002F",[169,1121,282],{"class":179},[169,1123,187],{"class":175},[169,1125,1127,1129,1131],{"class":171,"line":1126},74,[169,1128,1119],{"class":175},[169,1130,215],{"class":179},[169,1132,187],{"class":175},[169,1134,1136,1138,1141],{"class":171,"line":1135},75,[169,1137,193],{"class":175},[169,1139,1140],{"class":179},"body",[169,1142,187],{"class":175},[169,1144,1146,1149,1152,1155,1157,1160,1163,1165,1168,1171,1173,1177,1180,1183,1186,1189,1191],{"class":171,"line":1145},76,[169,1147,1148],{"class":175},"  \u003C",[169,1150,1151],{"class":179},"button",[169,1153,1154],{"class":183}," type",[169,1156,201],{"class":175},[169,1158,1159],{"class":204},"\"button\"",[169,1161,1162],{"class":183}," onclick",[169,1164,201],{"class":175},[169,1166,1167],{"class":204},"\"",[169,1169,1170],{"class":175},"document",[169,1172,72],{"class":204},[169,1174,1176],{"class":1175},"sKwhi","getElementById",[169,1178,1179],{"class":204},"('d').",[169,1181,1182],{"class":1175},"showModal",[169,1184,1185],{"class":204},"()\"",[169,1187,1188],{"class":175},">Open settings\u003C\u002F",[169,1190,1151],{"class":179},[169,1192,187],{"class":175},[169,1194,1196,1198,1200,1203,1205,1208,1211,1213,1216],{"class":171,"line":1195},77,[169,1197,1148],{"class":175},[169,1199,131],{"class":179},[169,1201,1202],{"class":183}," id",[169,1204,201],{"class":175},[169,1206,1207],{"class":204},"\"d\"",[169,1209,1210],{"class":183}," aria-labelledby",[169,1212,201],{"class":175},[169,1214,1215],{"class":204},"\"d-title\"",[169,1217,187],{"class":175},[169,1219,1221,1224,1226,1228,1230,1232,1235,1237],{"class":171,"line":1220},78,[169,1222,1223],{"class":175},"    \u003C",[169,1225,42],{"class":179},[169,1227,1202],{"class":183},[169,1229,201],{"class":175},[169,1231,1215],{"class":204},[169,1233,1234],{"class":175},">Settings\u003C\u002F",[169,1236,42],{"class":179},[169,1238,187],{"class":175},[169,1240,1242,1244,1247,1250,1252,1255,1258,1260,1263,1265,1268,1270],{"class":171,"line":1241},79,[169,1243,1223],{"class":175},[169,1245,1246],{"class":179},"form",[169,1248,1249],{"class":183}," method",[169,1251,201],{"class":175},[169,1253,1254],{"class":204},"\"dialog\"",[169,1256,1257],{"class":175},">\u003C",[169,1259,1151],{"class":179},[169,1261,1262],{"class":175},">Close\u003C\u002F",[169,1264,1151],{"class":179},[169,1266,1267],{"class":175},">\u003C\u002F",[169,1269,1246],{"class":179},[169,1271,187],{"class":175},[169,1273,1275,1278,1280],{"class":171,"line":1274},80,[169,1276,1277],{"class":175},"  \u003C\u002F",[169,1279,131],{"class":179},[169,1281,187],{"class":175},[169,1283,1285,1287,1289],{"class":171,"line":1284},81,[169,1286,1119],{"class":175},[169,1288,1140],{"class":179},[169,1290,187],{"class":175},[169,1292,1294,1296,1298],{"class":171,"line":1293},82,[169,1295,1119],{"class":175},[169,1297,164],{"class":179},[169,1299,187],{"class":175},[20,1301,1302,1303,1306],{},"The demo frames here run without script, so the demo applies the same backdrop recipe to a popover opened by a ",[15,1304,1305],{},"popovertarget"," button. A dim scrim behind a popover is not something to ship — the variation below explains why — but it makes the fade and blur easy to see.",[1308,1309],"live-demo",{"name":1310},"backdrop-fade-blur",[20,1312,1313,1314,1317,1318,1320],{},"The backdrop's closed state is transparent rather than absent, so there is something to transition from and to. The ",[15,1315,1316],{},"var()"," calls carry fallbacks because older engines did not let ",[15,1319,17],{}," inherit from its element, in which case the custom properties would be undefined there.",[42,1322,1324],{"id":1323},"the-key-technique-animating-colour-not-opacity","The key technique: animating colour, not opacity",[20,1326,1327,1328,1330,1331,1334],{},"It is tempting to animate the backdrop's ",[15,1329,647],{},", but animating its ",[15,1332,1333],{},"background-color"," alpha is usually better. The difference shows up once a blur is involved.",[77,1336,84,1339,84,1342,84,1345,84,1348,84,1354,84,1360,84,1364,84,1369,84,1372,84,1378,84,1382,84,1386,84,1392,84,1395,84,1399,84,1402],{"viewBox":1337,"role":80,"ariaLabel":1338,"xmlns":82,"style":83},"0 0 720 290","Comparison of animating backdrop opacity, which fades the blur in and out as a whole, versus animating background-color alpha with a separate blur",[86,1340,1341],{},"Opacity versus colour alpha on a blurred backdrop",[90,1343,1344],{},"Left, animating opacity makes the blurred copy of the page cross-fade over the sharp page, which can look like a double image. Right, animating the colour alpha and blur radius separately keeps a single image that smoothly softens and dims.",[94,1346,1347],{"textAnchor":96,"x":97,"y":98,"style":99},"Midway through the entry, two approaches",[133,1349],{"x":138,"y":1350,"width":1351,"height":1352,"rx":1353,"fill":140,"stroke":105,"strokeWidth":141,"opacity":142},"50","300","170","10",[133,1355],{"x":1356,"y":1357,"width":1358,"height":302,"rx":409,"fill":105,"opacity":1359},"70","80","120","0.3",[102,1361],{"d":1362,"fill":105,"opacity":1363},"M76 86 H196 V102 H76 Z","0.15",[133,1365],{"x":1356,"y":1366,"width":1367,"height":1368,"rx":409,"fill":105,"opacity":1359},"112","200","12",[102,1370],{"d":1371,"fill":105,"opacity":1363},"M76 118 H276 V130 H76 Z",[94,1373,1377],{"textAnchor":96,"x":1374,"y":1375,"style":1376},"190","176","text-anchor:middle;fill:currentColor;font:600 12px ui-monospace,monospace","opacity: 0 → 1",[94,1379,1381],{"textAnchor":96,"x":1374,"y":1380,"style":146},"198","sharp and blurred ghosting",[133,1383],{"x":1384,"y":1350,"width":1351,"height":1352,"rx":1353,"fill":116,"opacity":1385},"380","0.14",[133,1387],{"x":1388,"y":1357,"width":1389,"height":1390,"rx":139,"fill":105,"opacity":1391},"410","126","20","0.2",[133,1393],{"x":1388,"y":1366,"width":1394,"height":302,"rx":139,"fill":105,"opacity":1391},"206",[94,1396,1398],{"textAnchor":96,"x":1397,"y":1375,"style":1376},"530","alpha + blur radius",[94,1400,1401],{"textAnchor":96,"x":1397,"y":1380,"style":146},"one image softening",[94,1403,1405],{"textAnchor":96,"x":97,"y":1404,"style":146},"258","Animate the scrim colour's alpha; animate or fix the blur radius separately.",[20,1407,1408,1409,1411,1412,1415],{},"When ",[15,1410,647],{}," animates on a backdrop with ",[15,1413,1414],{},"backdrop-filter: blur()",", the browser composites a fully blurred copy of the page at partial opacity over the sharp page. Midway, both images are visible, which reads as ghosting. Animating the colour's alpha channel and the blur radius independently keeps one image that progressively dims and softens.",[42,1417,1419],{"id":1418},"theming-the-scrim","Theming the scrim",[20,1421,1422],{},"A backdrop colour that works on a light page is often wrong on a dark one. A 50% slate scrim over a white page produces a clear, calm grey; the same scrim over a near-black page barely changes it, so the modal loses its separation. Darker themes want a deeper scrim, and some designs use a slightly lighter, tinted scrim over dark pages instead, so the dialog appears to sit in a pool of light.",[20,1424,1425,1426,1428,1429,1432,1433,1436],{},"Because ",[15,1427,17],{}," inherits from its element in current engines, the scrim is best expressed as tokens on the dialog, as in the example, and switched by the theme. That keeps the backdrop in step with every other themed surface and avoids a separate dark-mode rule for each dialog. For high-contrast needs, ",[15,1430,1431],{},"@media (prefers-contrast: more)"," can raise the scrim's alpha so the boundary between the modal and the inactive page is unmistakable, and ",[15,1434,1435],{},"forced-colors: active"," users will see the system's own rendering, since backdrop colours are overridden in forced-colours mode.",[42,1438,1440],{"id":1439},"performance-blur-is-the-expensive-part","Performance: blur is the expensive part",[20,1442,1443,1446,1447,1451],{},[15,1444,1445],{},"backdrop-filter"," requires the browser to read back and filter everything behind the element. For a full-viewport backdrop that is the whole screen. A static blur is usually fine on modern hardware because it only needs recomputing when the content beneath changes. Animating the blur ",[1448,1449,1450],"em",{},"radius",", as in the example, recomputes the filter on every frame of the transition, which on low-end phones can drop frames noticeably.",[20,1453,1454],{},"Three mitigations, in order of preference:",[1456,1457,1458,1465,1471],"ul",{},[53,1459,1460,1464],{},[1461,1462,1463],"strong",{},"Blur statically, fade the colour."," Set the blur on the open backdrop without transitioning it, and animate only the scrim's alpha. The blur appears at once but under a transparent scrim, so it is barely noticeable, then the dimming fades in.",[53,1466,1467,1470],{},[1461,1468,1469],{},"Reduce the radius."," A 4-pixel blur is much cheaper than 20 pixels and still signals depth.",[53,1472,1473,1476,1477,1480,1481,1484],{},[1461,1474,1475],{},"Skip blur on small or low-power contexts."," A ",[15,1478,1479],{},"@media (max-width: 40rem)"," or ",[15,1482,1483],{},"@media (prefers-reduced-transparency: reduce)"," query can drop the filter entirely; the dim scrim alone is enough to show the page is inactive.",[20,1486,1487,1488,1480,1491,1494,1495,72],{},"Profile with the Performance panel while opening the dialog on a throttled CPU; long ",[1448,1489,1490],{},"Paint",[1448,1492,1493],{},"Composite Layers"," entries during the transition point at the blur. The general technique is in ",[31,1496,1498],{"href":1497},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fprofiling-animations-in-devtools\u002F","Profiling Animations in DevTools",[42,1500,1502],{"id":1501},"variation-a-transparent-backdrop-for-popovers","Variation: a transparent backdrop for popovers",[20,1504,1505,1506,1508],{},"Popovers also get a ",[15,1507,17],{}," when shown, but a dimmed one sends the wrong message: popovers are non-modal, so the page remains interactive and should look it. The backdrop is still useful as a hook for a very light treatment, or can be left fully transparent.",[160,1510,1514],{"className":1511,"code":1512,"language":1513,"meta":165,"style":165},"language-css shiki shiki-themes github-light-high-contrast github-dark-high-contrast","[popover]::backdrop {\n  background: transparent;\n}\n\n\u002F* An optional hint of focus for a large, content-heavy popover. *\u002F\n[popover].panel:popover-open::backdrop {\n  background: rgb(15 23 42 \u002F 0.06);\n  transition: background-color 200ms ease-out, display 200ms allow-discrete, overlay 200ms allow-discrete;\n}\n\n@starting-style {\n  [popover].panel:popover-open::backdrop { background: rgb(15 23 42 \u002F 0); }\n}\n","css",[15,1515,1516,1529,1541,1546,1550,1555,1576,1599,1632,1636,1640,1646,1686],{"__ignoreMap":165},[169,1517,1518,1520,1523,1525,1527],{"class":171,"line":172},[169,1519,549],{"class":175},[169,1521,1522],{"class":183},"popover",[169,1524,804],{"class":175},[169,1526,17],{"class":183},[169,1528,353],{"class":175},[169,1530,1531,1534,1536,1539],{"class":171,"line":190},[169,1532,1533],{"class":183},"  background",[169,1535,299],{"class":175},[169,1537,1538],{"class":183},"transparent",[169,1540,414],{"class":175},[169,1542,1543],{"class":171,"line":210},[169,1544,1545],{"class":175},"}\n",[169,1547,1548],{"class":171,"line":220},[169,1549,344],{"emptyLinePlaceholder":343},[169,1551,1552],{"class":171,"line":238},[169,1553,1554],{"class":359},"\u002F* An optional hint of focus for a large, content-heavy popover. *\u002F\n",[169,1556,1557,1559,1561,1563,1566,1569,1572,1574],{"class":171,"line":263},[169,1558,549],{"class":175},[169,1560,1522],{"class":183},[169,1562,804],{"class":175},[169,1564,1565],{"class":183},".panel",[169,1567,1568],{"class":175},":",[169,1570,1571],{"class":179},"popover-open",[169,1573,17],{"class":183},[169,1575,353],{"class":175},[169,1577,1578,1580,1582,1584,1586,1588,1590,1592,1594,1597],{"class":171,"line":277},[169,1579,1533],{"class":183},[169,1581,299],{"class":175},[169,1583,378],{"class":183},[169,1585,381],{"class":175},[169,1587,384],{"class":183},[169,1589,387],{"class":183},[169,1591,390],{"class":183},[169,1593,393],{"class":175},[169,1595,1596],{"class":183},"0.06",[169,1598,398],{"class":175},[169,1600,1601,1604,1607,1609,1611,1613,1616,1618,1620,1623,1625,1628,1630],{"class":171,"line":287},[169,1602,1603],{"class":183},"  transition",[169,1605,1606],{"class":175},": background-color ",[169,1608,1367],{"class":183},[169,1610,494],{"class":305},[169,1612,587],{"class":183},[169,1614,1615],{"class":175},", display ",[169,1617,1367],{"class":183},[169,1619,494],{"class":305},[169,1621,1622],{"class":175}," allow-discrete, ",[169,1624,157],{"class":183},[169,1626,1627],{"class":183}," 200",[169,1629,494],{"class":305},[169,1631,613],{"class":175},[169,1633,1634],{"class":171,"line":340},[169,1635,1545],{"class":175},[169,1637,1638],{"class":171,"line":347},[169,1639,344],{"emptyLinePlaceholder":343},[169,1641,1642,1644],{"class":171,"line":356},[169,1643,71],{"class":305},[169,1645,353],{"class":175},[169,1647,1648,1651,1653,1655,1657,1659,1661,1663,1665,1668,1670,1672,1674,1676,1678,1680,1682,1684],{"class":171,"line":363},[169,1649,1650],{"class":175},"  [",[169,1652,1522],{"class":183},[169,1654,804],{"class":175},[169,1656,1565],{"class":183},[169,1658,1568],{"class":175},[169,1660,1571],{"class":179},[169,1662,17],{"class":183},[169,1664,293],{"class":175},[169,1666,1667],{"class":183},"background",[169,1669,299],{"class":175},[169,1671,378],{"class":183},[169,1673,381],{"class":175},[169,1675,384],{"class":183},[169,1677,387],{"class":183},[169,1679,390],{"class":183},[169,1681,393],{"class":175},[169,1683,430],{"class":183},[169,1685,1062],{"class":175},[169,1687,1688],{"class":171,"line":369},[169,1689,1545],{"class":175},[20,1691,1692,1693,1697,1698,72],{},"For light-dismiss popovers, clicks on the backdrop area reach the page beneath only after closing the popover, which is the platform's light-dismiss behaviour. The styling of the popover itself is covered in ",[31,1694,1696],{"href":1695},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling\u002F","Popover Attribute and CSS Styling",", and the dialog's own entry in ",[31,1699,1701],{"href":1700},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close\u002F","Animating dialog Open and Close",[42,1703,1705],{"id":1704},"browser-support","Browser support",[20,1707,1708,1710,1711,1713,1714,1717,1718,1720,1721,1723],{},[15,1709,17],{}," is supported in all current engines for modal dialogs, popovers and fullscreen elements. Transitions on it with ",[15,1712,71],{}," require Chrome and Edge 117+, Firefox 129+ or Safari 17.5+, and ",[15,1715,1716],{},"transition-behavior: allow-discrete"," requires Chrome and Edge 117+, Firefox 129+ or Safari 17.4+. The ",[15,1719,157],{}," property is Chromium-only at present; elsewhere the backdrop disappears at the start of the close while the dialog still fades. ",[15,1722,1445],{}," is supported unprefixed in current versions of all three engines.",[42,1725,1727],{"id":1726},"faq","FAQ",[20,1729,1730,1736,1737,1739,1740,1743],{},[1461,1731,1732,1733,1735],{},"Why does my ",[15,1734,17],{}," disappear instantly when the dialog closes?","\nThe backdrop exists only while its element is in the top layer. When the dialog closes, it leaves the top layer and the backdrop goes with it. Transition the dialog's ",[15,1738,157],{}," property with ",[15,1741,1742],{},"allow-discrete"," so the dialog, and therefore the backdrop, stay in the top layer until the exit finishes, and give the backdrop its own transition.",[20,1745,1746,1752,1753,1755,1756,1758],{},[1461,1747,1748,1749,1751],{},"Can ",[15,1750,17],{}," use custom properties from the page?","\nIn current engines ",[15,1754,17],{}," inherits from its originating element, so custom properties set on the dialog or popover are available inside it. Older engines had the backdrop inherit from nothing, so declare fallback values in the ",[15,1757,1316],{}," calls if you support them.",[20,1760,1761,1767],{},[1461,1762,1763,1764,1766],{},"Is ",[15,1765,1414],{}," expensive?","\nIt can be. The browser must blur everything behind the backdrop on every frame that something beneath it or the blur radius changes. Animating the blur radius is especially costly on low-end devices. Prefer a static blur with an animated opacity, or skip blur on small screens.",[20,1769,1770,1773,1774,1776],{},[1461,1771,1772],{},"Should a non-modal popover have a backdrop?","\nPopovers do get a ",[15,1775,17],{}," when shown, but a visible one suggests the page is blocked, which is misleading for a non-modal popover the user can click past. Keep popover backdrops transparent or extremely subtle, and reserve dimming for modal dialogs.",[42,1778,1780],{"id":1779},"related","Related",[1456,1782,1783,1788,1793,1800],{},[53,1784,1785,1787],{},[31,1786,34],{"href":33}," — the parent guide.",[53,1789,1790,1792],{},[31,1791,1701],{"href":1700}," — the dialog half of the same transition.",[53,1794,1795,1799],{},[31,1796,1798],{"href":1797},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fwill-change-and-the-compositor-thread\u002F","Will-Change and the Compositor Thread"," — why some visual effects cost more than others.",[53,1801,1802,1806],{},[31,1803,1805],{"href":1804},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Foverscroll-behavior-for-nested-scrolling\u002F","overscroll-behavior for Nested Scrolling"," — locking the page behind a modal.",[282,1808,1809],{},"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 pre.shiki code .sKwhi, html code.shiki .sKwhi{--shiki-default:#622CBC;--shiki-dark:#DBB7FF}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":165,"searchDepth":190,"depth":190,"links":1811},[1812,1813,1814,1815,1816,1817,1818,1819,1820],{"id":44,"depth":190,"text":45},{"id":150,"depth":190,"text":151},{"id":1323,"depth":190,"text":1324},{"id":1418,"depth":190,"text":1419},{"id":1439,"depth":190,"text":1440},{"id":1501,"depth":190,"text":1502},{"id":1704,"depth":190,"text":1705},{"id":1726,"depth":190,"text":1727},{"id":1779,"depth":190,"text":1780},"Fade and blur the ::backdrop behind modal dialogs and popovers in both directions, pass custom properties into it, and stop backdrop-filter dragging frames.","md",{"pageTitle":1824,"datePublished":1825,"dateModified":1825,"faq":1826},"Animating ::backdrop for Dialogs and Popovers","2026-09-18",[1827,1830,1833,1836],{"q":1828,"a":1829},"Why does my ::backdrop disappear instantly when the dialog closes?","The backdrop exists only while its element is in the top layer. When the dialog closes, it leaves the top layer and the backdrop goes with it. Transition the dialog's overlay property with allow-discrete so the dialog, and therefore the backdrop, stay in the top layer until the exit finishes, and give the backdrop its own transition.",{"q":1831,"a":1832},"Can ::backdrop use custom properties from the page?","In current engines ::backdrop inherits from its originating element, so custom properties set on the dialog or popover are available inside it. Older engines had the backdrop inherit from nothing, so declare fallback values in the var() calls if you support them.",{"q":1834,"a":1835},"Is backdrop-filter: blur() expensive?","It can be. The browser must blur everything behind the backdrop on every frame that something beneath it or the blur radius changes. Animating the blur radius is especially costly on low-end devices. Prefer a static blur with an animated opacity, or skip blur on small screens.",{"q":1772,"a":1837},"Popovers do get a ::backdrop when shown, but a visible one suggests the page is blocked, which is misleading for a non-modal popover the user can click past. Keep popover backdrops transparent or extremely subtle, and reserve dimming for modal dialogs.","\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations",{"title":5,"description":1821},"css-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations\u002Findex","SVlzYkqfek3BLEmIDKfXMCajshN93ysrQQ4STpYmeVo",[1843,1846,1849,1852,1855,1858,1861,1864,1867,1870,1873,1876,1879,1882,1885,1888,1891,1894,1897,1900,1903,1906,1909,1912,1915,1918,1921,1924,1927,1930,1933,1936,1939,1942,1945,1948,1951,1954,1957,1960,1963,1966,1969,1972,1975,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,2081,2084,2087,2090,2093,2096,2099,2102,2105,2108,2111,2114,2117,2120,2122,2125,2128,2131,2134,2137,2140,2143,2146,2149,2152,2155,2158,2161,2164,2167,2170,2173,2176,2179,2182,2185,2188,2191,2194,2197,2200,2203,2206,2209,2212,2215,2218,2221,2224,2227,2230,2233,2236,2239,2242,2245,2248,2251,2254,2257,2260,2263,2266,2269,2272,2275,2278,2281,2284,2287,2290,2293,2296,2299,2302,2305,2308,2311,2314,2317,2320,2323,2326,2329,2332,2335,2338,2341,2344,2347,2350,2353,2356,2359,2362,2365,2368,2371,2374,2377,2380,2383,2386,2389,2392,2395,2398],{"path":1844,"title":1845},"\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":1847,"title":1848},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":1850,"title":1851},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":1853,"title":1854},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":1856,"title":1857},"\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":1859,"title":1860},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":1862,"title":1863},"\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":1865,"title":1866},"\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":1868,"title":1869},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":1871,"title":1872},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":1874,"title":1875},"\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":1877,"title":1878},"\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":1880,"title":1881},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":1883,"title":1884},"\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":1886,"title":1887},"\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":1889,"title":1890},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":1892,"title":1893},"\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":1895,"title":1896},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":1898,"title":1899},"\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":1901,"title":1902},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":1904,"title":1905},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":1907,"title":1908},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":1910,"title":1911},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":1913,"title":1914},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":1916,"title":1917},"\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":1919,"title":1920},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":1922,"title":1923},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":1925,"title":1926},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":1928,"title":1929},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":1931,"title":1932},"\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":1934,"title":1935},"\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":1937,"title":1938},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":1940,"title":1941},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":1943,"title":1944},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":1946,"title":1947},"\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":1949,"title":1950},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":1952,"title":1953},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":1955,"title":1956},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":1958,"title":1959},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":1961,"title":1962},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":1964,"title":1965},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":1967,"title":1968},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":1970,"title":1971},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":1973,"title":1974},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":1838,"title":5},{"path":1977,"title":1978},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":1980,"title":1981},"\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":1983,"title":1984},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":1986,"title":1987},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":1989,"title":1990},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":1992,"title":1993},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":1995,"title":1996},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":1998,"title":1999},"\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":2001,"title":2002},"\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":2004,"title":2005},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":2007,"title":2008},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states","Button Press and  States",{"path":2010,"title":2011},"\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":2013,"title":2014},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":2016,"title":2017},"\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":2019,"title":2020},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":2022,"title":2023},"\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":2025,"title":2026},"\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":2028,"title":2029},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":2031,"title":2032},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking","Stacking Animations With animation-composition",{"path":2034,"title":2035},"\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":2037,"title":2038},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":2040,"title":2041},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":2043,"title":2044},"\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":2046,"title":2047},"\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":2049,"title":2050},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":2052,"title":2053},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":2055,"title":2056},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":2058,"title":2059},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply","Animating box-shadow and Filters Cheaply",{"path":2061,"title":2062},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":2064,"title":2065},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite","Layout, Paint and Composite: What Triggers What",{"path":2067,"title":2068},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":2070,"title":2071},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":2073,"title":2074},"\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":2076,"title":2077},"\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":2079,"title":2080},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":2082,"title":2083},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":2085,"title":2086},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects","Scroll-Driven Parallax Effects in CSS",{"path":2088,"title":2089},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":2091,"title":2092},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":2094,"title":2095},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":2097,"title":2098},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range","View Timelines and animation-range",{"path":2100,"title":2101},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":2103,"title":2104},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":2106,"title":2107},"\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":2109,"title":2110},"\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":2112,"title":2113},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":2115,"title":2116},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":2118,"title":2119},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":309,"title":2121},"Modern CSS Layouts & Micro-Interactions",{"path":2123,"title":2124},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":2126,"title":2127},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":2129,"title":2130},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":2132,"title":2133},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":2135,"title":2136},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":2138,"title":2139},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":2141,"title":2142},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":2144,"title":2145},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":2147,"title":2148},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":2150,"title":2151},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":2153,"title":2154},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":2156,"title":2157},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":2159,"title":2160},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":2162,"title":2163},"\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":2165,"title":2166},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":2168,"title":2169},"\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":2171,"title":2172},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":2174,"title":2175},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":2177,"title":2178},"\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":2180,"title":2181},"\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":2183,"title":2184},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics","Container Query Syntax Basics",{"path":2186,"title":2187},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":2189,"title":2190},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":2192,"title":2193},"\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":2195,"title":2196},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":2198,"title":2199},"\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":2201,"title":2202},"\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":2204,"title":2205},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":2207,"title":2208},"\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":2210,"title":2211},"\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":2213,"title":2214},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":2216,"title":2217},"\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":2219,"title":2220},"\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":2222,"title":2223},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":2225,"title":2226},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":2228,"title":2229},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":2231,"title":2232},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":2234,"title":2235},"\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":2237,"title":2238},"\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":2240,"title":2241},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":2243,"title":2244},"\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":2246,"title":2247},"\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":2249,"title":2250},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":2252,"title":2253},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":2255,"title":2256},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":2258,"title":2259},"\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":2261,"title":2262},"\u002Fmastering-container-queries-responsive-layouts","Mastering Container Queries & Responsive Layouts",{"path":2264,"title":2265},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":2267,"title":2268},"\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":2270,"title":2271},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":2273,"title":2274},"\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":2276,"title":2277},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":2279,"title":2280},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":2282,"title":2283},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":2285,"title":2286},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":2288,"title":2289},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":2291,"title":2292},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":2294,"title":2295},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":2297,"title":2298},"\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":2300,"title":2301},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset","Writing a Minimal Modern CSS Reset: Every Line Justified",{"path":2303,"title":2304},"\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":2306,"title":2307},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has","Empty and Loading States With ()",{"path":2309,"title":2310},"\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":2312,"title":2313},"\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":2315,"title":2316},"\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":2318,"title":2319},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"path":2321,"title":2322},"\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":2324,"title":2325},"\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":2327,"title":2328},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":2330,"title":2331},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":2333,"title":2334},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":2336,"title":2337},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":2339,"title":2340},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":2342,"title":2343},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":2345,"title":2346},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":2348,"title":2349},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions","Tabs That Become an Accordion: One Component, Two Layouts",{"path":2351,"title":2352},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":2354,"title":2355},"\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":2357,"title":2358},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":2360,"title":2361},"\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":2363,"title":2364},"\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":2366,"title":2367},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":2369,"title":2370},"\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":2372,"title":2373},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":2375,"title":2376},"\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":2378,"title":2379},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":2381,"title":2382},"\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":2384,"title":2385},"\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":2387,"title":2388},"\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":2390,"title":2391},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":2393,"title":2394},"\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":2396,"title":2397},"\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":2399,"title":2400},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":2402,"caption":2403,"height":2404,"html":2405,"css":2406},"Backdrop that fades and blurs in both directions","Open the panel: the page behind dims and softens over 240ms; close it and the backdrop clears over 180ms instead of vanishing.",300,"\n\u003Cdiv class=\"page\">\n  \u003Cp>Background content that the backdrop will dim and blur.\u003C\u002Fp>\n  \u003Cbutton type=\"button\" popovertarget=\"d\">Open settings\u003C\u002Fbutton>\n\u003C\u002Fdiv>\n\u003Cdiv id=\"d\" popover aria-labelledby=\"d-title\">\n  \u003Ch2 id=\"d-title\">Settings\u003C\u002Fh2>\n  \u003Cbutton type=\"button\" popovertarget=\"d\" popovertargetaction=\"hide\">Close\u003C\u002Fbutton>\n\u003C\u002Fdiv>","\nbody { place-items: center; }\n.page { text-align: center; }\nbutton { font: inherit; padding: 0.45rem 0.9rem; border-radius: 8px; border: 1px solid var(--demo-border); background: var(--demo-surface); color: inherit; }\nbutton:focus-visible { outline: 2px solid var(--demo-accent); outline-offset: 2px; }\n[popover] {\n  --scrim: rgb(15 23 42 \u002F 0.5);\n  --scrim-blur: 4px;\n  border: 0;\n  border-radius: 14px;\n  padding: 1.5rem;\n  background: var(--demo-bg);\n  color: var(--demo-fg);\n  opacity: 0;\n  transition: opacity 180ms ease-in, display 180ms allow-discrete, overlay 180ms allow-discrete;\n}\n[popover] h2 { margin: 0 0 0.75rem; font-size: 1.1rem; }\n[popover]:popover-open { opacity: 1; transition: opacity 240ms ease-out, display 240ms allow-discrete, overlay 240ms allow-discrete; }\n@starting-style { [popover]:popover-open { opacity: 0; } }\n[popover]::backdrop {\n  background-color: rgb(15 23 42 \u002F 0);\n  backdrop-filter: blur(0);\n  transition: background-color 180ms ease-in, backdrop-filter 180ms ease-in, display 180ms allow-discrete, overlay 180ms allow-discrete;\n}\n[popover]:popover-open::backdrop {\n  background-color: var(--scrim, rgb(15 23 42 \u002F 0.5));\n  backdrop-filter: blur(var(--scrim-blur, 4px));\n  transition: background-color 240ms ease-out, backdrop-filter 240ms ease-out, display 240ms allow-discrete, overlay 240ms allow-discrete;\n}\n@starting-style {\n  [popover]:popover-open::backdrop { background-color: rgb(15 23 42 \u002F 0); backdrop-filter: blur(0); }\n}\n@media (prefers-reduced-motion: reduce) {\n  [popover]::backdrop, [popover]:popover-open::backdrop { transition-duration: 1ms; }\n}",1789717746822]