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