[{"data":1,"prerenderedAt":2216},["ShallowReactive",2],{"page-\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-line-height-and-measure\u002F":3,"content-all-pages":1651,"live-demo:fluid-leading-measure":2210},{"id":4,"title":5,"body":6,"description":1632,"extension":1633,"meta":1634,"navigation":441,"path":1647,"seo":1648,"stem":1649,"__hash__":1650},"content\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-line-height-and-measure\u002Findex.md","Fluid Line Height and Measure: Keeping Text Readable as It Scales",{"type":7,"value":8,"toc":1621},"minimark",[9,13,33,38,41,77,171,178,182,189,193,928,947,951,957,1034,1044,1050,1212,1239,1341,1349,1359,1373,1387,1399,1403,1406,1509,1517,1521,1546,1550,1556,1565,1580,1586,1590,1618],[10,11,5],"h1",{"id":12},"fluid-line-height-and-measure-keeping-text-readable-as-it-scales",[14,15,16,17,21,22,27,28,32],"p",{},"Fluid typography usually means one thing: font sizes that grow with the viewport or container via ",[18,19,20],"code",{},"clamp()",". But readable text depends on three values working together — size, line height and line length — and scaling only the first one breaks the other two. Large headings inherit body leading and look gappy; body text on a wide screen stretches to 120 characters per line and becomes tiring to read; a zoomed reader finds lines rewrapping unpredictably. This page treats line height and measure as fluid values too: how each should respond as size changes, how to express that in CSS, and how to keep everything accessible under zoom. It belongs to ",[23,24,26],"a",{"href":25},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002F","Fluid Typography With clamp()"," in the ",[23,29,31],{"href":30},"\u002Fmastering-container-queries-responsive-layouts\u002F","Mastering Container Queries & Responsive Layouts"," guide.",[34,35,37],"h2",{"id":36},"why-size-leading-and-measure-must-move-together","Why size, leading and measure must move together",[14,39,40],{},"Line height exists to help the eye travel from the end of one line to the start of the next. The longer the line, the harder that return sweep, and the more vertical separation helps. The larger the type, the more space its own ascenders and descenders already create, and the less extra leading it needs. Those two rules pull in opposite directions depending on context:",[42,43,44,57,67],"ul",{},[45,46,47,51,52,56],"li",{},[48,49,50],"strong",{},"Headings"," are large and short. They need ",[53,54,55],"em",{},"tight"," leading, around 1.1 to 1.25, or multi-line headings fall apart into separate lines.",[45,58,59,62,63,66],{},[48,60,61],{},"Body text"," is small and long. It needs ",[53,64,65],{},"generous"," leading, around 1.5 to 1.7, and a capped line length.",[45,68,69,72,73,76],{},[48,70,71],{},"As body text grows"," with the viewport, lines get longer unless the measure is capped, and leading should increase slightly to compensate; if the measure ",[53,74,75],{},"is"," capped, leading can stay steady or even tighten a touch as size grows.",[78,79,85,86,85,90,85,94,85,102,85,111,85,114,85,120,85,126,85,130,85,139,85,145,85,151,85,155,85,161,85,167],"svg",{"viewBox":80,"role":81,"ariaLabel":82,"xmlns":83,"style":84},"0 0 720 320","img","Chart of line-height against font size: high for small body text, decreasing toward display sizes, with typical ranges marked","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[87,88,89],"title",{},"Leading falls as size rises",[91,92,93],"desc",{},"A downward curve from about 1.7 at 14 pixels to about 1.1 at 64 pixels. A shaded band marks body sizes with leading 1.5 to 1.7, and another marks display sizes with leading 1.05 to 1.2.",[95,96,101],"text",{"textAnchor":97,"x":98,"y":99,"style":100},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","Unitless line-height across the type scale",[103,104],"line",{"x1":105,"y1":106,"x2":107,"y2":106,"stroke":108,"strokeWidth":109,"opacity":110},"90","260","670","currentColor","1.5","0.6",[103,112],{"x1":105,"y1":113,"x2":105,"y2":106,"stroke":108,"strokeWidth":109,"opacity":110},"50",[95,115,119],{"textAnchor":116,"x":107,"y":117,"style":118},"end","306","text-anchor:end;fill:currentColor;font:12px sans-serif","font size →",[95,121,125],{"textAnchor":116,"x":122,"y":123,"style":124},"82","64","text-anchor:end;fill:currentColor;font:12px ui-monospace,monospace","1.7",[95,127,129],{"textAnchor":116,"x":122,"y":128,"style":124},"250","1.0",[131,132],"rect",{"x":133,"y":134,"width":135,"height":113,"rx":136,"fill":137,"opacity":138},"100","60","170","6","#7aa2ff","0.2",[95,140,144],{"textAnchor":97,"x":141,"y":142,"style":143},"185","132","text-anchor:middle;fill:currentColor;font:12px sans-serif","body: 1.5–1.7",[131,146],{"x":147,"y":148,"width":149,"height":150,"rx":136,"fill":137,"opacity":138},"480","190","180","46",[95,152,154],{"textAnchor":97,"x":153,"y":149,"style":143},"570","display: 1.05–1.2",[156,157],"path",{"d":158,"fill":159,"stroke":137,"strokeWidth":160},"M110 76 C250 100 400 180 650 214","none","4",[95,162,166],{"textAnchor":97,"x":163,"y":164,"style":165},"130","284","text-anchor:middle;fill:currentColor;font:11px ui-monospace,monospace","14px",[95,168,170],{"textAnchor":97,"x":169,"y":164,"style":165},"630","64px",[14,172,173,174,177],{},"The practical conclusion is that line height should be a ",[53,175,176],{},"function"," of font size, just as font size is a function of available space.",[34,179,181],{"id":180},"the-complete-implementation","The complete implementation",[14,183,184,185,188],{},"The article below uses a fluid font size, a line height that falls as the size rises, and a measure capped in ",[18,186,187],{},"ch",". Headings get their own tighter formula.",[190,191],"live-demo",{"name":192},"fluid-leading-measure",[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>Fluid line height and measure\u003C\u002Ftitle>\n\u003Cstyle>\n  :root {\n    \u002F* Body size: 1rem at small widths, 1.25rem at large, fluid between.\n       The rem term keeps it responsive to user zoom (WCAG 1.4.4). *\u002F\n    --step-0: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);\n    --step-3: clamp(1.75rem, 1.2rem + 2.5vw, 3rem);\n  }\n\n  body {\n    margin: 0;\n    padding: 1.5rem;\n    font-family: Georgia, serif;\n    font-size: var(--step-0);\n    line-height: 1.65;          \u002F* unitless default, inherits as a ratio *\u002F\n  }\n\n  .prose {\n    \u002F* Measure: about 65 characters, never wider than the space available.\n       ch is the width of \"0\" in the current font, so the cap scales with\n       font size and zoom. *\u002F\n    max-width: min(65ch, 100%);\n    margin-inline: auto;\n  }\n\n  .prose h2 {\n    font-size: var(--step-3);\n    \u002F* Display leading: tight, and a little tighter at the largest size. *\u002F\n    line-height: 1.15;\n    \u002F* Balanced wrapping stops a single orphaned word on the last line. *\u002F\n    text-wrap: balance;\n    margin-block: 1.5em 0.5em;\n  }\n\n  .prose p {\n    margin-block: 0 1em;\n    \u002F* Leading eases from 1.65 at 16px toward 1.575 at 20px.\n       tan(atan2(1em, 1rem)) is font size ÷ root size as a plain number. *\u002F\n    line-height: clamp(1.5, 1.95 - 0.3 * tan(atan2(1em, 1rem)), 1.7);\n    text-wrap: pretty;          \u002F* avoid very short last lines in paragraphs *\u002F\n  }\n\u003C\u002Fstyle>\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Carticle class=\"prose\">\n    \u003Ch2>What the coastline remembers about the storm\u003C\u002Fh2>\n    \u003Cp>Line length and leading work together. As the text grows, the measure stays\n       near sixty-five characters and the leading eases so lines stay easy to follow.\u003C\u002Fp>\n  \u003C\u002Farticle>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n","html","",[18,201,202,221,241,251,269,294,308,318,327,334,340,390,430,436,443,451,465,479,497,515,532,537,542,550,556,562,568,595,608,613,618,628,644,650,662,668,681,699,704,709,719,735,741,747,801,812,817,827,836,846,865,880,890,900,910,919],{"__ignoreMap":199},[203,204,206,210,214,218],"span",{"class":103,"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":103,"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":103,"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":103,"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":103,"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":103,"line":296},6,[203,298,226],{"class":208},[203,300,87],{"class":212},[203,302,303],{"class":208},">Fluid line height and measure\u003C\u002F",[203,305,87],{"class":212},[203,307,220],{"class":208},[203,309,311,313,316],{"class":103,"line":310},7,[203,312,226],{"class":208},[203,314,315],{"class":212},"style",[203,317,220],{"class":208},[203,319,321,324],{"class":103,"line":320},8,[203,322,323],{"class":216},"  :root",[203,325,326],{"class":208}," {\n",[203,328,330],{"class":103,"line":329},9,[203,331,333],{"class":332},"sLBg1","    \u002F* Body size: 1rem at small widths, 1.25rem at large, fluid between.\n",[203,335,337],{"class":103,"line":336},10,[203,338,339],{"class":332},"       The rem term keeps it responsive to user zoom (WCAG 1.4.4). *\u002F\n",[203,341,343,347,350,353,356,359,363,366,369,371,374,377,380,382,385,387],{"class":103,"line":342},11,[203,344,346],{"class":345},"soyes","    --step-0",[203,348,349],{"class":208},": ",[203,351,352],{"class":216},"clamp",[203,354,355],{"class":208},"(",[203,357,358],{"class":216},"1",[203,360,362],{"class":361},"sHUrx","rem",[203,364,365],{"class":208},", ",[203,367,368],{"class":216},"0.9",[203,370,362],{"class":361},[203,372,373],{"class":345}," +",[203,375,376],{"class":216}," 0.5",[203,378,379],{"class":361},"vw",[203,381,365],{"class":208},[203,383,384],{"class":216},"1.25",[203,386,362],{"class":361},[203,388,389],{"class":208},");\n",[203,391,393,396,398,400,402,405,407,409,412,414,416,419,421,423,426,428],{"class":103,"line":392},12,[203,394,395],{"class":345},"    --step-3",[203,397,349],{"class":208},[203,399,352],{"class":216},[203,401,355],{"class":208},[203,403,404],{"class":216},"1.75",[203,406,362],{"class":361},[203,408,365],{"class":208},[203,410,411],{"class":216},"1.2",[203,413,362],{"class":361},[203,415,373],{"class":345},[203,417,418],{"class":216}," 2.5",[203,420,379],{"class":361},[203,422,365],{"class":208},[203,424,425],{"class":216},"3",[203,427,362],{"class":361},[203,429,389],{"class":208},[203,431,433],{"class":103,"line":432},13,[203,434,435],{"class":208},"  }\n",[203,437,439],{"class":103,"line":438},14,[203,440,442],{"emptyLinePlaceholder":441},true,"\n",[203,444,446,449],{"class":103,"line":445},15,[203,447,448],{"class":212},"  body",[203,450,326],{"class":208},[203,452,454,457,459,462],{"class":103,"line":453},16,[203,455,456],{"class":216},"    margin",[203,458,349],{"class":208},[203,460,461],{"class":216},"0",[203,463,464],{"class":208},";\n",[203,466,468,471,473,475,477],{"class":103,"line":467},17,[203,469,470],{"class":216},"    padding",[203,472,349],{"class":208},[203,474,109],{"class":216},[203,476,362],{"class":361},[203,478,464],{"class":208},[203,480,482,485,487,490,492,495],{"class":103,"line":481},18,[203,483,484],{"class":216},"    font-family",[203,486,349],{"class":208},[203,488,489],{"class":216},"Georgia",[203,491,365],{"class":208},[203,493,494],{"class":216},"serif",[203,496,464],{"class":208},[203,498,500,503,505,508,510,513],{"class":103,"line":499},19,[203,501,502],{"class":216},"    font-size",[203,504,349],{"class":208},[203,506,507],{"class":216},"var",[203,509,355],{"class":208},[203,511,512],{"class":345},"--step-0",[203,514,389],{"class":208},[203,516,518,521,523,526,529],{"class":103,"line":517},20,[203,519,520],{"class":216},"    line-height",[203,522,349],{"class":208},[203,524,525],{"class":216},"1.65",[203,527,528],{"class":208},";          ",[203,530,531],{"class":332},"\u002F* unitless default, inherits as a ratio *\u002F\n",[203,533,535],{"class":103,"line":534},21,[203,536,435],{"class":208},[203,538,540],{"class":103,"line":539},22,[203,541,442],{"emptyLinePlaceholder":441},[203,543,545,548],{"class":103,"line":544},23,[203,546,547],{"class":216},"  .prose",[203,549,326],{"class":208},[203,551,553],{"class":103,"line":552},24,[203,554,555],{"class":332},"    \u002F* Measure: about 65 characters, never wider than the space available.\n",[203,557,559],{"class":103,"line":558},25,[203,560,561],{"class":332},"       ch is the width of \"0\" in the current font, so the cap scales with\n",[203,563,565],{"class":103,"line":564},26,[203,566,567],{"class":332},"       font size and zoom. *\u002F\n",[203,569,571,574,576,579,581,584,586,588,590,593],{"class":103,"line":570},27,[203,572,573],{"class":216},"    max-width",[203,575,349],{"class":208},[203,577,578],{"class":216},"min",[203,580,355],{"class":208},[203,582,583],{"class":216},"65",[203,585,187],{"class":361},[203,587,365],{"class":208},[203,589,133],{"class":216},[203,591,592],{"class":361},"%",[203,594,389],{"class":208},[203,596,598,601,603,606],{"class":103,"line":597},28,[203,599,600],{"class":216},"    margin-inline",[203,602,349],{"class":208},[203,604,605],{"class":216},"auto",[203,607,464],{"class":208},[203,609,611],{"class":103,"line":610},29,[203,612,435],{"class":208},[203,614,616],{"class":103,"line":615},30,[203,617,442],{"emptyLinePlaceholder":441},[203,619,621,623,626],{"class":103,"line":620},31,[203,622,547],{"class":216},[203,624,625],{"class":212}," h2",[203,627,326],{"class":208},[203,629,631,633,635,637,639,642],{"class":103,"line":630},32,[203,632,502],{"class":216},[203,634,349],{"class":208},[203,636,507],{"class":216},[203,638,355],{"class":208},[203,640,641],{"class":345},"--step-3",[203,643,389],{"class":208},[203,645,647],{"class":103,"line":646},33,[203,648,649],{"class":332},"    \u002F* Display leading: tight, and a little tighter at the largest size. *\u002F\n",[203,651,653,655,657,660],{"class":103,"line":652},34,[203,654,520],{"class":216},[203,656,349],{"class":208},[203,658,659],{"class":216},"1.15",[203,661,464],{"class":208},[203,663,665],{"class":103,"line":664},35,[203,666,667],{"class":332},"    \u002F* Balanced wrapping stops a single orphaned word on the last line. *\u002F\n",[203,669,671,674,676,679],{"class":103,"line":670},36,[203,672,673],{"class":216},"    text-wrap",[203,675,349],{"class":208},[203,677,678],{"class":216},"balance",[203,680,464],{"class":208},[203,682,684,687,689,691,693,695,697],{"class":103,"line":683},37,[203,685,686],{"class":216},"    margin-block",[203,688,349],{"class":208},[203,690,109],{"class":216},[203,692,53],{"class":361},[203,694,376],{"class":216},[203,696,53],{"class":361},[203,698,464],{"class":208},[203,700,702],{"class":103,"line":701},38,[203,703,435],{"class":208},[203,705,707],{"class":103,"line":706},39,[203,708,442],{"emptyLinePlaceholder":441},[203,710,712,714,717],{"class":103,"line":711},40,[203,713,547],{"class":216},[203,715,716],{"class":212}," p",[203,718,326],{"class":208},[203,720,722,724,726,728,731,733],{"class":103,"line":721},41,[203,723,686],{"class":216},[203,725,349],{"class":208},[203,727,461],{"class":216},[203,729,730],{"class":216}," 1",[203,732,53],{"class":361},[203,734,464],{"class":208},[203,736,738],{"class":103,"line":737},42,[203,739,740],{"class":332},"    \u002F* Leading eases from 1.65 at 16px toward 1.575 at 20px.\n",[203,742,744],{"class":103,"line":743},43,[203,745,746],{"class":332},"       tan(atan2(1em, 1rem)) is font size ÷ root size as a plain number. *\u002F\n",[203,748,750,752,754,756,758,760,762,765,768,771,774,777,779,782,784,786,788,790,792,794,797,799],{"class":103,"line":749},44,[203,751,520],{"class":216},[203,753,349],{"class":208},[203,755,352],{"class":216},[203,757,355],{"class":208},[203,759,109],{"class":216},[203,761,365],{"class":208},[203,763,764],{"class":216},"1.95",[203,766,767],{"class":345}," -",[203,769,770],{"class":216}," 0.3",[203,772,773],{"class":345}," *",[203,775,776],{"class":216}," tan",[203,778,355],{"class":208},[203,780,781],{"class":216},"atan2",[203,783,355],{"class":208},[203,785,358],{"class":216},[203,787,53],{"class":361},[203,789,365],{"class":208},[203,791,358],{"class":216},[203,793,362],{"class":361},[203,795,796],{"class":208},")), ",[203,798,125],{"class":216},[203,800,389],{"class":208},[203,802,804,806,809],{"class":103,"line":803},45,[203,805,673],{"class":216},[203,807,808],{"class":208},": pretty;          ",[203,810,811],{"class":332},"\u002F* avoid very short last lines in paragraphs *\u002F\n",[203,813,815],{"class":103,"line":814},46,[203,816,435],{"class":208},[203,818,820,823,825],{"class":103,"line":819},47,[203,821,822],{"class":208},"\u003C\u002F",[203,824,315],{"class":212},[203,826,220],{"class":208},[203,828,830,832,834],{"class":103,"line":829},48,[203,831,822],{"class":208},[203,833,248],{"class":212},[203,835,220],{"class":208},[203,837,839,841,844],{"class":103,"line":838},49,[203,840,226],{"class":208},[203,842,843],{"class":212},"body",[203,845,220],{"class":208},[203,847,849,852,855,858,860,863],{"class":103,"line":848},50,[203,850,851],{"class":208},"  \u003C",[203,853,854],{"class":212},"article",[203,856,857],{"class":216}," class",[203,859,234],{"class":208},[203,861,862],{"class":237},"\"prose\"",[203,864,220],{"class":208},[203,866,868,871,873,876,878],{"class":103,"line":867},51,[203,869,870],{"class":208},"    \u003C",[203,872,34],{"class":212},[203,874,875],{"class":208},">What the coastline remembers about the storm\u003C\u002F",[203,877,34],{"class":212},[203,879,220],{"class":208},[203,881,883,885,887],{"class":103,"line":882},52,[203,884,870],{"class":208},[203,886,14],{"class":212},[203,888,889],{"class":208},">Line length and leading work together. As the text grows, the measure stays\n",[203,891,893,896,898],{"class":103,"line":892},53,[203,894,895],{"class":208},"       near sixty-five characters and the leading eases so lines stay easy to follow.\u003C\u002F",[203,897,14],{"class":212},[203,899,220],{"class":208},[203,901,903,906,908],{"class":103,"line":902},54,[203,904,905],{"class":208},"  \u003C\u002F",[203,907,854],{"class":212},[203,909,220],{"class":208},[203,911,913,915,917],{"class":103,"line":912},55,[203,914,822],{"class":208},[203,916,843],{"class":212},[203,918,220],{"class":208},[203,920,922,924,926],{"class":103,"line":921},56,[203,923,822],{"class":208},[203,925,198],{"class":212},[203,927,220],{"class":208},[14,929,930,931,934,935,938,939,942,943,946],{},"The paragraph line height is the part that needs explaining. The formula most people reach for first — something like ",[18,932,933],{},"1.8 - 0.25 * (var(--step-0) - 1rem) \u002F 0.25rem"," — is ",[48,936,937],{},"invalid",": it divides a length by a length, which ",[18,940,941],{},"calc()"," does not allow, so the whole declaration is silently dropped. The working version above uses ",[18,944,945],{},"tan(atan2(1em, 1rem))"," to obtain the size ratio as a plain number, and the next section explains that idiom alongside two simpler alternatives.",[34,948,950],{"id":949},"the-key-technique-expressing-a-size-dependent-ratio","The key technique: expressing a size-dependent ratio",[14,952,953,954,956],{},"CSS arithmetic has type rules: lengths can be added to lengths and multiplied by numbers, but a length divided by a length is not permitted in ",[18,955,941],{},". That rules out the direct \"leading as a function of font size\" formula. There are three working alternatives, from simplest to most precise.",[78,958,85,961,85,964,85,967,85,970,85,977,85,982,85,986,85,990,85,993,85,998,85,1000,85,1003,85,1006,85,1010,85,1013,85,1016,85,1019,85,1023,85,1025,85,1028,85,1031],{"viewBox":959,"role":81,"ariaLabel":960,"xmlns":83,"style":84},"0 0 720 300","Three working approaches to size-dependent line height: a length-based line height, stepped values per scale step, and the tan(atan2()) ratio idiom",[87,962,963],{},"Three ways to make leading depend on size",[91,965,966],{},"First, a line height written as a length such as calc(1em + 0.5rem) naturally shrinks as a ratio when the font grows. Second, per-step unitless values assigned to each type-scale step. Third, tan(atan2(a, b)) to turn a ratio of lengths into a number for use in clamp.",[95,968,969],{"textAnchor":97,"x":98,"y":99,"style":100},"Working alternatives to dividing lengths",[131,971],{"x":972,"y":113,"width":973,"height":974,"rx":975,"fill":137,"opacity":976},"20","220","200","10","0.34",[95,978,981],{"textAnchor":97,"x":163,"y":979,"style":980},"78","text-anchor:middle;fill:currentColor;font:700 13px sans-serif","1. em + rem",[95,983,985],{"textAnchor":97,"x":163,"y":984,"style":165},"108","calc(1em + 0.5rem)",[95,987,989],{"textAnchor":97,"x":163,"y":988,"style":143},"150","ratio falls as size",[95,991,992],{"textAnchor":97,"x":163,"y":135,"style":143},"grows, automatically",[95,994,997],{"textAnchor":97,"x":163,"y":995,"style":996},"224","text-anchor:middle;fill:currentColor;font:600 12px sans-serif","simplest",[131,999],{"x":128,"y":113,"width":973,"height":974,"rx":975,"fill":137,"opacity":138},[95,1001,1002],{"textAnchor":97,"x":98,"y":979,"style":980},"2. per-step values",[95,1004,1005],{"textAnchor":97,"x":98,"y":984,"style":165},"--lh-0: 1.65",[95,1007,1009],{"textAnchor":97,"x":98,"y":1008,"style":165},"126","--lh-3: 1.15",[95,1011,1012],{"textAnchor":97,"x":98,"y":135,"style":143},"one ratio per step",[95,1014,1015],{"textAnchor":97,"x":98,"y":995,"style":996},"most predictable",[131,1017],{"x":147,"y":113,"width":973,"height":974,"rx":975,"fill":137,"opacity":1018},"0.12",[95,1020,1022],{"textAnchor":97,"x":1021,"y":979,"style":980},"590","3. tan(atan2())",[95,1024,945],{"textAnchor":97,"x":1021,"y":984,"style":165},[95,1026,1027],{"textAnchor":97,"x":1021,"y":988,"style":143},"length ratio as a",[95,1029,1030],{"textAnchor":97,"x":1021,"y":135,"style":143},"plain number",[95,1032,1033],{"textAnchor":97,"x":1021,"y":995,"style":996},"most precise",[14,1035,1036,1039,1040,1043],{},[48,1037,1038],{},"1. Let a length-based line height do the maths."," ",[18,1041,1042],{},"line-height: calc(1em + 0.5rem)"," adds a fixed half-rem of leading to the font size. At 16 pixels that is 24 pixels, a ratio of 1.5; at 48 pixels it is 56, a ratio of about 1.17. The ratio falls as size grows, which is exactly the desired behaviour, with no division at all. The trade-off is that a length line height inherits as a computed length, so set it on each text element rather than on a container.",[14,1045,1046,1049],{},[48,1047,1048],{},"2. Assign a ratio per scale step."," Type scales have a handful of steps; give each a unitless line height token. Predictable, easy to review, and it inherits correctly.",[194,1051,1055],{"className":1052,"code":1053,"language":1054,"meta":199,"style":199},"language-css shiki shiki-themes github-light-high-contrast github-dark-high-contrast",":root {\n  --lh-0: 1.65;   \u002F* body *\u002F\n  --lh-1: 1.45;   \u002F* lead paragraph *\u002F\n  --lh-2: 1.3;    \u002F* h3 *\u002F\n  --lh-3: 1.15;   \u002F* h2 *\u002F\n  --lh-4: 1.08;   \u002F* h1 *\u002F\n}\np  { font-size: var(--step-0); line-height: var(--lh-0); }\nh2 { font-size: var(--step-3); line-height: var(--lh-3); }\n","css",[18,1056,1057,1064,1079,1094,1110,1124,1139,1144,1180],{"__ignoreMap":199},[203,1058,1059,1062],{"class":103,"line":205},[203,1060,1061],{"class":216},":root",[203,1063,326],{"class":208},[203,1065,1066,1069,1071,1073,1076],{"class":103,"line":223},[203,1067,1068],{"class":345},"  --lh-0",[203,1070,349],{"class":208},[203,1072,525],{"class":216},[203,1074,1075],{"class":208},";   ",[203,1077,1078],{"class":332},"\u002F* body *\u002F\n",[203,1080,1081,1084,1086,1089,1091],{"class":103,"line":243},[203,1082,1083],{"class":345},"  --lh-1",[203,1085,349],{"class":208},[203,1087,1088],{"class":216},"1.45",[203,1090,1075],{"class":208},[203,1092,1093],{"class":332},"\u002F* lead paragraph *\u002F\n",[203,1095,1096,1099,1101,1104,1107],{"class":103,"line":253},[203,1097,1098],{"class":345},"  --lh-2",[203,1100,349],{"class":208},[203,1102,1103],{"class":216},"1.3",[203,1105,1106],{"class":208},";    ",[203,1108,1109],{"class":332},"\u002F* h3 *\u002F\n",[203,1111,1112,1115,1117,1119,1121],{"class":103,"line":271},[203,1113,1114],{"class":345},"  --lh-3",[203,1116,349],{"class":208},[203,1118,659],{"class":216},[203,1120,1075],{"class":208},[203,1122,1123],{"class":332},"\u002F* h2 *\u002F\n",[203,1125,1126,1129,1131,1134,1136],{"class":103,"line":296},[203,1127,1128],{"class":345},"  --lh-4",[203,1130,349],{"class":208},[203,1132,1133],{"class":216},"1.08",[203,1135,1075],{"class":208},[203,1137,1138],{"class":332},"\u002F* h1 *\u002F\n",[203,1140,1141],{"class":103,"line":310},[203,1142,1143],{"class":208},"}\n",[203,1145,1146,1148,1151,1154,1156,1158,1160,1162,1165,1168,1170,1172,1174,1177],{"class":103,"line":320},[203,1147,14],{"class":212},[203,1149,1150],{"class":208},"  { ",[203,1152,1153],{"class":216},"font-size",[203,1155,349],{"class":208},[203,1157,507],{"class":216},[203,1159,355],{"class":208},[203,1161,512],{"class":345},[203,1163,1164],{"class":208},"); ",[203,1166,1167],{"class":216},"line-height",[203,1169,349],{"class":208},[203,1171,507],{"class":216},[203,1173,355],{"class":208},[203,1175,1176],{"class":345},"--lh-0",[203,1178,1179],{"class":208},"); }\n",[203,1181,1182,1184,1187,1189,1191,1193,1195,1197,1199,1201,1203,1205,1207,1210],{"class":103,"line":329},[203,1183,34],{"class":212},[203,1185,1186],{"class":208}," { ",[203,1188,1153],{"class":216},[203,1190,349],{"class":208},[203,1192,507],{"class":216},[203,1194,355],{"class":208},[203,1196,641],{"class":345},[203,1198,1164],{"class":208},[203,1200,1167],{"class":216},[203,1202,349],{"class":208},[203,1204,507],{"class":216},[203,1206,355],{"class":208},[203,1208,1209],{"class":345},"--lh-3",[203,1211,1179],{"class":208},[14,1213,1214,1039,1221,1224,1225,1228,1229,1232,1233,1235,1236,1238],{},[48,1215,1216,1217,1220],{},"3. Compute a ratio with ",[18,1218,1219],{},"tan(atan2())",".",[18,1222,1223],{},"atan2(a, b)"," accepts two lengths and returns an angle; ",[18,1226,1227],{},"tan()"," of that angle is the plain number ",[18,1230,1231],{},"a \u002F b",". So ",[18,1234,945],{}," is the element's font size divided by the root font size, as a number usable in ",[18,1237,20],{},":",[194,1240,1242],{"className":1052,"code":1241,"language":1054,"meta":199,"style":199},"p {\n  font-size: var(--step-0);\n  \u002F* ratio = current size \u002F 1rem, e.g. 1 at 16px, 1.25 at 20px *\u002F\n  --ratio: tan(atan2(1em, 1rem));\n  line-height: clamp(1.5, 1.95 - 0.3 * var(--ratio), 1.7);\n}\n",[18,1243,1244,1250,1265,1270,1299,1337],{"__ignoreMap":199},[203,1245,1246,1248],{"class":103,"line":205},[203,1247,14],{"class":212},[203,1249,326],{"class":208},[203,1251,1252,1255,1257,1259,1261,1263],{"class":103,"line":223},[203,1253,1254],{"class":216},"  font-size",[203,1256,349],{"class":208},[203,1258,507],{"class":216},[203,1260,355],{"class":208},[203,1262,512],{"class":345},[203,1264,389],{"class":208},[203,1266,1267],{"class":103,"line":243},[203,1268,1269],{"class":332},"  \u002F* ratio = current size \u002F 1rem, e.g. 1 at 16px, 1.25 at 20px *\u002F\n",[203,1271,1272,1275,1277,1280,1282,1284,1286,1288,1290,1292,1294,1296],{"class":103,"line":253},[203,1273,1274],{"class":345},"  --ratio",[203,1276,349],{"class":208},[203,1278,1279],{"class":216},"tan",[203,1281,355],{"class":208},[203,1283,781],{"class":216},[203,1285,355],{"class":208},[203,1287,358],{"class":216},[203,1289,53],{"class":361},[203,1291,365],{"class":208},[203,1293,358],{"class":216},[203,1295,362],{"class":361},[203,1297,1298],{"class":208},"));\n",[203,1300,1301,1304,1306,1308,1310,1312,1314,1316,1318,1320,1322,1325,1327,1330,1333,1335],{"class":103,"line":271},[203,1302,1303],{"class":216},"  line-height",[203,1305,349],{"class":208},[203,1307,352],{"class":216},[203,1309,355],{"class":208},[203,1311,109],{"class":216},[203,1313,365],{"class":208},[203,1315,764],{"class":216},[203,1317,767],{"class":345},[203,1319,770],{"class":216},[203,1321,773],{"class":345},[203,1323,1324],{"class":216}," var",[203,1326,355],{"class":208},[203,1328,1329],{"class":345},"--ratio",[203,1331,1332],{"class":208},"), ",[203,1334,125],{"class":216},[203,1336,389],{"class":208},[203,1338,1339],{"class":103,"line":296},[203,1340,1143],{"class":208},[14,1342,1343,1344,1348],{},"At a 16-pixel font the ratio is 1 and the leading is 1.65; at 20 pixels the ratio is 1.25 and the leading is 1.575. The same idiom is used for motion in ",[23,1345,1347],{"href":1346},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-that-scales-with-container-size\u002F","Motion That Scales With Container Size",", where the ratio of container width to a reference length drives duration.",[34,1350,1352,1353,365,1355,1358],{"id":1351},"measure-ch-min-and-container-widths","Measure: ",[18,1354,187],{},[18,1356,1357],{},"min()"," and container widths",[14,1360,1361,1362,1365,1366,1369,1370,1372],{},"The measure should be capped in a font-relative unit so it scales with the text. ",[18,1363,1364],{},"max-width: 65ch"," keeps roughly 65 characters per line regardless of font size or zoom: when the user zooms to 200%, the characters double in size and so does the cap, so the number of characters per line stays constant and the line simply wraps within a narrower viewport. A ",[18,1367,1368],{},"px"," or ",[18,1371,362],{}," cap does not track a fluid font size and drifts in characters-per-line as the size scales.",[14,1374,1375,1376,1378,1379,1382,1383,1386],{},"Wrap the cap in ",[18,1377,1357],{}," with ",[18,1380,1381],{},"100%"," so it never exceeds the space available, which matters inside narrow containers and at high zoom. Where the text lives inside a component, the same logic applies to the component's width — a card's description can use ",[18,1384,1385],{},"max-width: min(55ch, 100%)"," and the card's container query can adjust type size, with the measure following automatically.",[14,1388,1389,1391,1392,1394,1395,1220],{},[18,1390,187],{}," is not exact: it is the advance width of the \"0\" glyph, and average character widths vary by font. For proportional serif fonts, 65ch typically yields somewhat more than 65 average characters, so designers often choose 60 to 70 and check by eye. The accessibility dimension of zoom, including why the ",[18,1393,362],{}," term in the font size is not optional, is covered in ",[23,1396,1398],{"href":1397},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom\u002F","Fluid Type, Accessibility and Zoom",[34,1400,1402],{"id":1401},"variation-user-spacing-overrides","Variation: user spacing overrides",[14,1404,1405],{},"WCAG 1.4.12 Text Spacing requires that no content is lost when users override line height to 1.5, paragraph spacing to 2 times the font size, letter spacing to 0.12em and word spacing to 0.16em — typically with a browser extension or user stylesheet. Fluid line heights must survive those overrides.",[194,1407,1409],{"className":1052,"code":1408,"language":1054,"meta":199,"style":199},"\u002F* Avoid fixed heights on text containers: an override that increases\n   leading must be able to make the box taller. *\u002F\n.card__excerpt {\n  \u002F* Fragile: clips text when the user raises line-height. *\u002F\n  \u002F* height: 4.5em; overflow: hidden; *\u002F\n\n  \u002F* Robust: clamp by lines instead, and let the box grow. *\u002F\n  display: -webkit-box;\n  -webkit-box-orient: vertical;\n  -webkit-line-clamp: 3;\n  line-clamp: 3;\n  overflow: hidden;\n}\n",[18,1410,1411,1416,1421,1428,1433,1438,1442,1447,1459,1471,1482,1493,1505],{"__ignoreMap":199},[203,1412,1413],{"class":103,"line":205},[203,1414,1415],{"class":332},"\u002F* Avoid fixed heights on text containers: an override that increases\n",[203,1417,1418],{"class":103,"line":223},[203,1419,1420],{"class":332},"   leading must be able to make the box taller. *\u002F\n",[203,1422,1423,1426],{"class":103,"line":243},[203,1424,1425],{"class":216},".card__excerpt",[203,1427,326],{"class":208},[203,1429,1430],{"class":103,"line":253},[203,1431,1432],{"class":332},"  \u002F* Fragile: clips text when the user raises line-height. *\u002F\n",[203,1434,1435],{"class":103,"line":271},[203,1436,1437],{"class":332},"  \u002F* height: 4.5em; overflow: hidden; *\u002F\n",[203,1439,1440],{"class":103,"line":296},[203,1441,442],{"emptyLinePlaceholder":441},[203,1443,1444],{"class":103,"line":310},[203,1445,1446],{"class":332},"  \u002F* Robust: clamp by lines instead, and let the box grow. *\u002F\n",[203,1448,1449,1452,1454,1457],{"class":103,"line":320},[203,1450,1451],{"class":216},"  display",[203,1453,349],{"class":208},[203,1455,1456],{"class":216},"-webkit-box",[203,1458,464],{"class":208},[203,1460,1461,1464,1466,1469],{"class":103,"line":329},[203,1462,1463],{"class":216},"  -webkit-box-orient",[203,1465,349],{"class":208},[203,1467,1468],{"class":216},"vertical",[203,1470,464],{"class":208},[203,1472,1473,1476,1478,1480],{"class":103,"line":336},[203,1474,1475],{"class":216},"  -webkit-line-clamp",[203,1477,349],{"class":208},[203,1479,425],{"class":216},[203,1481,464],{"class":208},[203,1483,1484,1487,1489,1491],{"class":103,"line":342},[203,1485,1486],{"class":216},"  line-clamp",[203,1488,349],{"class":208},[203,1490,425],{"class":216},[203,1492,464],{"class":208},[203,1494,1495,1498,1500,1503],{"class":103,"line":392},[203,1496,1497],{"class":216},"  overflow",[203,1499,349],{"class":208},[203,1501,1502],{"class":216},"hidden",[203,1504,464],{"class":208},[203,1506,1507],{"class":103,"line":432},[203,1508,1143],{"class":208},[14,1510,1511,1512,1369,1514,1516],{},"The rule of thumb is that anything whose height depends on text must be allowed to grow. Fixed heights in ",[18,1513,53],{},[18,1515,1368],{}," on text boxes are the most common cause of text-spacing failures, and they are easy to introduce when tuning fluid leading by eye.",[34,1518,1520],{"id":1519},"browser-support","Browser support",[14,1522,1523,365,1525,1527,1528,1531,1532,1534,1535,1538,1539,1542,1543,1545],{},[18,1524,20],{},[18,1526,1357],{}," and ",[18,1529,1530],{},"max()"," are supported in Chrome and Edge 79+, Firefox 75+ and Safari 13.1+. The trigonometric functions used for ",[18,1533,1219],{}," are supported in current versions of all three engines. ",[18,1536,1537],{},"text-wrap: balance"," is supported in Chrome and Edge 114+, Firefox 121+ and Safari 17.5+; ",[18,1540,1541],{},"text-wrap: pretty"," is newer and supported in current Chromium and Safari, with other engines treating it as normal wrapping. The ",[18,1544,187],{}," unit is universally supported.",[34,1547,1549],{"id":1548},"faq","FAQ",[14,1551,1552,1555],{},[48,1553,1554],{},"Should line-height get smaller as font size gets larger?","\nGenerally yes. Large display text reads better with tight leading around 1.1 to 1.2, while body text needs more, around 1.5 to 1.7. A fluid type scale should therefore let line-height decrease as size increases rather than keeping one ratio for everything.",[14,1557,1558,1561,1562,1564],{},[48,1559,1560],{},"What is a good measure for body text?","\nRoughly 45 to 75 characters per line, with about 65 a common target. In CSS that is ",[18,1563,1364],{}," on the text container, which tracks the font so the character count stays stable when the text is zoomed.",[14,1566,1567,1573,1574,1576,1577,1579],{},[48,1568,1569,1570,1572],{},"Can line-height use ",[18,1571,20],{},"?","\nYes. ",[18,1575,1167],{}," accepts lengths and unitless numbers, and ",[18,1578,20],{}," works with either. Unitless values are usually better because they inherit as a ratio, so nested elements with different font sizes get proportional leading.",[14,1581,1582,1585],{},[48,1583,1584],{},"Why does my text look too loose on wide screens?","\nUsually because the font size grew with the viewport but line-height and measure did not adapt. Long lines with generous leading make it hard for the eye to find the start of the next line. Cap the measure and let line-height tighten slightly as lines get longer.",[34,1587,1589],{"id":1588},"related","Related",[42,1591,1592,1597,1604,1611],{},[45,1593,1594,1596],{},[23,1595,26],{"href":25}," — the parent guide.",[45,1598,1599,1603],{},[23,1600,1602],{"href":1601},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript\u002F","Fluid Typography Without JavaScript"," — building the size scale these values follow.",[45,1605,1606,1610],{},[23,1607,1609],{"href":1608},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ftext-wrap-balance-and-pretty\u002F","Text Wrap Balance and Pretty"," — controlling where lines break.",[45,1612,1613,1617],{},[23,1614,1616],{"href":1615},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Ffull-bleed-sections-in-constrained-layouts\u002F","Full-Bleed Sections in Constrained Layouts"," — the grid that holds a measured column.",[315,1619,1620],{},"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 .sLBg1, html code.shiki .sLBg1{--shiki-default:#66707B;--shiki-dark:#BDC4CC}html pre.shiki code .soyes, html code.shiki .soyes{--shiki-default:#702C00;--shiki-dark:#FFB757}html pre.shiki code .sHUrx, html code.shiki .sHUrx{--shiki-default:#A0111F;--shiki-dark:#FF9492}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":1622},[1623,1624,1625,1626,1628,1629,1630,1631],{"id":36,"depth":223,"text":37},{"id":180,"depth":223,"text":181},{"id":949,"depth":223,"text":950},{"id":1351,"depth":223,"text":1627},"Measure: ch, min() and container widths",{"id":1401,"depth":223,"text":1402},{"id":1519,"depth":223,"text":1520},{"id":1548,"depth":223,"text":1549},{"id":1588,"depth":223,"text":1589},"Scale line-height inversely with font size and keep line length in a readable range with ch-based measures and clamp(), without breaking zoom or text spacing.","md",{"pageTitle":1635,"datePublished":1636,"dateModified":1636,"faq":1637},"Fluid Line Height and Measure With clamp()","2026-09-18",[1638,1640,1642,1645],{"q":1554,"a":1639},"Generally yes. Large display text reads better with tight leading around 1.1 to 1.2, while body text needs more, around 1.5 to 1.7. A fluid type scale should therefore let line-height decrease as size increases rather than keeping one ratio for everything.",{"q":1560,"a":1641},"Roughly 45 to 75 characters per line, with about 65 a common target. In CSS that is max-width: 65ch on the text container, which tracks the font so the character count stays stable when the text is zoomed.",{"q":1643,"a":1644},"Can line-height use clamp()?","Yes. line-height accepts lengths and unitless numbers, and clamp() works with either. Unitless values are usually better because they inherit as a ratio, so nested elements with different font sizes get proportional leading.",{"q":1584,"a":1646},"Usually because the font size grew with the viewport but line-height and measure did not adapt. Long lines with generous leading make it hard for the eye to find the start of the next line. Cap the measure and let line-height tighten slightly as lines get longer.","\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-line-height-and-measure",{"title":5,"description":1632},"mastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-line-height-and-measure\u002Findex","8eU7zlQsRIakyyIfbVcj3A3ZbhlSsBcbgUdojkuah0o",[1652,1655,1658,1661,1664,1667,1670,1673,1676,1679,1682,1685,1688,1691,1694,1697,1700,1703,1706,1709,1712,1715,1718,1721,1724,1727,1730,1733,1736,1739,1742,1745,1748,1751,1754,1757,1760,1763,1766,1769,1772,1775,1778,1781,1784,1787,1790,1793,1796,1799,1802,1805,1808,1811,1814,1817,1820,1823,1826,1829,1832,1835,1838,1841,1844,1847,1850,1853,1856,1859,1862,1865,1868,1871,1874,1877,1880,1883,1886,1889,1892,1895,1898,1901,1904,1907,1910,1913,1916,1919,1922,1925,1928,1931,1934,1937,1940,1943,1946,1949,1952,1955,1958,1961,1964,1967,1970,1973,1976,1979,1982,1985,1988,1991,1994,1997,2000,2003,2006,2009,2012,2015,2018,2021,2024,2027,2030,2033,2036,2039,2042,2045,2048,2051,2054,2055,2058,2061,2064,2067,2070,2072,2075,2078,2081,2084,2087,2090,2093,2096,2099,2102,2105,2108,2111,2114,2117,2120,2123,2126,2129,2132,2135,2138,2141,2144,2147,2150,2153,2156,2159,2162,2165,2168,2171,2174,2177,2180,2183,2186,2189,2192,2195,2198,2201,2204,2207],{"path":1653,"title":1654},"\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":1656,"title":1657},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":1659,"title":1660},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":1662,"title":1663},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":1665,"title":1666},"\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":1668,"title":1669},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":1671,"title":1672},"\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":1674,"title":1675},"\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":1677,"title":1678},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":1680,"title":1681},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":1683,"title":1684},"\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":1686,"title":1687},"\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":1689,"title":1690},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":1692,"title":1693},"\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":1695,"title":1696},"\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":1698,"title":1699},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":1701,"title":1702},"\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":1704,"title":1705},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":1707,"title":1708},"\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":1710,"title":1711},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":1713,"title":1714},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":1716,"title":1717},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":1719,"title":1720},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":1722,"title":1723},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":1725,"title":1726},"\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":1728,"title":1729},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":1731,"title":1732},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":1734,"title":1735},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":1737,"title":1738},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":1740,"title":1741},"\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":1743,"title":1744},"\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":1746,"title":1747},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":1749,"title":1750},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":1752,"title":1753},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":1755,"title":1756},"\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":1758,"title":1759},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":1761,"title":1762},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":1764,"title":1765},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":1767,"title":1768},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":1770,"title":1771},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":1773,"title":1774},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":1776,"title":1777},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":1779,"title":1780},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":1782,"title":1783},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":1785,"title":1786},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"path":1788,"title":1789},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":1791,"title":1792},"\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":1794,"title":1795},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":1797,"title":1798},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":1800,"title":1801},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":1803,"title":1804},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":1806,"title":1807},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":1809,"title":1810},"\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":1812,"title":1813},"\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":1815,"title":1816},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":1818,"title":1819},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states","Button Press and  States",{"path":1821,"title":1822},"\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":1824,"title":1825},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":1827,"title":1828},"\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":1830,"title":1831},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":1833,"title":1834},"\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":1836,"title":1837},"\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":1839,"title":1840},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":1842,"title":1843},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking","Stacking Animations With animation-composition",{"path":1845,"title":1846},"\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":1848,"title":1849},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":1851,"title":1852},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":1854,"title":1855},"\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":1857,"title":1858},"\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":1860,"title":1861},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":1863,"title":1864},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":1866,"title":1867},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":1869,"title":1870},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply","Animating box-shadow and Filters Cheaply",{"path":1872,"title":1873},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":1875,"title":1876},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite","Layout, Paint and Composite: What Triggers What",{"path":1878,"title":1879},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":1881,"title":1882},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":1884,"title":1885},"\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":1887,"title":1888},"\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":1890,"title":1891},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":1893,"title":1894},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":1896,"title":1897},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects","Scroll-Driven Parallax Effects in CSS",{"path":1899,"title":1900},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":1902,"title":1903},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":1905,"title":1906},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":1908,"title":1909},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range","View Timelines and animation-range",{"path":1911,"title":1912},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":1914,"title":1915},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":1917,"title":1918},"\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":1920,"title":1921},"\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":1923,"title":1924},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":1926,"title":1927},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":1929,"title":1930},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":1932,"title":1933},"\u002F","Modern CSS Layouts & Micro-Interactions",{"path":1935,"title":1936},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":1938,"title":1939},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":1941,"title":1942},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":1944,"title":1945},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":1947,"title":1948},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":1950,"title":1951},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":1953,"title":1954},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":1956,"title":1957},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":1959,"title":1960},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":1962,"title":1963},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":1965,"title":1966},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":1968,"title":1969},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":1971,"title":1972},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":1974,"title":1975},"\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":1977,"title":1978},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":1980,"title":1981},"\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":1983,"title":1984},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":1986,"title":1987},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":1989,"title":1990},"\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":1992,"title":1993},"\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":1995,"title":1996},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics","Container Query Syntax Basics",{"path":1998,"title":1999},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":2001,"title":2002},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":2004,"title":2005},"\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":2007,"title":2008},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":2010,"title":2011},"\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":2013,"title":2014},"\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":2016,"title":2017},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":2019,"title":2020},"\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":2022,"title":2023},"\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":2025,"title":2026},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":2028,"title":2029},"\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":2031,"title":2032},"\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":2034,"title":2035},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":2037,"title":2038},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":2040,"title":2041},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":2043,"title":2044},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":2046,"title":2047},"\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":2049,"title":2050},"\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":2052,"title":2053},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":1647,"title":5},{"path":2056,"title":2057},"\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":2059,"title":2060},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":2062,"title":2063},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":2065,"title":2066},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":2068,"title":2069},"\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":2071,"title":31},"\u002Fmastering-container-queries-responsive-layouts",{"path":2073,"title":2074},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":2076,"title":2077},"\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":2079,"title":2080},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":2082,"title":2083},"\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":2085,"title":2086},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":2088,"title":2089},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":2091,"title":2092},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":2094,"title":2095},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":2097,"title":2098},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":2100,"title":2101},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":2103,"title":2104},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":2106,"title":2107},"\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":2109,"title":2110},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset","Writing a Minimal Modern CSS Reset: Every Line Justified",{"path":2112,"title":2113},"\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":2115,"title":2116},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has","Empty and Loading States With ()",{"path":2118,"title":2119},"\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":2121,"title":2122},"\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":2124,"title":2125},"\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":2127,"title":2128},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"path":2130,"title":2131},"\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":2133,"title":2134},"\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":2136,"title":2137},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":2139,"title":2140},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":2142,"title":2143},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":2145,"title":2146},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":2148,"title":2149},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":2151,"title":2152},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":2154,"title":2155},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":2157,"title":2158},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions","Tabs That Become an Accordion: One Component, Two Layouts",{"path":2160,"title":2161},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":2163,"title":2164},"\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":2166,"title":2167},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":2169,"title":2170},"\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":2172,"title":2173},"\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":2175,"title":2176},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":2178,"title":2179},"\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":2181,"title":2182},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":2184,"title":2185},"\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":2187,"title":2188},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":2190,"title":2191},"\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":2193,"title":2194},"\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":2196,"title":2197},"\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":2199,"title":2200},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":2202,"title":2203},"\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":2205,"title":2206},"\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":2208,"title":2209},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":2211,"caption":2212,"height":2213,"resizable":441,"html":2214,"css":2215},"Fluid size, falling leading and a capped measure","Drag the frame wider: the text grows, lines stop lengthening at about 65 characters, and paragraph leading tightens slightly.",340,"\n\u003Carticle class=\"prose\">\n  \u003Ch2>What the coastline remembers about the storm\u003C\u002Fh2>\n  \u003Cp>Line length and leading work together. As the text grows, the measure stays near sixty-five characters and the leading eases so lines stay easy to follow from one to the next, even on a wide screen where an uncapped column would stretch much further.\u003C\u002Fp>\n\u003C\u002Farticle>","\n:root { --step-0: clamp(1rem, 0.9rem + 0.5vw, 1.25rem); --step-3: clamp(1.75rem, 1.2rem + 2.5vw, 3rem); }\nbody { display: block; font-family: Georgia, serif; font-size: var(--step-0); line-height: 1.65; }\n.prose { max-width: min(65ch, 100%); margin-inline: auto; }\n.prose h2 { font-size: var(--step-3); line-height: 1.15; text-wrap: balance; margin-block: 0 0.5em; }\n.prose p { margin-block: 0 1em; line-height: clamp(1.5, 1.95 - 0.3 * tan(atan2(1em, 1rem)), 1.7); text-wrap: pretty; }",1789717745581]