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