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