[{"data":1,"prerenderedAt":1820},["ShallowReactive",2],{"page-\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ftext-wrap-balance-and-pretty\u002F":3,"content-all-pages":1256,"live-demo:text-wrap-demo":1814},{"id":4,"title":5,"body":6,"description":1234,"extension":1235,"meta":1236,"navigation":463,"path":1252,"seo":1253,"stem":1254,"__hash__":1255},"content\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ftext-wrap-balance-and-pretty\u002Findex.md","text-wrap: balance and pretty: Better Line Breaks Without Manual Breaks",{"type":7,"value":8,"toc":1222},"minimark",[9,22,51,56,62,67,176,180,228,241,245,254,258,905,916,920,923,1004,1010,1014,1022,1032,1050,1054,1057,1070,1079,1088,1094,1104,1108,1117,1121,1132,1136,1152,1164,1178,1187,1191,1219],[10,11,13,17,18,21],"h1",{"id":12},"text-wrap-balance-and-pretty-better-line-breaks-without-manual-breaks",[14,15,16],"code",{},"text-wrap: balance"," and ",[14,19,20],{},"pretty",": Better Line Breaks Without Manual Breaks",[23,24,25,26,29,30,33,34,17,37,39,40,45,46,50],"p",{},"Responsive layouts reflow text constantly, and the browser's default line breaking is greedy: it fills each line as much as possible and moves on. That produces two familiar blemishes. A two-line heading has a full first line and a second line holding one or two words, so the heading looks lopsided. A paragraph ends with a single orphaned word on its last line, wasting a line of vertical space and drawing the eye. Designers used to fix both with manual ",[14,27,28],{},"\u003Cbr>"," tags or non-breaking spaces, which break as soon as the width changes. The ",[14,31,32],{},"text-wrap"," property now lets the browser choose better breaks at every width. This page explains what ",[14,35,36],{},"balance",[14,38,20],{}," do, their limits, their cost, and where they help or hurt. It belongs to ",[41,42,44],"a",{"href":43},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002F","Fluid Typography With clamp()"," in the ",[41,47,49],{"href":48},"\u002Fmastering-container-queries-responsive-layouts\u002F","Mastering Container Queries & Responsive Layouts"," guide.",[52,53,55],"h2",{"id":54},"why-manual-fixes-fail-in-fluid-layouts","Why manual fixes fail in fluid layouts",[23,57,58,59,61],{},"A ",[14,60,28],{}," inserted to balance a heading is correct at exactly one width. With fluid type and container-driven layouts, the heading's size and its container's width both change continuously, so a hand-placed break is wrong almost everywhere — often producing a three-line heading with a stub in the middle. Non-breaking spaces between the last two words prevent single-word last lines but can overflow narrow containers. Both techniques encode a layout assumption in content, which is the opposite of how responsive design should work.",[23,63,64,66],{},[14,65,32],{}," moves the decision into the layout engine, where the real width is known on every reflow.",[68,69,75,76,75,80,75,84,75,92,75,103,75,109,75,117,75,121,75,125,75,128,75,131,75,134,75,139,75,142,75,145,75,149,75,152,75,155,75,158,75,162,75,165,75,167,75,170,75,173],"svg",{"viewBox":70,"role":71,"ariaLabel":72,"xmlns":73,"style":74},"0 0 720 320","img","Three versions of the same heading and paragraph ending: greedy wrapping, balanced heading, and pretty paragraph ending","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[77,78,79],"title",{},"Greedy, balanced and pretty wrapping",[81,82,83],"desc",{},"Left, greedy wrapping gives a heading with a long first line and a one-word second line, and a paragraph ending in a single word. Middle, balance gives the heading two nearly equal lines. Right, pretty gives the paragraph a last line with several words.",[85,86,91],"text",{"textAnchor":87,"x":88,"y":89,"style":90},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","Where the lines break",[93,94],"rect",{"x":95,"y":96,"width":97,"height":97,"rx":98,"fill":99,"stroke":100,"strokeWidth":101,"opacity":102},"20","50","220","10","none","currentColor","1.5","0.5",[85,104,108],{"textAnchor":87,"x":105,"y":106,"style":107},"130","72","text-anchor:middle;fill:currentColor;font:600 12px ui-monospace,monospace","greedy (default)",[93,110],{"x":111,"y":112,"width":113,"height":114,"rx":115,"fill":116,"opacity":102},"36","88","188","16","3","#7aa2ff",[93,118],{"x":111,"y":119,"width":120,"height":114,"rx":115,"fill":116,"opacity":102},"110","44",[93,122],{"x":111,"y":123,"width":113,"height":98,"rx":115,"fill":100,"opacity":124},"150","0.25",[93,126],{"x":111,"y":127,"width":113,"height":98,"rx":115,"fill":100,"opacity":124},"168",[93,129],{"x":111,"y":130,"width":113,"height":98,"rx":115,"fill":100,"opacity":124},"186",[93,132],{"x":111,"y":133,"width":89,"height":98,"rx":115,"fill":100,"opacity":124},"204",[85,135,138],{"textAnchor":87,"x":105,"y":136,"style":137},"248","text-anchor:middle;fill:currentColor;font:11px sans-serif","stub heading, orphan word",[93,140],{"x":141,"y":96,"width":97,"height":97,"rx":98,"fill":99,"stroke":100,"strokeWidth":101,"opacity":102},"250",[85,143,144],{"textAnchor":87,"x":88,"y":106,"style":107},"balance (heading)",[93,146],{"x":147,"y":112,"width":148,"height":114,"rx":115,"fill":116,"opacity":102},"266","120",[93,150],{"x":147,"y":119,"width":151,"height":114,"rx":115,"fill":116,"opacity":102},"112",[85,153,154],{"textAnchor":87,"x":88,"y":136,"style":137},"two even lines",[93,156],{"x":157,"y":96,"width":97,"height":97,"rx":98,"fill":99,"stroke":100,"strokeWidth":101,"opacity":102},"480",[85,159,161],{"textAnchor":87,"x":160,"y":106,"style":107},"590","pretty (paragraph)",[93,163],{"x":164,"y":123,"width":113,"height":98,"rx":115,"fill":100,"opacity":124},"496",[93,166],{"x":164,"y":127,"width":113,"height":98,"rx":115,"fill":100,"opacity":124},[93,168],{"x":164,"y":130,"width":169,"height":98,"rx":115,"fill":100,"opacity":124},"160",[93,171],{"x":164,"y":133,"width":172,"height":98,"rx":115,"fill":100,"opacity":124},"70",[85,174,175],{"textAnchor":87,"x":160,"y":136,"style":137},"no single-word last line",[52,177,179],{"id":178},"what-each-value-does","What each value does",[181,182,183,193,205,212,220],"ul",{},[184,185,186,192],"li",{},[187,188,189],"strong",{},[14,190,191],{},"text-wrap: wrap"," (default) — greedy wrapping.",[184,194,195,200,201,204],{},[187,196,197],{},[14,198,199],{},"text-wrap: nowrap"," — no wrapping, equivalent to the old ",[14,202,203],{},"white-space: nowrap"," for this purpose.",[184,206,207,211],{},[187,208,209],{},[14,210,16],{}," — chooses breaks so all lines are close to equal length. The browser effectively searches for the narrowest width at which the text still fits in the same number of lines. Limited to short blocks; browsers cap the number of lines they will balance, and beyond that cap the text wraps normally.",[184,213,214,219],{},[187,215,216],{},[14,217,218],{},"text-wrap: pretty"," — uses greedy wrapping for most of the block but considers the last several lines together, adjusting breaks to avoid a very short final line and other typographic blemishes. Designed for body text.",[184,221,222,227],{},[187,223,224],{},[14,225,226],{},"text-wrap: stable"," — keeps earlier lines from rewrapping while text is edited, useful in editable fields.",[23,229,230,232,233,236,237,240],{},[14,231,32],{}," is a shorthand for ",[14,234,235],{},"text-wrap-mode"," (wrap or nowrap) and ",[14,238,239],{},"text-wrap-style"," (auto, balance, pretty, stable). In practice the shorthand is what gets written.",[52,242,244],{"id":243},"the-complete-implementation","The complete implementation",[23,246,247,248,250,251,253],{},"The article below applies ",[14,249,36],{}," to headings, captions and pull quotes, and ",[14,252,20],{}," to paragraphs and list items. Resize the demo to watch the heading keep its lines even at every width.",[255,256],"live-demo",{"name":257},"text-wrap-demo",[259,260,265],"pre",{"className":261,"code":262,"language":263,"meta":264,"style":264},"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>text-wrap balance and pretty\u003C\u002Ftitle>\n\u003Cstyle>\n  body { font: 17px\u002F1.6 Georgia, serif; margin: 1.5rem; }\n  .prose { max-width: 60ch; }\n\n  \u002F* Short, prominent text: balance every line. *\u002F\n  .prose :is(h1, h2, h3, figcaption, blockquote p) {\n    text-wrap: balance;\n  }\n\n  \u002F* Headings with a background should hug their balanced text,\n     otherwise the box stays full width with empty space at line ends. *\u002F\n  .prose .tag-heading {\n    width: fit-content;\n    padding: 0.2em 0.5em;\n    background: #eef2ff;\n  }\n\n  \u002F* Running text: keep normal wrapping, but fix the ending. *\u002F\n  .prose :is(p, li) {\n    text-wrap: pretty;\n  }\n\n  \u002F* Code and preformatted text must never be rewrapped. *\u002F\n  .prose :is(pre, code) {\n    text-wrap: nowrap;\n  }\n\n  h1 { font-size: clamp(1.8rem, 1.2rem + 3vw, 3rem); line-height: 1.1; }\n\u003C\u002Fstyle>\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Carticle class=\"prose\">\n    \u003Ch1>A field guide to the tidal flats of the northern estuary\u003C\u002Fh1>\n    \u003Cp>The flats are exposed twice a day, and in that window they become one of the richest\n       feeding grounds on the coast for waders, gulls and the occasional patient heron.\u003C\u002Fp>\n    \u003Ch2 class=\"tag-heading\">Reading the tide tables before you go\u003C\u002Fh2>\n    \u003Cp>Always check the tables before walking out; the water returns faster than it seems.\u003C\u002Fp>\n  \u003C\u002Farticle>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n","html","",[14,266,267,287,307,317,335,360,374,384,437,458,465,472,510,523,529,534,540,546,557,570,591,604,609,614,620,637,645,650,655,661,678,690,695,700,759,769,778,788,807,822,832,842,863,877,887,896],{"__ignoreMap":264},[268,269,272,276,280,284],"span",{"class":270,"line":271},"line",1,[268,273,275],{"class":274},"suds8","\u003C!",[268,277,279],{"class":278},"sne4z","doctype",[268,281,283],{"class":282},"s-5SL"," html",[268,285,286],{"class":274},">\n",[268,288,290,293,295,298,301,305],{"class":270,"line":289},2,[268,291,292],{"class":274},"\u003C",[268,294,263],{"class":278},[268,296,297],{"class":282}," lang",[268,299,300],{"class":274},"=",[268,302,304],{"class":303},"sT6z2","\"en\"",[268,306,286],{"class":274},[268,308,310,312,315],{"class":270,"line":309},3,[268,311,292],{"class":274},[268,313,314],{"class":278},"head",[268,316,286],{"class":274},[268,318,320,322,325,328,330,333],{"class":270,"line":319},4,[268,321,292],{"class":274},[268,323,324],{"class":278},"meta",[268,326,327],{"class":282}," charset",[268,329,300],{"class":274},[268,331,332],{"class":303},"\"utf-8\"",[268,334,286],{"class":274},[268,336,338,340,342,345,347,350,353,355,358],{"class":270,"line":337},5,[268,339,292],{"class":274},[268,341,324],{"class":278},[268,343,344],{"class":282}," name",[268,346,300],{"class":274},[268,348,349],{"class":303},"\"viewport\"",[268,351,352],{"class":282}," content",[268,354,300],{"class":274},[268,356,357],{"class":303},"\"width=device-width, initial-scale=1\"",[268,359,286],{"class":274},[268,361,363,365,367,370,372],{"class":270,"line":362},6,[268,364,292],{"class":274},[268,366,77],{"class":278},[268,368,369],{"class":274},">text-wrap balance and pretty\u003C\u002F",[268,371,77],{"class":278},[268,373,286],{"class":274},[268,375,377,379,382],{"class":270,"line":376},7,[268,378,292],{"class":274},[268,380,381],{"class":278},"style",[268,383,286],{"class":274},[268,385,387,390,393,396,399,402,406,409,412,415,418,421,424,427,429,431,434],{"class":270,"line":386},8,[268,388,389],{"class":278},"  body",[268,391,392],{"class":274}," { ",[268,394,395],{"class":282},"font",[268,397,398],{"class":274},": ",[268,400,401],{"class":282},"17",[268,403,405],{"class":404},"sHUrx","px",[268,407,408],{"class":274},"\u002F",[268,410,411],{"class":282},"1.6",[268,413,414],{"class":282}," Georgia",[268,416,417],{"class":274},", ",[268,419,420],{"class":282},"serif",[268,422,423],{"class":274},"; ",[268,425,426],{"class":282},"margin",[268,428,398],{"class":274},[268,430,101],{"class":282},[268,432,433],{"class":404},"rem",[268,435,436],{"class":274},"; }\n",[268,438,440,443,445,448,450,453,456],{"class":270,"line":439},9,[268,441,442],{"class":282},"  .prose",[268,444,392],{"class":274},[268,446,447],{"class":282},"max-width",[268,449,398],{"class":274},[268,451,452],{"class":282},"60",[268,454,455],{"class":404},"ch",[268,457,436],{"class":274},[268,459,461],{"class":270,"line":460},10,[268,462,464],{"emptyLinePlaceholder":463},true,"\n",[268,466,468],{"class":270,"line":467},11,[268,469,471],{"class":470},"sLBg1","  \u002F* Short, prominent text: balance every line. *\u002F\n",[268,473,475,477,480,483,485,487,489,491,494,496,499,501,504,507],{"class":270,"line":474},12,[268,476,442],{"class":282},[268,478,479],{"class":282}," :is",[268,481,482],{"class":274},"(",[268,484,10],{"class":278},[268,486,417],{"class":274},[268,488,52],{"class":278},[268,490,417],{"class":274},[268,492,493],{"class":278},"h3",[268,495,417],{"class":274},[268,497,498],{"class":278},"figcaption",[268,500,417],{"class":274},[268,502,503],{"class":278},"blockquote",[268,505,506],{"class":278}," p",[268,508,509],{"class":274},") {\n",[268,511,513,516,518,520],{"class":270,"line":512},13,[268,514,515],{"class":282},"    text-wrap",[268,517,398],{"class":274},[268,519,36],{"class":282},[268,521,522],{"class":274},";\n",[268,524,526],{"class":270,"line":525},14,[268,527,528],{"class":274},"  }\n",[268,530,532],{"class":270,"line":531},15,[268,533,464],{"emptyLinePlaceholder":463},[268,535,537],{"class":270,"line":536},16,[268,538,539],{"class":470},"  \u002F* Headings with a background should hug their balanced text,\n",[268,541,543],{"class":270,"line":542},17,[268,544,545],{"class":470},"     otherwise the box stays full width with empty space at line ends. *\u002F\n",[268,547,549,551,554],{"class":270,"line":548},18,[268,550,442],{"class":282},[268,552,553],{"class":282}," .tag-heading",[268,555,556],{"class":274}," {\n",[268,558,560,563,565,568],{"class":270,"line":559},19,[268,561,562],{"class":282},"    width",[268,564,398],{"class":274},[268,566,567],{"class":282},"fit-content",[268,569,522],{"class":274},[268,571,573,576,578,581,584,587,589],{"class":270,"line":572},20,[268,574,575],{"class":282},"    padding",[268,577,398],{"class":274},[268,579,580],{"class":282},"0.2",[268,582,583],{"class":404},"em",[268,585,586],{"class":282}," 0.5",[268,588,583],{"class":404},[268,590,522],{"class":274},[268,592,594,597,599,602],{"class":270,"line":593},21,[268,595,596],{"class":282},"    background",[268,598,398],{"class":274},[268,600,601],{"class":282},"#eef2ff",[268,603,522],{"class":274},[268,605,607],{"class":270,"line":606},22,[268,608,528],{"class":274},[268,610,612],{"class":270,"line":611},23,[268,613,464],{"emptyLinePlaceholder":463},[268,615,617],{"class":270,"line":616},24,[268,618,619],{"class":470},"  \u002F* Running text: keep normal wrapping, but fix the ending. *\u002F\n",[268,621,623,625,627,629,631,633,635],{"class":270,"line":622},25,[268,624,442],{"class":282},[268,626,479],{"class":282},[268,628,482],{"class":274},[268,630,23],{"class":278},[268,632,417],{"class":274},[268,634,184],{"class":278},[268,636,509],{"class":274},[268,638,640,642],{"class":270,"line":639},26,[268,641,515],{"class":282},[268,643,644],{"class":274},": pretty;\n",[268,646,648],{"class":270,"line":647},27,[268,649,528],{"class":274},[268,651,653],{"class":270,"line":652},28,[268,654,464],{"emptyLinePlaceholder":463},[268,656,658],{"class":270,"line":657},29,[268,659,660],{"class":470},"  \u002F* Code and preformatted text must never be rewrapped. *\u002F\n",[268,662,664,666,668,670,672,674,676],{"class":270,"line":663},30,[268,665,442],{"class":282},[268,667,479],{"class":282},[268,669,482],{"class":274},[268,671,259],{"class":278},[268,673,417],{"class":274},[268,675,14],{"class":278},[268,677,509],{"class":274},[268,679,681,683,685,688],{"class":270,"line":680},31,[268,682,515],{"class":282},[268,684,398],{"class":274},[268,686,687],{"class":282},"nowrap",[268,689,522],{"class":274},[268,691,693],{"class":270,"line":692},32,[268,694,528],{"class":274},[268,696,698],{"class":270,"line":697},33,[268,699,464],{"emptyLinePlaceholder":463},[268,701,703,706,708,711,713,716,718,721,723,725,728,730,734,737,740,742,744,746,749,752,754,757],{"class":270,"line":702},34,[268,704,705],{"class":278},"  h1",[268,707,392],{"class":274},[268,709,710],{"class":282},"font-size",[268,712,398],{"class":274},[268,714,715],{"class":282},"clamp",[268,717,482],{"class":274},[268,719,720],{"class":282},"1.8",[268,722,433],{"class":404},[268,724,417],{"class":274},[268,726,727],{"class":282},"1.2",[268,729,433],{"class":404},[268,731,733],{"class":732},"soyes"," +",[268,735,736],{"class":282}," 3",[268,738,739],{"class":404},"vw",[268,741,417],{"class":274},[268,743,115],{"class":282},[268,745,433],{"class":404},[268,747,748],{"class":274},"); ",[268,750,751],{"class":282},"line-height",[268,753,398],{"class":274},[268,755,756],{"class":282},"1.1",[268,758,436],{"class":274},[268,760,762,765,767],{"class":270,"line":761},35,[268,763,764],{"class":274},"\u003C\u002F",[268,766,381],{"class":278},[268,768,286],{"class":274},[268,770,772,774,776],{"class":270,"line":771},36,[268,773,764],{"class":274},[268,775,314],{"class":278},[268,777,286],{"class":274},[268,779,781,783,786],{"class":270,"line":780},37,[268,782,292],{"class":274},[268,784,785],{"class":278},"body",[268,787,286],{"class":274},[268,789,791,794,797,800,802,805],{"class":270,"line":790},38,[268,792,793],{"class":274},"  \u003C",[268,795,796],{"class":278},"article",[268,798,799],{"class":282}," class",[268,801,300],{"class":274},[268,803,804],{"class":303},"\"prose\"",[268,806,286],{"class":274},[268,808,810,813,815,818,820],{"class":270,"line":809},39,[268,811,812],{"class":274},"    \u003C",[268,814,10],{"class":278},[268,816,817],{"class":274},">A field guide to the tidal flats of the northern estuary\u003C\u002F",[268,819,10],{"class":278},[268,821,286],{"class":274},[268,823,825,827,829],{"class":270,"line":824},40,[268,826,812],{"class":274},[268,828,23],{"class":278},[268,830,831],{"class":274},">The flats are exposed twice a day, and in that window they become one of the richest\n",[268,833,835,838,840],{"class":270,"line":834},41,[268,836,837],{"class":274},"       feeding grounds on the coast for waders, gulls and the occasional patient heron.\u003C\u002F",[268,839,23],{"class":278},[268,841,286],{"class":274},[268,843,845,847,849,851,853,856,859,861],{"class":270,"line":844},42,[268,846,812],{"class":274},[268,848,52],{"class":278},[268,850,799],{"class":282},[268,852,300],{"class":274},[268,854,855],{"class":303},"\"tag-heading\"",[268,857,858],{"class":274},">Reading the tide tables before you go\u003C\u002F",[268,860,52],{"class":278},[268,862,286],{"class":274},[268,864,866,868,870,873,875],{"class":270,"line":865},43,[268,867,812],{"class":274},[268,869,23],{"class":278},[268,871,872],{"class":274},">Always check the tables before walking out; the water returns faster than it seems.\u003C\u002F",[268,874,23],{"class":278},[268,876,286],{"class":274},[268,878,880,883,885],{"class":270,"line":879},44,[268,881,882],{"class":274},"  \u003C\u002F",[268,884,796],{"class":278},[268,886,286],{"class":274},[268,888,890,892,894],{"class":270,"line":889},45,[268,891,764],{"class":274},[268,893,785],{"class":278},[268,895,286],{"class":274},[268,897,899,901,903],{"class":270,"line":898},46,[268,900,764],{"class":274},[268,902,263],{"class":278},[268,904,286],{"class":274},[23,906,907,908,911,912,915],{},"The ",[14,909,910],{},".tag-heading"," rule shows the one interaction people miss: balancing shortens the lines but not the element. A heading with a background colour would otherwise show a full-width box with empty space at the end of each short line. ",[14,913,914],{},"width: fit-content"," shrinks the box to its longest line, which after balancing is the natural width of the text.",[52,917,919],{"id":918},"the-key-technique-balance-for-short-text-pretty-for-long","The key technique: balance for short text, pretty for long",[23,921,922],{},"The two values solve different problems, and swapping them does not work well.",[68,924,75,927,75,930,75,933,75,936,75,940,75,944,75,948,75,952,75,956,75,960,75,964,75,966,75,968,75,971,75,974,75,977,75,980,75,983,75,986,75,989,75,992,75,995,75,998,75,1001],{"viewBox":925,"role":71,"ariaLabel":926,"xmlns":73,"style":74},"0 0 720 280","Guide mapping content types to balance, pretty or default wrapping, based on length and prominence",[77,928,929],{},"Which value for which content",[81,931,932],{},"Headings, captions, pull quotes and card titles use balance. Paragraphs, list items and descriptions use pretty. Code, tables, logs and rapidly updating text keep the default or nowrap.",[85,934,935],{"textAnchor":87,"x":88,"y":89,"style":90},"Match the algorithm to the text",[93,937],{"x":95,"y":96,"width":97,"height":938,"rx":98,"fill":116,"opacity":939},"190","0.34",[85,941,36],{"textAnchor":87,"x":105,"y":942,"style":943},"78","text-anchor:middle;fill:currentColor;font:700 13px ui-monospace,monospace",[85,945,947],{"textAnchor":87,"x":105,"y":119,"style":946},"text-anchor:middle;fill:currentColor;font:12px sans-serif","headings",[85,949,951],{"textAnchor":87,"x":105,"y":950,"style":946},"132","captions",[85,953,955],{"textAnchor":87,"x":105,"y":954,"style":946},"154","pull quotes",[85,957,959],{"textAnchor":87,"x":105,"y":958,"style":946},"176","card titles",[85,961,963],{"textAnchor":87,"x":105,"y":962,"style":137},"214","short and prominent",[93,965],{"x":141,"y":96,"width":97,"height":938,"rx":98,"fill":116,"opacity":580},[85,967,20],{"textAnchor":87,"x":88,"y":942,"style":943},[85,969,970],{"textAnchor":87,"x":88,"y":119,"style":946},"paragraphs",[85,972,973],{"textAnchor":87,"x":88,"y":950,"style":946},"list items",[85,975,976],{"textAnchor":87,"x":88,"y":954,"style":946},"descriptions",[85,978,979],{"textAnchor":87,"x":88,"y":958,"style":946},"long captions",[85,981,982],{"textAnchor":87,"x":88,"y":962,"style":137},"running text",[93,984],{"x":157,"y":96,"width":97,"height":938,"rx":98,"fill":99,"stroke":100,"strokeWidth":101,"opacity":985},"0.6",[85,987,988],{"textAnchor":87,"x":160,"y":942,"style":943},"default \u002F nowrap",[85,990,991],{"textAnchor":87,"x":160,"y":119,"style":946},"code blocks",[85,993,994],{"textAnchor":87,"x":160,"y":950,"style":946},"tables",[85,996,997],{"textAnchor":87,"x":160,"y":954,"style":946},"live logs",[85,999,1000],{"textAnchor":87,"x":160,"y":958,"style":946},"editable text",[85,1002,1003],{"textAnchor":87,"x":160,"y":962,"style":137},"precision or churn",[23,1005,1006,1007,1009],{},"Balancing a paragraph would, if browsers allowed it, shorten every line to match the shortest arrangement — wasting horizontal space and making body text less efficient to read. That is why browsers cap it to a few lines. Applying ",[14,1008,20],{}," to a two-line heading, conversely, changes little, because a heading's problem is its first line being too long relative to the second, not a stray last word.",[52,1011,1013],{"id":1012},"interactions-with-fluid-type-and-animation","Interactions with fluid type and animation",[23,1015,1016,1017,1021],{},"Both values are recomputed whenever the text reflows, so they cooperate naturally with ",[41,1018,1020],{"href":1019},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript\u002F","fluid typography"," and container-driven layout: every size and width gets balanced lines. Two interactions deserve care.",[23,1023,1024,1025,1027,1028,1031],{},"First, animating font size or container width on text with ",[14,1026,36],{}," rebalances on every frame, which is both expensive and visually busy — lines jump between arrangements as the animation runs. Animate a ",[14,1029,1030],{},"transform: scale()"," instead when a heading must grow, so the text reflows once, or disable balancing during the animation.",[23,1033,1034,1035,1038,1039,1041,1042,1044,1045,1049],{},"Second, balanced text is narrower than its box, which affects anything aligned to the text's edge. Underlines drawn with borders on the heading element span the full box width; underlines drawn with ",[14,1036,1037],{},"text-decoration"," follow the text. For headings with decorative lines, prefer ",[14,1040,1037],{}," or apply ",[14,1043,914],{},". The motion side of heading reveals — clipping a balanced heading into view — is covered in ",[41,1046,1048],{"href":1047},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations\u002Fclip-path-reveal-animations\u002F","Clip-Path Reveal Animations",".",[52,1051,1053],{"id":1052},"rolling-it-out-across-a-site","Rolling it out across a site",[23,1055,1056],{},"Because both values only improve line breaks and never change content, they can be introduced site-wide with low risk, but a few checks make the rollout smooth.",[23,1058,1059,1062,1063,17,1066,1069],{},[187,1060,1061],{},"Apply by element role, not by class."," A base rule such as ",[14,1064,1065],{},"h1, h2, h3, figcaption { text-wrap: balance; }",[14,1067,1068],{},"p, li, dd { text-wrap: pretty; }"," covers most content without touching component markup. Component styles can then opt out where needed.",[23,1071,1072,1075,1076,1078],{},[187,1073,1074],{},"Audit headings with trailing icons or badges."," A heading containing an inline \"New\" badge or an external-link icon is balanced together with that content, which occasionally moves the badge onto its own line. Wrapping the last word and the badge in a ",[14,1077,203],{}," span keeps them together.",[23,1080,1081,1084,1085,1087],{},[187,1082,1083],{},"Check narrow containers."," Balance never produces more lines than greedy wrapping would; it only redistributes them. But in very narrow containers, such as table headers or sidebar cards, balanced headings can look oddly narrow. Opting those contexts out with ",[14,1086,191],{}," is a legitimate choice.",[23,1089,1090,1093],{},[187,1091,1092],{},"Compare screenshots before and after."," Visual regression tests will show many small line-break changes on the first run. Review a sample to confirm they are improvements, then approve them in bulk; subsequent runs will be stable.",[23,1095,1096,1099,1100,1103],{},[187,1097,1098],{},"Mind translated content."," Languages with long compound words or no spaces between words wrap differently, and balancing can behave unexpectedly with very long unbreakable words. Test headings in the site's longest-word language, and make sure ",[14,1101,1102],{},"overflow-wrap: anywhere"," or hyphenation is available where words may exceed the column.",[52,1105,1107],{"id":1106},"accessibility-notes","Accessibility notes",[23,1109,1110,1111,1113,1114,1116],{},"Neither value changes the text itself; screen readers read it exactly as before, and copy-and-paste yields the same characters. Better breaks are an accessibility improvement for readers with dyslexia or low vision, who benefit from lines of more even length and fewer isolated words. Unlike manual ",[14,1112,28],{}," tags, ",[14,1115,32],{}," never injects line breaks that screen readers might announce as pauses, and it adapts correctly when users zoom or increase text spacing under WCAG 1.4.12.",[52,1118,1120],{"id":1119},"browser-support","Browser support",[23,1122,1123,1125,1126,1128,1129,1131],{},[14,1124,16],{}," is supported in Chrome and Edge 114+, Firefox 121+ and Safari 17.5+. ",[14,1127,218],{}," is supported in current Chromium browsers and Safari; in engines without it, the value is ignored and text wraps normally, so it is safe to apply unconditionally. ",[14,1130,567],{}," sizing is supported in Chrome and Edge 46+ and 79+, Firefox 94+ and Safari 11+.",[52,1133,1135],{"id":1134},"faq","FAQ",[23,1137,1138,1146,1148,1149,1151],{},[187,1139,1140,1141,17,1143,1145],{},"What is the difference between ",[14,1142,16],{},[14,1144,20],{},"?",[14,1147,36],{}," tries to make all lines of a block roughly equal in length, which suits short headings and captions. ",[14,1150,20],{}," keeps normal greedy wrapping for most of the text but adjusts the last few lines to avoid a very short final line, which suits body paragraphs.",[23,1153,1154,1160,1161,1163],{},[187,1155,1156,1157,1159],{},"Why does ",[14,1158,16],{}," not work on my paragraph?","\nBrowsers limit balancing to short blocks, a handful of lines, because the algorithm is expensive and balancing long paragraphs makes little visual difference. Beyond the limit the text wraps normally. Use ",[14,1162,20],{}," for paragraphs instead.",[23,1165,1166,1172,1173,1175,1176,1049],{},[187,1167,1168,1169,1171],{},"Does ",[14,1170,16],{}," change the width of the element?","\nNo. The element keeps its width; the text inside is wrapped with shorter lines so they are more even, which leaves space at the end of each line. If the heading's background or border should shrink to the text, combine ",[14,1174,36],{}," with ",[14,1177,914],{},[23,1179,1180,1186],{},[187,1181,1182,1183,1185],{},"Is ",[14,1184,218],{}," expensive?","\nIt does more work than normal wrapping, but browsers limit it to the end of paragraphs. On typical article pages the cost is negligible. Avoid applying it to very large amounts of frequently changing text, such as live-updating logs.",[52,1188,1190],{"id":1189},"related","Related",[181,1192,1193,1198,1205,1212],{},[184,1194,1195,1197],{},[41,1196,44],{"href":43}," — the parent guide.",[184,1199,1200,1204],{},[41,1201,1203],{"href":1202},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-line-height-and-measure\u002F","Fluid Line Height and Measure"," — the other half of readable line layout.",[184,1206,1207,1211],{},[41,1208,1210],{"href":1209},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained\u002F","min-content, max-content and fit-content"," — shrinking boxes to balanced text.",[184,1213,1214,1218],{},[41,1215,1217],{"href":1216},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps\u002F","Optimizing CSS Animations for 60fps"," — why reflowing text should not be animated.",[381,1220,1221],{},"html pre.shiki code .suds8, html code.shiki .suds8{--shiki-default:#0E1116;--shiki-dark:#F0F3F6}html pre.shiki code .sne4z, html code.shiki .sne4z{--shiki-default:#024C1A;--shiki-dark:#72F088}html pre.shiki code .s-5SL, html code.shiki .s-5SL{--shiki-default:#023B95;--shiki-dark:#91CBFF}html pre.shiki code .sT6z2, html code.shiki .sT6z2{--shiki-default:#032563;--shiki-dark:#ADDCFF}html pre.shiki code .sHUrx, html code.shiki .sHUrx{--shiki-default:#A0111F;--shiki-dark:#FF9492}html pre.shiki code .sLBg1, html code.shiki .sLBg1{--shiki-default:#66707B;--shiki-dark:#BDC4CC}html pre.shiki code .soyes, html code.shiki .soyes{--shiki-default:#702C00;--shiki-dark:#FFB757}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":264,"searchDepth":289,"depth":289,"links":1223},[1224,1225,1226,1227,1228,1229,1230,1231,1232,1233],{"id":54,"depth":289,"text":55},{"id":178,"depth":289,"text":179},{"id":243,"depth":289,"text":244},{"id":918,"depth":289,"text":919},{"id":1012,"depth":289,"text":1013},{"id":1052,"depth":289,"text":1053},{"id":1106,"depth":289,"text":1107},{"id":1119,"depth":289,"text":1120},{"id":1134,"depth":289,"text":1135},{"id":1189,"depth":289,"text":1190},"Fix ragged headings and single-word last lines with text-wrap: balance and pretty: what each algorithm does, its line limits and cost, and where not to use it.","md",{"pageTitle":1237,"datePublished":1238,"dateModified":1238,"faq":1239},"text-wrap: balance and pretty Explained","2026-09-18",[1240,1243,1246,1249],{"q":1241,"a":1242},"What is the difference between text-wrap: balance and pretty?","balance tries to make all lines of a block roughly equal in length, which suits short headings and captions. pretty keeps normal greedy wrapping for most of the text but adjusts the last few lines to avoid a very short final line, which suits body paragraphs.",{"q":1244,"a":1245},"Why does text-wrap: balance not work on my paragraph?","Browsers limit balancing to short blocks, a handful of lines, because the algorithm is expensive and balancing long paragraphs makes little visual difference. Beyond the limit the text wraps normally. Use pretty for paragraphs instead.",{"q":1247,"a":1248},"Does text-wrap: balance change the width of the element?","No. The element keeps its width; the text inside is wrapped with shorter lines so they are more even, which leaves space at the end of each line. If the heading's background or border should shrink to the text, combine balance with width: fit-content.",{"q":1250,"a":1251},"Is text-wrap: pretty expensive?","It does more work than normal wrapping, but browsers limit it to the end of paragraphs. On typical article pages the cost is negligible. Avoid applying it to very large amounts of frequently changing text, such as live-updating logs.","\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ftext-wrap-balance-and-pretty",{"title":5,"description":1234},"mastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ftext-wrap-balance-and-pretty\u002Findex","W_UKR2tmqYM7hc9XOO97E0oIP4VO1xRiOh-tUR2iP5A",[1257,1260,1263,1266,1269,1272,1275,1278,1281,1284,1287,1290,1293,1296,1299,1302,1305,1308,1311,1314,1317,1320,1323,1326,1329,1332,1335,1338,1341,1344,1347,1350,1353,1356,1359,1362,1365,1368,1371,1374,1377,1380,1383,1386,1389,1392,1395,1398,1401,1404,1407,1410,1413,1416,1419,1422,1425,1428,1431,1434,1437,1440,1443,1446,1449,1452,1455,1458,1461,1464,1467,1470,1473,1476,1479,1482,1485,1488,1491,1494,1497,1500,1503,1506,1509,1512,1515,1518,1521,1524,1527,1530,1533,1536,1538,1541,1544,1547,1550,1553,1556,1559,1562,1565,1568,1571,1574,1577,1580,1583,1586,1589,1592,1595,1598,1601,1604,1607,1610,1613,1616,1619,1622,1625,1628,1631,1634,1637,1640,1643,1646,1649,1652,1655,1658,1661,1664,1667,1670,1673,1674,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],{"path":1258,"title":1259},"\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":1261,"title":1262},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":1264,"title":1265},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":1267,"title":1268},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":1270,"title":1271},"\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":1273,"title":1274},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":1276,"title":1277},"\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":1279,"title":1280},"\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":1282,"title":1283},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":1285,"title":1286},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":1288,"title":1289},"\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":1291,"title":1292},"\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":1294,"title":1295},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":1297,"title":1298},"\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":1300,"title":1301},"\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":1303,"title":1304},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":1306,"title":1307},"\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":1309,"title":1310},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":1312,"title":1313},"\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":1315,"title":1316},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":1318,"title":1319},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":1321,"title":1322},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":1324,"title":1325},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":1327,"title":1328},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":1330,"title":1331},"\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":1333,"title":1334},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":1336,"title":1337},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":1339,"title":1340},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":1342,"title":1343},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":1345,"title":1346},"\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":1348,"title":1349},"\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":1351,"title":1352},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":1354,"title":1355},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":1357,"title":1358},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":1360,"title":1361},"\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":1363,"title":1364},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":1366,"title":1367},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":1369,"title":1370},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":1372,"title":1373},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":1375,"title":1376},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":1378,"title":1379},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":1381,"title":1382},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":1384,"title":1385},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":1387,"title":1388},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":1390,"title":1391},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"path":1393,"title":1394},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":1396,"title":1397},"\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":1399,"title":1400},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":1402,"title":1403},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":1405,"title":1406},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":1408,"title":1409},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":1411,"title":1412},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":1414,"title":1415},"\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":1417,"title":1418},"\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":1420,"title":1421},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":1423,"title":1424},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states","Button Press and  States",{"path":1426,"title":1427},"\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":1429,"title":1430},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":1432,"title":1433},"\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":1435,"title":1436},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":1438,"title":1439},"\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":1441,"title":1442},"\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":1444,"title":1445},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":1447,"title":1448},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking","Stacking Animations With animation-composition",{"path":1450,"title":1451},"\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":1453,"title":1454},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":1456,"title":1457},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":1459,"title":1460},"\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":1462,"title":1463},"\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":1465,"title":1466},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":1468,"title":1469},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":1471,"title":1472},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":1474,"title":1475},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply","Animating box-shadow and Filters Cheaply",{"path":1477,"title":1478},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":1480,"title":1481},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite","Layout, Paint and Composite: What Triggers What",{"path":1483,"title":1484},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":1486,"title":1487},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":1489,"title":1490},"\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":1492,"title":1493},"\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":1495,"title":1496},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":1498,"title":1499},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":1501,"title":1502},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects","Scroll-Driven Parallax Effects in CSS",{"path":1504,"title":1505},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":1507,"title":1508},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":1510,"title":1511},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":1513,"title":1514},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range","View Timelines and animation-range",{"path":1516,"title":1517},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":1519,"title":1520},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":1522,"title":1523},"\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":1525,"title":1526},"\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":1528,"title":1529},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":1531,"title":1532},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":1534,"title":1535},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":408,"title":1537},"Modern CSS Layouts & Micro-Interactions",{"path":1539,"title":1540},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":1542,"title":1543},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":1545,"title":1546},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":1548,"title":1549},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":1551,"title":1552},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":1554,"title":1555},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":1557,"title":1558},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":1560,"title":1561},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":1563,"title":1564},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":1566,"title":1567},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":1569,"title":1570},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":1572,"title":1573},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":1575,"title":1576},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":1578,"title":1579},"\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":1581,"title":1582},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":1584,"title":1585},"\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":1587,"title":1588},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":1590,"title":1591},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":1593,"title":1594},"\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":1596,"title":1597},"\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":1599,"title":1600},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics","Container Query Syntax Basics",{"path":1602,"title":1603},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":1605,"title":1606},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":1608,"title":1609},"\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":1611,"title":1612},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":1614,"title":1615},"\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":1617,"title":1618},"\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":1620,"title":1621},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":1623,"title":1624},"\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":1626,"title":1627},"\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":1629,"title":1630},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":1632,"title":1633},"\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":1635,"title":1636},"\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":1638,"title":1639},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":1641,"title":1642},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":1644,"title":1645},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":1647,"title":1648},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":1650,"title":1651},"\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":1653,"title":1654},"\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":1656,"title":1657},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":1659,"title":1660},"\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":1662,"title":1663},"\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":1665,"title":1666},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":1668,"title":1669},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":1671,"title":1672},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":1252,"title":5},{"path":1675,"title":49},"\u002Fmastering-container-queries-responsive-layouts",{"path":1677,"title":1678},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":1680,"title":1681},"\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":1683,"title":1684},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":1686,"title":1687},"\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":1689,"title":1690},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":1692,"title":1693},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":1695,"title":1696},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":1698,"title":1699},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":1701,"title":1702},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":1704,"title":1705},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":1707,"title":1708},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":1710,"title":1711},"\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":1713,"title":1714},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset","Writing a Minimal Modern CSS Reset: Every Line Justified",{"path":1716,"title":1717},"\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":1719,"title":1720},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has","Empty and Loading States With ()",{"path":1722,"title":1723},"\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":1725,"title":1726},"\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":1728,"title":1729},"\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":1731,"title":1732},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"path":1734,"title":1735},"\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":1737,"title":1738},"\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":1740,"title":1741},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":1743,"title":1744},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":1746,"title":1747},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":1749,"title":1750},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":1752,"title":1753},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":1755,"title":1756},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":1758,"title":1759},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":1761,"title":1762},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions","Tabs That Become an Accordion: One Component, Two Layouts",{"path":1764,"title":1765},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":1767,"title":1768},"\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":1770,"title":1771},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":1773,"title":1774},"\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":1776,"title":1777},"\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":1779,"title":1780},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":1782,"title":1783},"\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":1785,"title":1786},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":1788,"title":1789},"\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":1791,"title":1792},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":1794,"title":1795},"\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":1797,"title":1798},"\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":1800,"title":1801},"\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":1803,"title":1804},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":1806,"title":1807},"\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":1809,"title":1810},"\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":1812,"title":1813},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":1815,"caption":1816,"height":1817,"resizable":463,"html":1818,"css":1819},"Balanced headings and pretty paragraphs","Drag the frame narrower and wider: the headings keep evenly split lines, and the paragraph avoids ending on a single word.",380,"\n\u003Carticle class=\"prose\">\n  \u003Ch1>A field guide to the tidal flats of the northern estuary\u003C\u002Fh1>\n  \u003Cp>The flats are exposed twice a day, and in that window they become one of the richest feeding grounds on the coast for waders, gulls and the occasional patient heron.\u003C\u002Fp>\n  \u003Ch2 class=\"tag-heading\">Reading the tide tables before you go\u003C\u002Fh2>\n  \u003Cp>Always check the tables before walking out; the water returns faster than it seems.\u003C\u002Fp>\n\u003C\u002Farticle>","\nbody { display: block; font: 17px\u002F1.6 Georgia, serif; }\n.prose { max-width: 60ch; }\n.prose :is(h1, h2, h3, figcaption, blockquote p) { text-wrap: balance; }\n.prose .tag-heading { width: fit-content; padding: 0.2em 0.5em; background: var(--demo-surface); border: 1px solid var(--demo-border); }\n.prose :is(p, li) { text-wrap: pretty; }\n.prose :is(pre, code) { text-wrap: nowrap; }\nh1 { font-size: clamp(1.6rem, 1.1rem + 3vw, 2.6rem); line-height: 1.1; margin: 0 0 0.5em; }\nh2 { font-size: 1.3rem; }",1789717748460]