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