[{"data":1,"prerenderedAt":3003},["ShallowReactive",2],{"page-\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fcontent-aware-card-layouts-with-has":3,"content-all-pages":2439,"live-demo:has-content-aware-cards":2997},{"id":4,"title":5,"body":6,"description":2418,"extension":2419,"meta":2420,"navigation":427,"path":2435,"seo":2436,"stem":2437,"__hash__":2438},"content\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fcontent-aware-card-layouts-with-has\u002Findex.md","Content-Aware Card Layouts With :has(): One Component, Many Shapes",{"type":7,"value":8,"toc":2407},"minimark",[9,19,52,57,71,80,94,98,230,237,241,245,1863,1873,1880,1884,1959,1977,1981,1988,2005,2008,2018,2037,2041,2057,2250,2266,2270,2282,2286,2306,2330,2351,2360,2364,2404],[10,11,13,14,18],"h1",{"id":12},"content-aware-card-layouts-with-has-one-component-many-shapes","Content-Aware Card Layouts With ",[15,16,17],"code",{},":has()",": One Component, Many Shapes",[20,21,22,23,26,27,26,30,26,33,26,36,39,40,46,47,51],"p",{},"A design system's card component starts simple and accretes modifiers: ",[15,24,25],{},"card--with-image",", ",[15,28,29],{},"card--no-image",[15,31,32],{},"card--with-badge",[15,34,35],{},"card--has-actions",[15,37,38],{},"card--long-title",". Each one exists because the layout genuinely needs to differ, and each one is a fact the CMS template must remember to pass. When an editor removes the image but the class stays, the card reserves a blank media slot. This page shows how to replace content-describing modifiers with ",[41,42,44],"a",{"href":43},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002F",[15,45,17],{},", so the card reads its own contents and lays itself out correctly every time. It is part of the ",[41,48,50],{"href":49},"\u002Fmastering-container-queries-responsive-layouts\u002F","Mastering Container Queries & Responsive Layouts"," guide.",[53,54,56],"h2",{"id":55},"why-the-card-should-look-at-itself","Why the card should look at itself",[20,58,59,60,62,63,66,67,70],{},"A modifier class is a second copy of information that already exists in the markup. ",[15,61,25],{}," says \"there is an image in here\", and so does the ",[15,64,65],{},"\u003Cimg>"," element. Two copies can disagree, and in real content pipelines they do: previews render without the image, A\u002FB tests strip badges, translations lengthen titles past the point a ",[15,68,69],{},"--long-title"," class was assigned.",[20,72,73,75,76,79],{},[15,74,17],{}," lets the card consult the only authoritative copy. ",[15,77,78],{},".card:has(> .card__media)"," is true exactly when the media element is present, no more and no less. The template's job shrinks to emitting the content; the stylesheet decides the layout from what arrived.",[20,81,82,83,87,88,90,91,93],{},"There is a boundary to respect. Some variants are ",[84,85,86],"em",{},"editorial decisions"," that leave no trace in the content — \"this card is featured\", \"this card uses the dark theme\". Those still need a class or a data attribute, because there is nothing in the children for ",[15,89,17],{}," to detect. The rule of thumb: if you could determine the variant by looking at the card's children, use ",[15,92,17],{},"; if you could not, keep the class.",[53,95,97],{"id":96},"the-shapes-one-card-can-take","The shapes one card can take",[99,100,106,107,106,111,106,115,106,123,106,135,106,144,106,150,106,155,106,158,106,166,106,171,106,175,106,179,106,182,106,185,106,188,106,196,106,202,106,205,106,208,106,211,106,214,106,217,106,220,106,223,106,227],"svg",{"viewBox":101,"role":102,"ariaLabel":103,"xmlns":104,"style":105},"0 0 720 330","img","Four card shapes derived from content: text only, with media, with media and badge, and with a footer of actions","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[108,109,110],"title",{},"Card layouts chosen by content",[112,113,114],"desc",{},"Four cards. A text-only card has a single padded body. A card with media gains a media row on top. A card with a badge overlays the badge on the media. A card with actions gains a footer row pinned to the bottom.",[116,117,122],"text",{"textAnchor":118,"x":119,"y":120,"style":121},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","Same class, four layouts",[124,125],"rect",{"x":126,"y":127,"width":128,"height":129,"rx":130,"fill":131,"stroke":132,"strokeWidth":133,"opacity":134},"20","50","155","220","10","none","currentColor","1.5","0.55",[124,136],{"x":137,"y":138,"width":139,"height":140,"rx":141,"fill":142,"opacity":143},"32","62","131","60","4","#7aa2ff","0.14",[116,145,149],{"textAnchor":118,"x":146,"y":147,"style":148},"97","96","text-anchor:middle;fill:currentColor;font:12px sans-serif","body only",[116,151,154],{"textAnchor":118,"x":146,"y":152,"style":153},"296","text-anchor:middle;fill:currentColor;font:12px ui-monospace,monospace","no media",[124,156],{"x":157,"y":127,"width":128,"height":129,"rx":130,"fill":131,"stroke":132,"strokeWidth":133,"opacity":134},"195",[124,159],{"x":160,"y":161,"width":162,"height":163,"rx":164,"fill":142,"opacity":165},"203","58","139","84","6","0.4",[116,167,170],{"textAnchor":118,"x":168,"y":169,"style":148},"272","104","media",[124,172],{"x":173,"y":174,"width":139,"height":140,"rx":141,"fill":142,"opacity":143},"207","152",[116,176,178],{"textAnchor":118,"x":168,"y":177,"style":148},"186","body",[116,180,181],{"textAnchor":118,"x":168,"y":152,"style":153},":has(> media)",[124,183],{"x":184,"y":127,"width":128,"height":129,"rx":130,"fill":131,"stroke":132,"strokeWidth":133,"opacity":134},"370",[124,186],{"x":187,"y":161,"width":162,"height":163,"rx":164,"fill":142,"opacity":165},"378",[124,189],{"x":190,"y":191,"width":192,"height":193,"rx":194,"fill":132,"opacity":195},"386","66","56","22","11","0.25",[116,197,201],{"textAnchor":118,"x":198,"y":199,"style":200},"414","81","text-anchor:middle;fill:currentColor;font:11px sans-serif","badge",[124,203],{"x":204,"y":174,"width":139,"height":140,"rx":141,"fill":142,"opacity":143},"382",[116,206,178],{"textAnchor":118,"x":207,"y":177,"style":148},"447",[116,209,210],{"textAnchor":118,"x":207,"y":152,"style":153},":has(> badge)",[124,212],{"x":213,"y":127,"width":128,"height":129,"rx":130,"fill":131,"stroke":132,"strokeWidth":133,"opacity":134},"545",[124,215],{"x":216,"y":138,"width":139,"height":140,"rx":141,"fill":142,"opacity":143},"557",[116,218,178],{"textAnchor":118,"x":219,"y":147,"style":148},"622",[124,221],{"x":216,"y":129,"width":139,"height":222,"rx":141,"fill":142,"opacity":165},"38",[116,224,226],{"textAnchor":118,"x":219,"y":225,"style":148},"244","actions",[116,228,229],{"textAnchor":118,"x":219,"y":152,"style":153},":has(> footer)",[20,231,232,233,236],{},"Each shape comes from one question the card asks about its direct children. The questions are independent, so the variants compose: a card with media, a badge and actions gets all three adjustments without a combined modifier like ",[15,234,235],{},"card--image-badge-actions",".",[53,238,240],{"id":239},"the-complete-implementation","The complete implementation",[242,243],"live-demo",{"name":244},"has-content-aware-cards",[246,247,252],"pre",{"className":248,"code":249,"language":250,"meta":251,"style":251},"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>Content-aware cards\u003C\u002Ftitle>\n\u003Cstyle>\n  body { font: 15px\u002F1.5 system-ui, sans-serif; margin: 1.5rem; }\n\n  .cards {\n    display: grid;\n    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));\n    gap: 1rem;\n  }\n\n  .card {\n    position: relative;          \u002F* anchor for the badge *\u002F\n    display: grid;\n    \u002F* Default: a single body row. *\u002F\n    grid-template-rows: 1fr;\n    border: 1px solid #cbd5e1;\n    border-radius: 12px;\n    overflow: hidden;\n  }\n\n  .card__media {\n    aspect-ratio: 16 \u002F 9;        \u002F* space is reserved before the image loads *\u002F\n    background: linear-gradient(135deg, #bfdbfe, #818cf8);\n  }\n\n  .card__body { padding: 1rem; }\n  .card__title { margin: 0 0 0.25rem; font-size: 1.05rem; }\n  .card__text  { margin: 0; color: #475569; }\n\n  \u002F* Has media: add a media row above the body. *\u002F\n  .card:has(> .card__media) {\n    grid-template-rows: auto 1fr;\n  }\n\n  \u002F* No media: give the body a coloured top rule so the card\n     still has a visual anchor instead of looking unfinished. *\u002F\n  .card:not(:has(> .card__media)) {\n    border-top: 4px solid #6366f1;\n  }\n\n  \u002F* Has a badge: overlay it on the media if media exists... *\u002F\n  .card__badge {\n    justify-self: start;\n    margin: 1rem 1rem 0;\n    padding: 0.15rem 0.6rem;\n    border-radius: 999px;\n    background: #1e293b;\n    color: #f8fafc;\n    font-size: 0.75rem;\n  }\n\n  .card:has(> .card__media) > .card__badge {\n    position: absolute;\n    inset: 0.75rem auto auto 0.75rem;\n    margin: 0;\n  }\n\n  \u002F* Has a footer: pin it to the bottom with its own row. *\u002F\n  .card:has(> .card__actions) {\n    grid-template-rows: 1fr auto;\n  }\n  .card:has(> .card__media):has(> .card__actions) {\n    grid-template-rows: auto 1fr auto;\n  }\n  .card__actions {\n    display: flex;\n    gap: 0.5rem;\n    padding: 0.75rem 1rem;\n    border-top: 1px solid #e2e8f0;\n  }\n\n  \u002F* A selector cannot measure text length, so a long title is the one\n     variant that still needs a flag from the template. *\u002F\n  .card:has(.card__title[data-long]) .card__title { font-size: 0.95rem; }\n\u003C\u002Fstyle>\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Cdiv class=\"cards\">\n    \u003Carticle class=\"card\">\n      \u003Cdiv class=\"card__body\">\u003Ch3 class=\"card__title\">Text only\u003C\u002Fh3>\n        \u003Cp class=\"card__text\">No media, so a coloured top rule appears.\u003C\u002Fp>\u003C\u002Fdiv>\n    \u003C\u002Farticle>\n    \u003Carticle class=\"card\">\n      \u003Cdiv class=\"card__media\" role=\"img\" aria-label=\"Abstract gradient\">\u003C\u002Fdiv>\n      \u003Cdiv class=\"card__body\">\u003Ch3 class=\"card__title\">With media\u003C\u002Fh3>\n        \u003Cp class=\"card__text\">A media row is added above.\u003C\u002Fp>\u003C\u002Fdiv>\n    \u003C\u002Farticle>\n    \u003Carticle class=\"card\">\n      \u003Cdiv class=\"card__media\" role=\"img\" aria-label=\"Abstract gradient\">\u003C\u002Fdiv>\n      \u003Cspan class=\"card__badge\">New\u003C\u002Fspan>\n      \u003Cdiv class=\"card__body\">\u003Ch3 class=\"card__title\">Media and badge\u003C\u002Fh3>\n        \u003Cp class=\"card__text\">The badge floats over the media.\u003C\u002Fp>\u003C\u002Fdiv>\n    \u003C\u002Farticle>\n    \u003Carticle class=\"card\">\n      \u003Cdiv class=\"card__body\">\u003Ch3 class=\"card__title\">With actions\u003C\u002Fh3>\n        \u003Cp class=\"card__text\">A footer row is pinned to the bottom.\u003C\u002Fp>\u003C\u002Fdiv>\n      \u003Cdiv class=\"card__actions\">\u003Ca href=\"#\">Read\u003C\u002Fa>\u003Ca href=\"#\">Save\u003C\u002Fa>\u003C\u002Fdiv>\n    \u003C\u002Farticle>\n  \u003C\u002Fdiv>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n","html","",[15,253,254,274,294,304,322,347,361,371,422,429,438,452,492,506,512,517,525,543,554,560,574,594,609,622,627,632,640,663,695,700,705,724,761,788,793,799,816,833,838,843,849,855,875,894,899,904,910,918,931,951,971,985,997,1010,1025,1030,1035,1056,1068,1092,1103,1108,1113,1119,1133,1148,1153,1177,1194,1199,1207,1219,1233,1250,1268,1273,1278,1284,1290,1324,1334,1343,1352,1371,1389,1424,1451,1461,1476,1512,1542,1566,1575,1590,1621,1642,1672,1696,1705,1720,1750,1774,1826,1835,1845,1854],{"__ignoreMap":251},[255,256,259,263,267,271],"span",{"class":257,"line":258},"line",1,[255,260,262],{"class":261},"suds8","\u003C!",[255,264,266],{"class":265},"sne4z","doctype",[255,268,270],{"class":269},"s-5SL"," html",[255,272,273],{"class":261},">\n",[255,275,277,280,282,285,288,292],{"class":257,"line":276},2,[255,278,279],{"class":261},"\u003C",[255,281,250],{"class":265},[255,283,284],{"class":269}," lang",[255,286,287],{"class":261},"=",[255,289,291],{"class":290},"sT6z2","\"en\"",[255,293,273],{"class":261},[255,295,297,299,302],{"class":257,"line":296},3,[255,298,279],{"class":261},[255,300,301],{"class":265},"head",[255,303,273],{"class":261},[255,305,307,309,312,315,317,320],{"class":257,"line":306},4,[255,308,279],{"class":261},[255,310,311],{"class":265},"meta",[255,313,314],{"class":269}," charset",[255,316,287],{"class":261},[255,318,319],{"class":290},"\"utf-8\"",[255,321,273],{"class":261},[255,323,325,327,329,332,334,337,340,342,345],{"class":257,"line":324},5,[255,326,279],{"class":261},[255,328,311],{"class":265},[255,330,331],{"class":269}," name",[255,333,287],{"class":261},[255,335,336],{"class":290},"\"viewport\"",[255,338,339],{"class":269}," content",[255,341,287],{"class":261},[255,343,344],{"class":290},"\"width=device-width, initial-scale=1\"",[255,346,273],{"class":261},[255,348,350,352,354,357,359],{"class":257,"line":349},6,[255,351,279],{"class":261},[255,353,108],{"class":265},[255,355,356],{"class":261},">Content-aware cards\u003C\u002F",[255,358,108],{"class":265},[255,360,273],{"class":261},[255,362,364,366,369],{"class":257,"line":363},7,[255,365,279],{"class":261},[255,367,368],{"class":265},"style",[255,370,273],{"class":261},[255,372,374,377,380,383,386,389,393,396,398,401,403,406,409,412,414,416,419],{"class":257,"line":373},8,[255,375,376],{"class":265},"  body",[255,378,379],{"class":261}," { ",[255,381,382],{"class":269},"font",[255,384,385],{"class":261},": ",[255,387,388],{"class":269},"15",[255,390,392],{"class":391},"sHUrx","px",[255,394,395],{"class":261},"\u002F",[255,397,133],{"class":269},[255,399,400],{"class":269}," system-ui",[255,402,26],{"class":261},[255,404,405],{"class":269},"sans-serif",[255,407,408],{"class":261},"; ",[255,410,411],{"class":269},"margin",[255,413,385],{"class":261},[255,415,133],{"class":269},[255,417,418],{"class":391},"rem",[255,420,421],{"class":261},"; }\n",[255,423,425],{"class":257,"line":424},9,[255,426,428],{"emptyLinePlaceholder":427},true,"\n",[255,430,432,435],{"class":257,"line":431},10,[255,433,434],{"class":269},"  .cards",[255,436,437],{"class":261}," {\n",[255,439,441,444,446,449],{"class":257,"line":440},11,[255,442,443],{"class":269},"    display",[255,445,385],{"class":261},[255,447,448],{"class":269},"grid",[255,450,451],{"class":261},";\n",[255,453,455,458,460,463,466,469,471,474,476,479,481,483,486,489],{"class":257,"line":454},12,[255,456,457],{"class":269},"    grid-template-columns",[255,459,385],{"class":261},[255,461,462],{"class":269},"repeat",[255,464,465],{"class":261},"(",[255,467,468],{"class":269},"auto-fill",[255,470,26],{"class":261},[255,472,473],{"class":269},"minmax",[255,475,465],{"class":261},[255,477,478],{"class":269},"14",[255,480,418],{"class":391},[255,482,26],{"class":261},[255,484,485],{"class":269},"1",[255,487,488],{"class":391},"fr",[255,490,491],{"class":261},"));\n",[255,493,495,498,500,502,504],{"class":257,"line":494},13,[255,496,497],{"class":269},"    gap",[255,499,385],{"class":261},[255,501,485],{"class":269},[255,503,418],{"class":391},[255,505,451],{"class":261},[255,507,509],{"class":257,"line":508},14,[255,510,511],{"class":261},"  }\n",[255,513,515],{"class":257,"line":514},15,[255,516,428],{"emptyLinePlaceholder":427},[255,518,520,523],{"class":257,"line":519},16,[255,521,522],{"class":269},"  .card",[255,524,437],{"class":261},[255,526,528,531,533,536,539],{"class":257,"line":527},17,[255,529,530],{"class":269},"    position",[255,532,385],{"class":261},[255,534,535],{"class":269},"relative",[255,537,538],{"class":261},";          ",[255,540,542],{"class":541},"sLBg1","\u002F* anchor for the badge *\u002F\n",[255,544,546,548,550,552],{"class":257,"line":545},18,[255,547,443],{"class":269},[255,549,385],{"class":261},[255,551,448],{"class":269},[255,553,451],{"class":261},[255,555,557],{"class":257,"line":556},19,[255,558,559],{"class":541},"    \u002F* Default: a single body row. *\u002F\n",[255,561,563,566,568,570,572],{"class":257,"line":562},20,[255,564,565],{"class":269},"    grid-template-rows",[255,567,385],{"class":261},[255,569,485],{"class":269},[255,571,488],{"class":391},[255,573,451],{"class":261},[255,575,577,580,582,584,586,589,592],{"class":257,"line":576},21,[255,578,579],{"class":269},"    border",[255,581,385],{"class":261},[255,583,485],{"class":269},[255,585,392],{"class":391},[255,587,588],{"class":269}," solid",[255,590,591],{"class":269}," #cbd5e1",[255,593,451],{"class":261},[255,595,597,600,602,605,607],{"class":257,"line":596},22,[255,598,599],{"class":269},"    border-radius",[255,601,385],{"class":261},[255,603,604],{"class":269},"12",[255,606,392],{"class":391},[255,608,451],{"class":261},[255,610,612,615,617,620],{"class":257,"line":611},23,[255,613,614],{"class":269},"    overflow",[255,616,385],{"class":261},[255,618,619],{"class":269},"hidden",[255,621,451],{"class":261},[255,623,625],{"class":257,"line":624},24,[255,626,511],{"class":261},[255,628,630],{"class":257,"line":629},25,[255,631,428],{"emptyLinePlaceholder":427},[255,633,635,638],{"class":257,"line":634},26,[255,636,637],{"class":269},"  .card__media",[255,639,437],{"class":261},[255,641,643,646,648,651,654,657,660],{"class":257,"line":642},27,[255,644,645],{"class":269},"    aspect-ratio",[255,647,385],{"class":261},[255,649,650],{"class":269},"16",[255,652,653],{"class":261}," \u002F ",[255,655,656],{"class":269},"9",[255,658,659],{"class":261},";        ",[255,661,662],{"class":541},"\u002F* space is reserved before the image loads *\u002F\n",[255,664,666,669,671,674,676,679,682,684,687,689,692],{"class":257,"line":665},28,[255,667,668],{"class":269},"    background",[255,670,385],{"class":261},[255,672,673],{"class":269},"linear-gradient",[255,675,465],{"class":261},[255,677,678],{"class":269},"135",[255,680,681],{"class":391},"deg",[255,683,26],{"class":261},[255,685,686],{"class":269},"#bfdbfe",[255,688,26],{"class":261},[255,690,691],{"class":269},"#818cf8",[255,693,694],{"class":261},");\n",[255,696,698],{"class":257,"line":697},29,[255,699,511],{"class":261},[255,701,703],{"class":257,"line":702},30,[255,704,428],{"emptyLinePlaceholder":427},[255,706,708,711,713,716,718,720,722],{"class":257,"line":707},31,[255,709,710],{"class":269},"  .card__body",[255,712,379],{"class":261},[255,714,715],{"class":269},"padding",[255,717,385],{"class":261},[255,719,485],{"class":269},[255,721,418],{"class":391},[255,723,421],{"class":261},[255,725,727,730,732,734,736,739,742,745,747,749,752,754,757,759],{"class":257,"line":726},32,[255,728,729],{"class":269},"  .card__title",[255,731,379],{"class":261},[255,733,411],{"class":269},[255,735,385],{"class":261},[255,737,738],{"class":269},"0",[255,740,741],{"class":269}," 0",[255,743,744],{"class":269}," 0.25",[255,746,418],{"class":391},[255,748,408],{"class":261},[255,750,751],{"class":269},"font-size",[255,753,385],{"class":261},[255,755,756],{"class":269},"1.05",[255,758,418],{"class":391},[255,760,421],{"class":261},[255,762,764,767,770,772,774,776,778,781,783,786],{"class":257,"line":763},33,[255,765,766],{"class":269},"  .card__text",[255,768,769],{"class":261},"  { ",[255,771,411],{"class":269},[255,773,385],{"class":261},[255,775,738],{"class":269},[255,777,408],{"class":261},[255,779,780],{"class":269},"color",[255,782,385],{"class":261},[255,784,785],{"class":269},"#475569",[255,787,421],{"class":261},[255,789,791],{"class":257,"line":790},34,[255,792,428],{"emptyLinePlaceholder":427},[255,794,796],{"class":257,"line":795},35,[255,797,798],{"class":541},"  \u002F* Has media: add a media row above the body. *\u002F\n",[255,800,802,805,807,810,813],{"class":257,"line":801},36,[255,803,804],{"class":269},"  .card:has",[255,806,465],{"class":261},[255,808,809],{"class":391},">",[255,811,812],{"class":269}," .card__media",[255,814,815],{"class":261},") {\n",[255,817,819,821,823,826,829,831],{"class":257,"line":818},37,[255,820,565],{"class":269},[255,822,385],{"class":261},[255,824,825],{"class":269},"auto",[255,827,828],{"class":269}," 1",[255,830,488],{"class":391},[255,832,451],{"class":261},[255,834,836],{"class":257,"line":835},38,[255,837,511],{"class":261},[255,839,841],{"class":257,"line":840},39,[255,842,428],{"emptyLinePlaceholder":427},[255,844,846],{"class":257,"line":845},40,[255,847,848],{"class":541},"  \u002F* No media: give the body a coloured top rule so the card\n",[255,850,852],{"class":257,"line":851},41,[255,853,854],{"class":541},"     still has a visual anchor instead of looking unfinished. *\u002F\n",[255,856,858,861,863,866,868,870,872],{"class":257,"line":857},42,[255,859,860],{"class":269},"  .card:not",[255,862,465],{"class":261},[255,864,865],{"class":269},":has",[255,867,465],{"class":261},[255,869,809],{"class":391},[255,871,812],{"class":269},[255,873,874],{"class":261},")) {\n",[255,876,878,881,883,885,887,889,892],{"class":257,"line":877},43,[255,879,880],{"class":269},"    border-top",[255,882,385],{"class":261},[255,884,141],{"class":269},[255,886,392],{"class":391},[255,888,588],{"class":269},[255,890,891],{"class":269}," #6366f1",[255,893,451],{"class":261},[255,895,897],{"class":257,"line":896},44,[255,898,511],{"class":261},[255,900,902],{"class":257,"line":901},45,[255,903,428],{"emptyLinePlaceholder":427},[255,905,907],{"class":257,"line":906},46,[255,908,909],{"class":541},"  \u002F* Has a badge: overlay it on the media if media exists... *\u002F\n",[255,911,913,916],{"class":257,"line":912},47,[255,914,915],{"class":269},"  .card__badge",[255,917,437],{"class":261},[255,919,921,924,926,929],{"class":257,"line":920},48,[255,922,923],{"class":269},"    justify-self",[255,925,385],{"class":261},[255,927,928],{"class":269},"start",[255,930,451],{"class":261},[255,932,934,937,939,941,943,945,947,949],{"class":257,"line":933},49,[255,935,936],{"class":269},"    margin",[255,938,385],{"class":261},[255,940,485],{"class":269},[255,942,418],{"class":391},[255,944,828],{"class":269},[255,946,418],{"class":391},[255,948,741],{"class":269},[255,950,451],{"class":261},[255,952,954,957,959,962,964,967,969],{"class":257,"line":953},50,[255,955,956],{"class":269},"    padding",[255,958,385],{"class":261},[255,960,961],{"class":269},"0.15",[255,963,418],{"class":391},[255,965,966],{"class":269}," 0.6",[255,968,418],{"class":391},[255,970,451],{"class":261},[255,972,974,976,978,981,983],{"class":257,"line":973},51,[255,975,599],{"class":269},[255,977,385],{"class":261},[255,979,980],{"class":269},"999",[255,982,392],{"class":391},[255,984,451],{"class":261},[255,986,988,990,992,995],{"class":257,"line":987},52,[255,989,668],{"class":269},[255,991,385],{"class":261},[255,993,994],{"class":269},"#1e293b",[255,996,451],{"class":261},[255,998,1000,1003,1005,1008],{"class":257,"line":999},53,[255,1001,1002],{"class":269},"    color",[255,1004,385],{"class":261},[255,1006,1007],{"class":269},"#f8fafc",[255,1009,451],{"class":261},[255,1011,1013,1016,1018,1021,1023],{"class":257,"line":1012},54,[255,1014,1015],{"class":269},"    font-size",[255,1017,385],{"class":261},[255,1019,1020],{"class":269},"0.75",[255,1022,418],{"class":391},[255,1024,451],{"class":261},[255,1026,1028],{"class":257,"line":1027},55,[255,1029,511],{"class":261},[255,1031,1033],{"class":257,"line":1032},56,[255,1034,428],{"emptyLinePlaceholder":427},[255,1036,1038,1040,1042,1044,1046,1049,1051,1054],{"class":257,"line":1037},57,[255,1039,804],{"class":269},[255,1041,465],{"class":261},[255,1043,809],{"class":391},[255,1045,812],{"class":269},[255,1047,1048],{"class":261},") ",[255,1050,809],{"class":391},[255,1052,1053],{"class":269}," .card__badge",[255,1055,437],{"class":261},[255,1057,1059,1061,1063,1066],{"class":257,"line":1058},58,[255,1060,530],{"class":269},[255,1062,385],{"class":261},[255,1064,1065],{"class":269},"absolute",[255,1067,451],{"class":261},[255,1069,1071,1074,1076,1078,1080,1083,1085,1088,1090],{"class":257,"line":1070},59,[255,1072,1073],{"class":269},"    inset",[255,1075,385],{"class":261},[255,1077,1020],{"class":269},[255,1079,418],{"class":391},[255,1081,1082],{"class":269}," auto",[255,1084,1082],{"class":269},[255,1086,1087],{"class":269}," 0.75",[255,1089,418],{"class":391},[255,1091,451],{"class":261},[255,1093,1095,1097,1099,1101],{"class":257,"line":1094},60,[255,1096,936],{"class":269},[255,1098,385],{"class":261},[255,1100,738],{"class":269},[255,1102,451],{"class":261},[255,1104,1106],{"class":257,"line":1105},61,[255,1107,511],{"class":261},[255,1109,1111],{"class":257,"line":1110},62,[255,1112,428],{"emptyLinePlaceholder":427},[255,1114,1116],{"class":257,"line":1115},63,[255,1117,1118],{"class":541},"  \u002F* Has a footer: pin it to the bottom with its own row. *\u002F\n",[255,1120,1122,1124,1126,1128,1131],{"class":257,"line":1121},64,[255,1123,804],{"class":269},[255,1125,465],{"class":261},[255,1127,809],{"class":391},[255,1129,1130],{"class":269}," .card__actions",[255,1132,815],{"class":261},[255,1134,1136,1138,1140,1142,1144,1146],{"class":257,"line":1135},65,[255,1137,565],{"class":269},[255,1139,385],{"class":261},[255,1141,485],{"class":269},[255,1143,488],{"class":391},[255,1145,1082],{"class":269},[255,1147,451],{"class":261},[255,1149,1151],{"class":257,"line":1150},66,[255,1152,511],{"class":261},[255,1154,1156,1158,1160,1162,1164,1167,1169,1171,1173,1175],{"class":257,"line":1155},67,[255,1157,804],{"class":269},[255,1159,465],{"class":261},[255,1161,809],{"class":391},[255,1163,812],{"class":269},[255,1165,1166],{"class":261},")",[255,1168,865],{"class":269},[255,1170,465],{"class":261},[255,1172,809],{"class":391},[255,1174,1130],{"class":269},[255,1176,815],{"class":261},[255,1178,1180,1182,1184,1186,1188,1190,1192],{"class":257,"line":1179},68,[255,1181,565],{"class":269},[255,1183,385],{"class":261},[255,1185,825],{"class":269},[255,1187,828],{"class":269},[255,1189,488],{"class":391},[255,1191,1082],{"class":269},[255,1193,451],{"class":261},[255,1195,1197],{"class":257,"line":1196},69,[255,1198,511],{"class":261},[255,1200,1202,1205],{"class":257,"line":1201},70,[255,1203,1204],{"class":269},"  .card__actions",[255,1206,437],{"class":261},[255,1208,1210,1212,1214,1217],{"class":257,"line":1209},71,[255,1211,443],{"class":269},[255,1213,385],{"class":261},[255,1215,1216],{"class":269},"flex",[255,1218,451],{"class":261},[255,1220,1222,1224,1226,1229,1231],{"class":257,"line":1221},72,[255,1223,497],{"class":269},[255,1225,385],{"class":261},[255,1227,1228],{"class":269},"0.5",[255,1230,418],{"class":391},[255,1232,451],{"class":261},[255,1234,1236,1238,1240,1242,1244,1246,1248],{"class":257,"line":1235},73,[255,1237,956],{"class":269},[255,1239,385],{"class":261},[255,1241,1020],{"class":269},[255,1243,418],{"class":391},[255,1245,828],{"class":269},[255,1247,418],{"class":391},[255,1249,451],{"class":261},[255,1251,1253,1255,1257,1259,1261,1263,1266],{"class":257,"line":1252},74,[255,1254,880],{"class":269},[255,1256,385],{"class":261},[255,1258,485],{"class":269},[255,1260,392],{"class":391},[255,1262,588],{"class":269},[255,1264,1265],{"class":269}," #e2e8f0",[255,1267,451],{"class":261},[255,1269,1271],{"class":257,"line":1270},75,[255,1272,511],{"class":261},[255,1274,1276],{"class":257,"line":1275},76,[255,1277,428],{"emptyLinePlaceholder":427},[255,1279,1281],{"class":257,"line":1280},77,[255,1282,1283],{"class":541},"  \u002F* A selector cannot measure text length, so a long title is the one\n",[255,1285,1287],{"class":257,"line":1286},78,[255,1288,1289],{"class":541},"     variant that still needs a flag from the template. *\u002F\n",[255,1291,1293,1295,1297,1300,1303,1306,1309,1311,1313,1315,1317,1320,1322],{"class":257,"line":1292},79,[255,1294,804],{"class":269},[255,1296,465],{"class":261},[255,1298,1299],{"class":269},".card__title",[255,1301,1302],{"class":261},"[",[255,1304,1305],{"class":269},"data-long",[255,1307,1308],{"class":261},"]) ",[255,1310,1299],{"class":269},[255,1312,379],{"class":261},[255,1314,751],{"class":269},[255,1316,385],{"class":261},[255,1318,1319],{"class":269},"0.95",[255,1321,418],{"class":391},[255,1323,421],{"class":261},[255,1325,1327,1330,1332],{"class":257,"line":1326},80,[255,1328,1329],{"class":261},"\u003C\u002F",[255,1331,368],{"class":265},[255,1333,273],{"class":261},[255,1335,1337,1339,1341],{"class":257,"line":1336},81,[255,1338,1329],{"class":261},[255,1340,301],{"class":265},[255,1342,273],{"class":261},[255,1344,1346,1348,1350],{"class":257,"line":1345},82,[255,1347,279],{"class":261},[255,1349,178],{"class":265},[255,1351,273],{"class":261},[255,1353,1355,1358,1361,1364,1366,1369],{"class":257,"line":1354},83,[255,1356,1357],{"class":261},"  \u003C",[255,1359,1360],{"class":265},"div",[255,1362,1363],{"class":269}," class",[255,1365,287],{"class":261},[255,1367,1368],{"class":290},"\"cards\"",[255,1370,273],{"class":261},[255,1372,1374,1377,1380,1382,1384,1387],{"class":257,"line":1373},84,[255,1375,1376],{"class":261},"    \u003C",[255,1378,1379],{"class":265},"article",[255,1381,1363],{"class":269},[255,1383,287],{"class":261},[255,1385,1386],{"class":290},"\"card\"",[255,1388,273],{"class":261},[255,1390,1392,1395,1397,1399,1401,1404,1407,1410,1412,1414,1417,1420,1422],{"class":257,"line":1391},85,[255,1393,1394],{"class":261},"      \u003C",[255,1396,1360],{"class":265},[255,1398,1363],{"class":269},[255,1400,287],{"class":261},[255,1402,1403],{"class":290},"\"card__body\"",[255,1405,1406],{"class":261},">\u003C",[255,1408,1409],{"class":265},"h3",[255,1411,1363],{"class":269},[255,1413,287],{"class":261},[255,1415,1416],{"class":290},"\"card__title\"",[255,1418,1419],{"class":261},">Text only\u003C\u002F",[255,1421,1409],{"class":265},[255,1423,273],{"class":261},[255,1425,1427,1430,1432,1434,1436,1439,1442,1444,1447,1449],{"class":257,"line":1426},86,[255,1428,1429],{"class":261},"        \u003C",[255,1431,20],{"class":265},[255,1433,1363],{"class":269},[255,1435,287],{"class":261},[255,1437,1438],{"class":290},"\"card__text\"",[255,1440,1441],{"class":261},">No media, so a coloured top rule appears.\u003C\u002F",[255,1443,20],{"class":265},[255,1445,1446],{"class":261},">\u003C\u002F",[255,1448,1360],{"class":265},[255,1450,273],{"class":261},[255,1452,1454,1457,1459],{"class":257,"line":1453},87,[255,1455,1456],{"class":261},"    \u003C\u002F",[255,1458,1379],{"class":265},[255,1460,273],{"class":261},[255,1462,1464,1466,1468,1470,1472,1474],{"class":257,"line":1463},88,[255,1465,1376],{"class":261},[255,1467,1379],{"class":265},[255,1469,1363],{"class":269},[255,1471,287],{"class":261},[255,1473,1386],{"class":290},[255,1475,273],{"class":261},[255,1477,1479,1481,1483,1485,1487,1490,1493,1495,1498,1501,1503,1506,1508,1510],{"class":257,"line":1478},89,[255,1480,1394],{"class":261},[255,1482,1360],{"class":265},[255,1484,1363],{"class":269},[255,1486,287],{"class":261},[255,1488,1489],{"class":290},"\"card__media\"",[255,1491,1492],{"class":269}," role",[255,1494,287],{"class":261},[255,1496,1497],{"class":290},"\"img\"",[255,1499,1500],{"class":269}," aria-label",[255,1502,287],{"class":261},[255,1504,1505],{"class":290},"\"Abstract gradient\"",[255,1507,1446],{"class":261},[255,1509,1360],{"class":265},[255,1511,273],{"class":261},[255,1513,1515,1517,1519,1521,1523,1525,1527,1529,1531,1533,1535,1538,1540],{"class":257,"line":1514},90,[255,1516,1394],{"class":261},[255,1518,1360],{"class":265},[255,1520,1363],{"class":269},[255,1522,287],{"class":261},[255,1524,1403],{"class":290},[255,1526,1406],{"class":261},[255,1528,1409],{"class":265},[255,1530,1363],{"class":269},[255,1532,287],{"class":261},[255,1534,1416],{"class":290},[255,1536,1537],{"class":261},">With media\u003C\u002F",[255,1539,1409],{"class":265},[255,1541,273],{"class":261},[255,1543,1545,1547,1549,1551,1553,1555,1558,1560,1562,1564],{"class":257,"line":1544},91,[255,1546,1429],{"class":261},[255,1548,20],{"class":265},[255,1550,1363],{"class":269},[255,1552,287],{"class":261},[255,1554,1438],{"class":290},[255,1556,1557],{"class":261},">A media row is added above.\u003C\u002F",[255,1559,20],{"class":265},[255,1561,1446],{"class":261},[255,1563,1360],{"class":265},[255,1565,273],{"class":261},[255,1567,1569,1571,1573],{"class":257,"line":1568},92,[255,1570,1456],{"class":261},[255,1572,1379],{"class":265},[255,1574,273],{"class":261},[255,1576,1578,1580,1582,1584,1586,1588],{"class":257,"line":1577},93,[255,1579,1376],{"class":261},[255,1581,1379],{"class":265},[255,1583,1363],{"class":269},[255,1585,287],{"class":261},[255,1587,1386],{"class":290},[255,1589,273],{"class":261},[255,1591,1593,1595,1597,1599,1601,1603,1605,1607,1609,1611,1613,1615,1617,1619],{"class":257,"line":1592},94,[255,1594,1394],{"class":261},[255,1596,1360],{"class":265},[255,1598,1363],{"class":269},[255,1600,287],{"class":261},[255,1602,1489],{"class":290},[255,1604,1492],{"class":269},[255,1606,287],{"class":261},[255,1608,1497],{"class":290},[255,1610,1500],{"class":269},[255,1612,287],{"class":261},[255,1614,1505],{"class":290},[255,1616,1446],{"class":261},[255,1618,1360],{"class":265},[255,1620,273],{"class":261},[255,1622,1624,1626,1628,1630,1632,1635,1638,1640],{"class":257,"line":1623},95,[255,1625,1394],{"class":261},[255,1627,255],{"class":265},[255,1629,1363],{"class":269},[255,1631,287],{"class":261},[255,1633,1634],{"class":290},"\"card__badge\"",[255,1636,1637],{"class":261},">New\u003C\u002F",[255,1639,255],{"class":265},[255,1641,273],{"class":261},[255,1643,1645,1647,1649,1651,1653,1655,1657,1659,1661,1663,1665,1668,1670],{"class":257,"line":1644},96,[255,1646,1394],{"class":261},[255,1648,1360],{"class":265},[255,1650,1363],{"class":269},[255,1652,287],{"class":261},[255,1654,1403],{"class":290},[255,1656,1406],{"class":261},[255,1658,1409],{"class":265},[255,1660,1363],{"class":269},[255,1662,287],{"class":261},[255,1664,1416],{"class":290},[255,1666,1667],{"class":261},">Media and badge\u003C\u002F",[255,1669,1409],{"class":265},[255,1671,273],{"class":261},[255,1673,1675,1677,1679,1681,1683,1685,1688,1690,1692,1694],{"class":257,"line":1674},97,[255,1676,1429],{"class":261},[255,1678,20],{"class":265},[255,1680,1363],{"class":269},[255,1682,287],{"class":261},[255,1684,1438],{"class":290},[255,1686,1687],{"class":261},">The badge floats over the media.\u003C\u002F",[255,1689,20],{"class":265},[255,1691,1446],{"class":261},[255,1693,1360],{"class":265},[255,1695,273],{"class":261},[255,1697,1699,1701,1703],{"class":257,"line":1698},98,[255,1700,1456],{"class":261},[255,1702,1379],{"class":265},[255,1704,273],{"class":261},[255,1706,1708,1710,1712,1714,1716,1718],{"class":257,"line":1707},99,[255,1709,1376],{"class":261},[255,1711,1379],{"class":265},[255,1713,1363],{"class":269},[255,1715,287],{"class":261},[255,1717,1386],{"class":290},[255,1719,273],{"class":261},[255,1721,1723,1725,1727,1729,1731,1733,1735,1737,1739,1741,1743,1746,1748],{"class":257,"line":1722},100,[255,1724,1394],{"class":261},[255,1726,1360],{"class":265},[255,1728,1363],{"class":269},[255,1730,287],{"class":261},[255,1732,1403],{"class":290},[255,1734,1406],{"class":261},[255,1736,1409],{"class":265},[255,1738,1363],{"class":269},[255,1740,287],{"class":261},[255,1742,1416],{"class":290},[255,1744,1745],{"class":261},">With actions\u003C\u002F",[255,1747,1409],{"class":265},[255,1749,273],{"class":261},[255,1751,1753,1755,1757,1759,1761,1763,1766,1768,1770,1772],{"class":257,"line":1752},101,[255,1754,1429],{"class":261},[255,1756,20],{"class":265},[255,1758,1363],{"class":269},[255,1760,287],{"class":261},[255,1762,1438],{"class":290},[255,1764,1765],{"class":261},">A footer row is pinned to the bottom.\u003C\u002F",[255,1767,20],{"class":265},[255,1769,1446],{"class":261},[255,1771,1360],{"class":265},[255,1773,273],{"class":261},[255,1775,1777,1779,1781,1783,1785,1788,1790,1792,1795,1797,1800,1803,1805,1807,1809,1811,1813,1815,1818,1820,1822,1824],{"class":257,"line":1776},102,[255,1778,1394],{"class":261},[255,1780,1360],{"class":265},[255,1782,1363],{"class":269},[255,1784,287],{"class":261},[255,1786,1787],{"class":290},"\"card__actions\"",[255,1789,1406],{"class":261},[255,1791,41],{"class":265},[255,1793,1794],{"class":269}," href",[255,1796,287],{"class":261},[255,1798,1799],{"class":290},"\"#\"",[255,1801,1802],{"class":261},">Read\u003C\u002F",[255,1804,41],{"class":265},[255,1806,1406],{"class":261},[255,1808,41],{"class":265},[255,1810,1794],{"class":269},[255,1812,287],{"class":261},[255,1814,1799],{"class":290},[255,1816,1817],{"class":261},">Save\u003C\u002F",[255,1819,41],{"class":265},[255,1821,1446],{"class":261},[255,1823,1360],{"class":265},[255,1825,273],{"class":261},[255,1827,1829,1831,1833],{"class":257,"line":1828},103,[255,1830,1456],{"class":261},[255,1832,1379],{"class":265},[255,1834,273],{"class":261},[255,1836,1838,1841,1843],{"class":257,"line":1837},104,[255,1839,1840],{"class":261},"  \u003C\u002F",[255,1842,1360],{"class":265},[255,1844,273],{"class":261},[255,1846,1848,1850,1852],{"class":257,"line":1847},105,[255,1849,1329],{"class":261},[255,1851,178],{"class":265},[255,1853,273],{"class":261},[255,1855,1857,1859,1861],{"class":257,"line":1856},106,[255,1858,1329],{"class":261},[255,1860,250],{"class":265},[255,1862,273],{"class":261},[20,1864,1865,1866,1869,1870,1872],{},"The combined rule ",[15,1867,1868],{},".card:has(> .card__media):has(> .card__actions)"," handles the three-row case. Chaining two ",[15,1871,17],{}," pseudo-classes means \"both conditions\", and it avoids a single complicated argument. Without it, the media rule and the actions rule would each set a two-row template and the later one would win, dropping one of the rows.",[20,1874,1875,1876,1879],{},"The badge rule shows the other useful shape: a child's placement depending on a ",[84,1877,1878],{},"sibling's"," presence. The badge sits in normal flow when there is no media, and becomes an overlay only when there is media to overlay. This is the kind of logic that previously needed the template to know about both elements at once.",[53,1881,1883],{"id":1882},"the-key-technique-presence-absence-and-composition","The key technique: presence, absence and composition",[99,1885,106,1888,106,1891,106,1894,106,1897,106,1904,106,1910,106,1914,106,1918,106,1922,106,1925,106,1928,106,1932,106,1935,106,1938,106,1942,106,1946,106,1949,106,1952,106,1955],{"viewBox":1886,"role":102,"ariaLabel":1887,"xmlns":104,"style":105},"0 0 720 290","Three selector forms: presence with has, absence with not has, and composition by chaining has",[108,1889,1890],{},"Three selector forms for content-aware components",[112,1892,1893],{},"Presence uses .card:has(> x). Absence uses .card:not(:has(> x)). Composition chains two has pseudo-classes to require both children.",[116,1895,1896],{"textAnchor":118,"x":119,"y":120,"style":121},"Everything is built from three forms",[124,1898],{"x":1899,"y":1900,"width":1901,"height":1902,"rx":130,"fill":142,"opacity":1903},"30","48","200","190","0.18",[116,1905,1909],{"textAnchor":118,"x":1906,"y":1907,"style":1908},"130","76","text-anchor:middle;fill:currentColor;font:700 14px sans-serif","Presence",[116,1911,1913],{"textAnchor":118,"x":1906,"y":1912,"style":153},"110",".card:has(> x)",[116,1915,1917],{"textAnchor":118,"x":1906,"y":1916,"style":148},"150","add a row,",[116,1919,1921],{"textAnchor":118,"x":1906,"y":1920,"style":148},"170","reposition a sibling",[124,1923],{"x":1924,"y":1900,"width":1901,"height":1902,"rx":130,"fill":142,"opacity":1903},"260",[116,1926,1927],{"textAnchor":118,"x":119,"y":1907,"style":1908},"Absence",[116,1929,1931],{"textAnchor":118,"x":119,"y":1912,"style":1930},"text-anchor:middle;fill:currentColor;font:11px ui-monospace,monospace",".card:not(:has(> x))",[116,1933,1934],{"textAnchor":118,"x":119,"y":1916,"style":148},"fill the gap,",[116,1936,1937],{"textAnchor":118,"x":119,"y":1920,"style":148},"show a placeholder",[124,1939],{"x":1940,"y":1900,"width":1901,"height":1902,"rx":130,"fill":142,"opacity":1941},"490","0.34",[116,1943,1945],{"textAnchor":118,"x":1944,"y":1907,"style":1908},"590","Composition",[116,1947,1948],{"textAnchor":118,"x":1944,"y":1912,"style":1930},":has(> x):has(> y)",[116,1950,1951],{"textAnchor":118,"x":1944,"y":1916,"style":148},"both present:",[116,1953,1954],{"textAnchor":118,"x":1944,"y":1920,"style":148},"combined template",[116,1956,1958],{"textAnchor":118,"x":119,"y":168,"style":1957},"text-anchor:middle;fill:currentColor;font:12px sans-serif;opacity:0.75","Always use the child combinator so nested components cannot trigger the parent's rules.",[20,1960,1961,1962,1965,1966,1968,1969,1976],{},"The child combinator deserves emphasis again. Cards nest: a card might contain a list of related cards, each with its own media. With ",[15,1963,1964],{},".card:has(.card__media)",", the outer card would match because of an inner card's image, and gain a media row it does not have. ",[15,1967,78],{}," looks only at its own direct children, which is what component boundaries require. The general principle is covered in ",[41,1970,1972,1975],{"href":1971},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fhas-selector-performance\u002F",[1973,1974],"has",{},"() Selector Performance",", where narrow arguments are also the cheap ones.",[53,1978,1980],{"id":1979},"migrating-a-component-library-off-modifier-classes","Migrating a component library off modifier classes",[20,1982,1983,1984,1987],{},"In an established design system the modifiers are part of a public API: product teams pass ",[15,1985,1986],{},"variant=\"with-image\""," to a card component, and removing that prop breaks their code. The migration therefore has to be additive first and subtractive later.",[20,1989,1990,1991,1993,1994,1997,1998,2001,2002,2004],{},"Start by adding the ",[15,1992,17],{}," rules alongside the existing modifier rules, and make them produce exactly the same declarations. At this stage both mechanisms agree whenever the template is correct, and where the template is ",[84,1995,1996],{},"wrong"," — a ",[15,1999,2000],{},"with-image"," card with no image — the two now conflict. Put the ",[15,2003,17],{}," rules later in the stylesheet, or in a later cascade layer, so the content-derived answer wins. Every card whose appearance changes during this step was a card that was already rendering incorrectly, which makes the diff a free audit of template bugs.",[20,2006,2007],{},"Next, deprecate the props in the component's documentation and make the component ignore them — the class may still be emitted for backward compatibility, but no rule reads it. Finally, after a release cycle, remove the classes and the dead modifier rules together.",[20,2009,2010,2011,2013,2014,2017],{},"Two things tend to surface during the audit. First, some \"content\" modifiers turn out to be editorial after all: a card marked ",[15,2012,2000],{}," whose image is decorative and hidden on small screens, say. Those become explicit data attributes such as ",[15,2015,2016],{},"data-media=\"decorative\"",", which is honest about being a decision rather than a fact. Second, tests that snapshot class names start failing even though nothing visible changed. Switching those tests to screenshot or accessibility-tree assertions is worth doing anyway, because class names were never the contract that mattered.",[20,2019,2020,2021,2025,2026,2029,2030,2033,2034,2036],{},"For teams using ",[41,2022,2024],{"href":2023},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens\u002F","cascade layers",", the cleanest arrangement is a ",[15,2027,2028],{},"components"," layer for the base card and a later ",[15,2031,2032],{},"components.content"," sub-layer holding the ",[15,2035,17],{}," rules, so the precedence between the two mechanisms is stated structurally rather than depending on source order in a bundle.",[53,2038,2040],{"id":2039},"variation-switching-orientation-with-a-container-query","Variation: switching orientation with a container query",[20,2042,2043,2044,2047,2048,2051,2052,2056],{},"Content decides ",[84,2045,2046],{},"which"," rows exist; width decides ",[84,2049,2050],{},"how"," they are arranged. Adding a ",[41,2053,2055],{"href":2054},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002F","container query"," makes a card with media switch to a side-by-side layout when it has room, while a text-only card stays as it is.",[246,2058,2062],{"className":2059,"code":2060,"language":2061,"meta":251,"style":251},"language-css shiki shiki-themes github-light-high-contrast github-dark-high-contrast",".card-wrapper { container-type: inline-size; }\n\n\u002F* Wide AND has media: image on the left, body on the right. *\u002F\n@container (width > 30rem) {\n  .card:has(> .card__media) {\n    grid-template-columns: minmax(10rem, 40%) 1fr;\n    grid-template-rows: 1fr;\n  }\n  .card:has(> .card__media) > .card__media {\n    aspect-ratio: auto;          \u002F* fill the row height instead *\u002F\n    height: 100%;\n  }\n  .card:has(> .card__media):has(> .card__actions) > .card__actions {\n    grid-column: 2;\n  }\n}\n","css",[15,2063,2064,2077,2081,2086,2094,2106,2136,2148,2152,2170,2183,2197,2201,2229,2241,2245],{"__ignoreMap":251},[255,2065,2066,2069,2071,2074],{"class":257,"line":258},[255,2067,2068],{"class":269},".card-wrapper",[255,2070,379],{"class":261},[255,2072,2073],{"class":269},"container-type",[255,2075,2076],{"class":261},": inline-size; }\n",[255,2078,2079],{"class":257,"line":276},[255,2080,428],{"emptyLinePlaceholder":427},[255,2082,2083],{"class":257,"line":296},[255,2084,2085],{"class":541},"\u002F* Wide AND has media: image on the left, body on the right. *\u002F\n",[255,2087,2088,2091],{"class":257,"line":306},[255,2089,2090],{"class":391},"@container",[255,2092,2093],{"class":261}," (width > 30rem) {\n",[255,2095,2096,2098,2100,2102,2104],{"class":257,"line":324},[255,2097,804],{"class":269},[255,2099,465],{"class":261},[255,2101,809],{"class":391},[255,2103,812],{"class":269},[255,2105,815],{"class":261},[255,2107,2108,2110,2112,2114,2116,2118,2120,2122,2125,2128,2130,2132,2134],{"class":257,"line":349},[255,2109,457],{"class":269},[255,2111,385],{"class":261},[255,2113,473],{"class":269},[255,2115,465],{"class":261},[255,2117,130],{"class":269},[255,2119,418],{"class":391},[255,2121,26],{"class":261},[255,2123,2124],{"class":269},"40",[255,2126,2127],{"class":391},"%",[255,2129,1048],{"class":261},[255,2131,485],{"class":269},[255,2133,488],{"class":391},[255,2135,451],{"class":261},[255,2137,2138,2140,2142,2144,2146],{"class":257,"line":363},[255,2139,565],{"class":269},[255,2141,385],{"class":261},[255,2143,485],{"class":269},[255,2145,488],{"class":391},[255,2147,451],{"class":261},[255,2149,2150],{"class":257,"line":373},[255,2151,511],{"class":261},[255,2153,2154,2156,2158,2160,2162,2164,2166,2168],{"class":257,"line":424},[255,2155,804],{"class":269},[255,2157,465],{"class":261},[255,2159,809],{"class":391},[255,2161,812],{"class":269},[255,2163,1048],{"class":261},[255,2165,809],{"class":391},[255,2167,812],{"class":269},[255,2169,437],{"class":261},[255,2171,2172,2174,2176,2178,2180],{"class":257,"line":431},[255,2173,645],{"class":269},[255,2175,385],{"class":261},[255,2177,825],{"class":269},[255,2179,538],{"class":261},[255,2181,2182],{"class":541},"\u002F* fill the row height instead *\u002F\n",[255,2184,2185,2188,2190,2193,2195],{"class":257,"line":440},[255,2186,2187],{"class":269},"    height",[255,2189,385],{"class":261},[255,2191,2192],{"class":269},"100",[255,2194,2127],{"class":391},[255,2196,451],{"class":261},[255,2198,2199],{"class":257,"line":454},[255,2200,511],{"class":261},[255,2202,2203,2205,2207,2209,2211,2213,2215,2217,2219,2221,2223,2225,2227],{"class":257,"line":494},[255,2204,804],{"class":269},[255,2206,465],{"class":261},[255,2208,809],{"class":391},[255,2210,812],{"class":269},[255,2212,1166],{"class":261},[255,2214,865],{"class":269},[255,2216,465],{"class":261},[255,2218,809],{"class":391},[255,2220,1130],{"class":269},[255,2222,1048],{"class":261},[255,2224,809],{"class":391},[255,2226,1130],{"class":269},[255,2228,437],{"class":261},[255,2230,2231,2234,2236,2239],{"class":257,"line":508},[255,2232,2233],{"class":269},"    grid-column",[255,2235,385],{"class":261},[255,2237,2238],{"class":269},"2",[255,2240,451],{"class":261},[255,2242,2243],{"class":257,"line":514},[255,2244,511],{"class":261},[255,2246,2247],{"class":257,"line":519},[255,2248,2249],{"class":261},"}\n",[20,2251,2252,2253,2255,2256,2260,2261,2265],{},"The two mechanisms never conflict because they answer different questions. The query establishes that there is room; the ",[15,2254,17],{}," establishes that there is something worth putting in that room. For a full treatment of the width side, see ",[41,2257,2259],{"href":2258},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fbuilding-responsive-cards-with-container-queries\u002F","Building Responsive Cards With Container Queries",". If the card should animate between shapes as content changes — a badge appearing, actions revealing on hover — ",[41,2262,2264],{"href":2263},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fsmooth-hover-effects-without-javascript\u002F","smooth hover effects without JavaScript"," covers the transition side.",[53,2267,2269],{"id":2268},"browser-support","Browser support",[20,2271,2272,2274,2275,2278,2279,2281],{},[15,2273,17],{}," is supported in Chrome and Edge 105+, Firefox 121+ and Safari 15.4+. ",[15,2276,2277],{},"aspect-ratio",", which reserves media space, is supported in Chrome and Edge 88+, Firefox 89+ and Safari 15+. Container queries need Chrome and Edge 105+, Firefox 110+ or Safari 16+. In an engine without ",[15,2280,17],{},", cards fall back to the single-row default: media and body still stack in source order because grid auto-places extra children into implicit rows, badges sit in flow, and nothing is hidden, so the component degrades to plain but complete.",[53,2283,2285],{"id":2284},"faq","FAQ",[20,2287,2288,2295,2296,2298,2299,2302,2303,2305],{},[2289,2290,2291,2292,2294],"strong",{},"Should I replace all card modifier classes with ",[15,2293,17],{},"?","\nReplace the ones that merely describe content, such as ",[15,2297,25],{}," or ",[15,2300,2301],{},"card--no-footer",", because ",[15,2304,17],{}," can detect that content directly and cannot go out of sync. Keep classes for editorial choices that are not visible in the markup, such as a featured card that should be larger.",[20,2307,2308,2314,2315,2318,2319,2322,2323,2326,2327,2329],{},[2289,2309,2310,2311,2313],{},"Can ",[15,2312,17],{}," check whether an image has loaded?","\nNo. ",[15,2316,2317],{},":has(img)"," matches as soon as the element is in the DOM, whether or not the file has downloaded or failed. Reserve space with ",[15,2320,2321],{},"width"," and ",[15,2324,2325],{},"height"," attributes or ",[15,2328,2277],{}," so the layout is correct before and after loading.",[20,2331,2332,2337,2338,2341,2342,2345,2346,2348,2349,236],{},[2289,2333,2334,2335,2294],{},"How do I detect an empty element with ",[15,2336,17],{},"\nUse ",[15,2339,2340],{},":empty"," for an element with no children or text at all, or ",[15,2343,2344],{},":not(:has(*))"," for an element with no child elements. Whitespace counts as content for ",[15,2347,2340],{}," in current engines' long-standing behaviour, so a template that leaves a newline inside an otherwise empty div will not match ",[15,2350,2340],{},[20,2352,2353,2356,2357,2359],{},[2289,2354,2355],{},"Does a card that changes layout by content still need container queries?","\nUsually yes, because the two answer different questions. ",[15,2358,17],{}," responds to what the card contains; a container query responds to how much room it has. A card with media should still switch from stacked to side-by-side based on its width.",[53,2361,2363],{"id":2362},"related","Related",[2365,2366,2367,2377,2386,2391,2398],"ul",{},[2368,2369,2370,2376],"li",{},[41,2371,2372,2373,2375],{"href":43},"Parent-Aware Layouts With ",[1973,2374],{},"()"," — the parent guide to relational selectors.",[2368,2378,2379,2385],{},[41,2380,2382,2383,2375],{"href":2381},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fquantity-queries-with-has\u002F","Quantity Queries With ",[1973,2384],{}," — layouts driven by how many children exist.",[2368,2387,2388,2390],{},[41,2389,2259],{"href":2258}," — the width half of the same component.",[2368,2392,2393,2397],{},[41,2394,2396],{"href":2395},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid\u002F","Subgrid vs Nested Grid"," — keeping rows aligned across a grid of these cards.",[2368,2399,2400,2403],{},[41,2401,2402],{"href":2263},"Smooth Hover Effects Without JavaScript"," — motion for the card once its shape is settled.",[368,2405,2406],{},"html pre.shiki code .suds8, html code.shiki .suds8{--shiki-default:#0E1116;--shiki-dark:#F0F3F6}html pre.shiki code .sne4z, html code.shiki .sne4z{--shiki-default:#024C1A;--shiki-dark:#72F088}html pre.shiki code .s-5SL, html code.shiki .s-5SL{--shiki-default:#023B95;--shiki-dark:#91CBFF}html pre.shiki code .sT6z2, html code.shiki .sT6z2{--shiki-default:#032563;--shiki-dark:#ADDCFF}html pre.shiki code .sHUrx, html code.shiki .sHUrx{--shiki-default:#A0111F;--shiki-dark:#FF9492}html pre.shiki code .sLBg1, html code.shiki .sLBg1{--shiki-default:#66707B;--shiki-dark:#BDC4CC}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":251,"searchDepth":276,"depth":276,"links":2408},[2409,2410,2411,2412,2413,2414,2415,2416,2417],{"id":55,"depth":276,"text":56},{"id":96,"depth":276,"text":97},{"id":239,"depth":276,"text":240},{"id":1882,"depth":276,"text":1883},{"id":1979,"depth":276,"text":1980},{"id":2039,"depth":276,"text":2040},{"id":2268,"depth":276,"text":2269},{"id":2284,"depth":276,"text":2285},{"id":2362,"depth":276,"text":2363},"One card component that lays itself out from what it contains: media or no media, badges and footer actions, using :has() in place of modifier classes.","md",{"pageTitle":2421,"datePublished":2422,"dateModified":2422,"faq":2423},"Content-Aware Cards With :has()","2026-09-18",[2424,2427,2430,2433],{"q":2425,"a":2426},"Should I replace all card modifier classes with :has()?","Replace the ones that merely describe content, such as card--with-image or card--no-footer, because :has() can detect that content directly and cannot go out of sync. Keep classes for editorial choices that are not visible in the markup, such as a featured card that should be larger.",{"q":2428,"a":2429},"Can :has() check whether an image has loaded?","No. :has(img) matches as soon as the element is in the DOM, whether or not the file has downloaded or failed. Reserve space with width and height attributes or aspect-ratio so the layout is correct before and after loading.",{"q":2431,"a":2432},"How do I detect an empty element with :has()?","Use :empty for an element with no children or text at all, or :not(:has(*)) for an element with no child elements. Whitespace counts as content for :empty in current engines' long-standing behaviour, so a template that leaves a newline inside an otherwise empty div will not match :empty.",{"q":2355,"a":2434},"Usually yes, because the two answer different questions. :has() responds to what the card contains; a container query responds to how much room it has. A card with media should still switch from stacked to side-by-side based on its width.","\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fcontent-aware-card-layouts-with-has",{"title":5,"description":2418},"mastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fcontent-aware-card-layouts-with-has\u002Findex","HmBg6lmEw_D-EwncMKiOIQK_21CK3vm4Ci_yXvZagGE",[2440,2443,2446,2449,2452,2455,2458,2461,2464,2467,2470,2473,2476,2479,2482,2485,2488,2491,2494,2497,2500,2503,2506,2509,2512,2515,2518,2521,2524,2527,2530,2533,2536,2539,2542,2545,2548,2551,2554,2557,2560,2563,2566,2569,2572,2575,2578,2581,2584,2587,2590,2593,2596,2599,2602,2605,2608,2611,2614,2617,2620,2623,2626,2629,2632,2635,2638,2641,2644,2647,2650,2653,2656,2659,2662,2665,2668,2671,2674,2677,2680,2683,2686,2689,2692,2695,2698,2701,2704,2707,2710,2713,2716,2719,2721,2724,2727,2730,2733,2736,2739,2742,2745,2748,2751,2754,2757,2760,2763,2766,2769,2772,2775,2778,2781,2784,2787,2790,2793,2796,2799,2802,2805,2808,2811,2814,2817,2820,2823,2826,2829,2832,2835,2838,2841,2844,2847,2850,2853,2856,2859,2861,2864,2867,2870,2873,2876,2879,2882,2885,2888,2891,2894,2897,2900,2901,2904,2907,2910,2913,2916,2919,2922,2925,2928,2931,2934,2937,2940,2943,2946,2949,2952,2955,2958,2961,2964,2967,2970,2973,2976,2979,2982,2985,2988,2991,2994],{"path":2441,"title":2442},"\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":2444,"title":2445},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":2447,"title":2448},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":2450,"title":2451},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":2453,"title":2454},"\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":2456,"title":2457},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":2459,"title":2460},"\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":2462,"title":2463},"\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":2465,"title":2466},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":2468,"title":2469},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":2471,"title":2472},"\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":2474,"title":2475},"\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":2477,"title":2478},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":2480,"title":2481},"\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":2483,"title":2484},"\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":2486,"title":2487},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":2489,"title":2490},"\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":2492,"title":2493},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":2495,"title":2496},"\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":2498,"title":2499},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":2501,"title":2502},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":2504,"title":2505},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":2507,"title":2508},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":2510,"title":2511},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":2513,"title":2514},"\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":2516,"title":2517},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":2519,"title":2520},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":2522,"title":2523},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":2525,"title":2526},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":2528,"title":2529},"\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":2531,"title":2532},"\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":2534,"title":2535},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":2537,"title":2538},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":2540,"title":2541},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":2543,"title":2544},"\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":2546,"title":2547},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":2549,"title":2550},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":2552,"title":2553},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":2555,"title":2556},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":2558,"title":2559},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":2561,"title":2562},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":2564,"title":2565},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":2567,"title":2568},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":2570,"title":2571},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":2573,"title":2574},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"path":2576,"title":2577},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":2579,"title":2580},"\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":2582,"title":2583},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":2585,"title":2586},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":2588,"title":2589},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":2591,"title":2592},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":2594,"title":2595},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":2597,"title":2598},"\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":2600,"title":2601},"\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":2603,"title":2604},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":2606,"title":2607},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states","Button Press and  States",{"path":2609,"title":2610},"\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":2612,"title":2613},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":2615,"title":2616},"\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":2618,"title":2619},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":2621,"title":2622},"\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":2624,"title":2625},"\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":2627,"title":2628},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":2630,"title":2631},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking","Stacking Animations With animation-composition",{"path":2633,"title":2634},"\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":2636,"title":2637},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":2639,"title":2640},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":2642,"title":2643},"\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":2645,"title":2646},"\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":2648,"title":2649},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":2651,"title":2652},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":2654,"title":2655},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":2657,"title":2658},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply","Animating box-shadow and Filters Cheaply",{"path":2660,"title":2661},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":2663,"title":2664},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite","Layout, Paint and Composite: What Triggers What",{"path":2666,"title":2667},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":2669,"title":2670},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":2672,"title":2673},"\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":2675,"title":2676},"\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":2678,"title":2679},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":2681,"title":2682},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":2684,"title":2685},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects","Scroll-Driven Parallax Effects in CSS",{"path":2687,"title":2688},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":2690,"title":2691},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":2693,"title":2694},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":2696,"title":2697},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range","View Timelines and animation-range",{"path":2699,"title":2700},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":2702,"title":2703},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":2705,"title":2706},"\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":2708,"title":2709},"\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":2711,"title":2712},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":2714,"title":2715},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":2717,"title":2718},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":395,"title":2720},"Modern CSS Layouts & Micro-Interactions",{"path":2722,"title":2723},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":2725,"title":2726},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":2728,"title":2729},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":2731,"title":2732},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":2734,"title":2735},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":2737,"title":2738},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":2740,"title":2741},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":2743,"title":2744},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":2746,"title":2747},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":2749,"title":2750},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":2752,"title":2753},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":2755,"title":2756},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":2758,"title":2759},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":2761,"title":2762},"\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":2764,"title":2765},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":2767,"title":2768},"\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":2770,"title":2771},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":2773,"title":2774},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":2776,"title":2777},"\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":2779,"title":2780},"\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":2782,"title":2783},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics","Container Query Syntax Basics",{"path":2785,"title":2786},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":2788,"title":2789},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":2791,"title":2792},"\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":2794,"title":2795},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":2797,"title":2798},"\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":2800,"title":2801},"\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":2803,"title":2804},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":2806,"title":2807},"\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":2809,"title":2810},"\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":2812,"title":2813},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":2815,"title":2816},"\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":2818,"title":2819},"\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":2821,"title":2822},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":2824,"title":2825},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":2827,"title":2828},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":2830,"title":2831},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":2833,"title":2834},"\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":2836,"title":2837},"\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":2839,"title":2840},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":2842,"title":2843},"\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":2845,"title":2846},"\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":2848,"title":2849},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":2851,"title":2852},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":2854,"title":2855},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":2857,"title":2858},"\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":2860,"title":50},"\u002Fmastering-container-queries-responsive-layouts",{"path":2862,"title":2863},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":2865,"title":2866},"\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":2868,"title":2869},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":2871,"title":2872},"\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":2874,"title":2875},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":2877,"title":2878},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":2880,"title":2881},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":2883,"title":2884},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":2886,"title":2887},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":2889,"title":2890},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":2892,"title":2893},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":2895,"title":2896},"\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":2898,"title":2899},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset","Writing a Minimal Modern CSS Reset: Every Line Justified",{"path":2435,"title":5},{"path":2902,"title":2903},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has","Empty and Loading States With ()",{"path":2905,"title":2906},"\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":2908,"title":2909},"\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":2911,"title":2912},"\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":2914,"title":2915},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"path":2917,"title":2918},"\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":2920,"title":2921},"\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":2923,"title":2924},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":2926,"title":2927},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":2929,"title":2930},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":2932,"title":2933},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":2935,"title":2936},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":2938,"title":2939},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":2941,"title":2942},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":2944,"title":2945},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions","Tabs That Become an Accordion: One Component, Two Layouts",{"path":2947,"title":2948},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":2950,"title":2951},"\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":2953,"title":2954},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":2956,"title":2957},"\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":2959,"title":2960},"\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":2962,"title":2963},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":2965,"title":2966},"\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":2968,"title":2969},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":2971,"title":2972},"\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":2974,"title":2975},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":2977,"title":2978},"\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":2980,"title":2981},"\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":2983,"title":2984},"\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":2986,"title":2987},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":2989,"title":2990},"\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":2992,"title":2993},"\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":2995,"title":2996},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":2998,"caption":2999,"height":3000,"resizable":427,"html":3001,"css":3002},"Cards that lay themselves out from their children","Four cards share one class: media adds a row, a badge floats only over media, actions add a pinned footer, and no media adds a top rule.",480,"\n\u003Cdiv class=\"cards\">\n  \u003Carticle class=\"card\">\n    \u003Cdiv class=\"card__body\">\u003Ch3 class=\"card__title\">Text only\u003C\u002Fh3>\n      \u003Cp class=\"card__text\">No media, so a coloured top rule appears.\u003C\u002Fp>\u003C\u002Fdiv>\n  \u003C\u002Farticle>\n  \u003Carticle class=\"card\">\n    \u003Cdiv class=\"card__media\" role=\"img\" aria-label=\"Abstract gradient\">\u003C\u002Fdiv>\n    \u003Cdiv class=\"card__body\">\u003Ch3 class=\"card__title\">With media\u003C\u002Fh3>\n      \u003Cp class=\"card__text\">A media row is added above.\u003C\u002Fp>\u003C\u002Fdiv>\n  \u003C\u002Farticle>\n  \u003Carticle class=\"card\">\n    \u003Cdiv class=\"card__media\" role=\"img\" aria-label=\"Abstract gradient\">\u003C\u002Fdiv>\n    \u003Cspan class=\"card__badge\">New\u003C\u002Fspan>\n    \u003Cdiv class=\"card__body\">\u003Ch3 class=\"card__title\">Media and badge\u003C\u002Fh3>\n      \u003Cp class=\"card__text\">The badge floats over the media.\u003C\u002Fp>\u003C\u002Fdiv>\n  \u003C\u002Farticle>\n  \u003Carticle class=\"card\">\n    \u003Cdiv class=\"card__body\">\u003Ch3 class=\"card__title\">With actions\u003C\u002Fh3>\n      \u003Cp class=\"card__text\">A footer row is pinned to the bottom.\u003C\u002Fp>\u003C\u002Fdiv>\n    \u003Cdiv class=\"card__actions\">\u003Ca href=\"#\">Read\u003C\u002Fa>\u003Ca href=\"#\">Save\u003C\u002Fa>\u003C\u002Fdiv>\n  \u003C\u002Farticle>\n\u003C\u002Fdiv>","\nbody { display: block; }\n.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; }\n.card {\n  position: relative;\n  display: grid;\n  grid-template-rows: 1fr;\n  border: 1px solid var(--demo-border);\n  border-radius: 12px;\n  overflow: hidden;\n  background: var(--demo-surface);\n}\n.card__media { aspect-ratio: 16 \u002F 9; background: linear-gradient(135deg, #bfdbfe, #818cf8); }\n.card__body { padding: 1rem; }\n.card__title { margin: 0 0 0.25rem; font-size: 1.05rem; }\n.card__text { margin: 0; color: var(--demo-muted); }\n.card:has(> .card__media) { grid-template-rows: auto 1fr; }\n.card:not(:has(> .card__media)) { border-top: 4px solid #6366f1; }\n.card__badge {\n  justify-self: start;\n  margin: 1rem 1rem 0;\n  padding: 0.15rem 0.6rem;\n  border-radius: 999px;\n  background: #1e293b;\n  color: #f8fafc;\n  font-size: 0.75rem;\n}\n.card:has(> .card__media) > .card__badge { position: absolute; inset: 0.75rem auto auto 0.75rem; margin: 0; }\n.card:has(> .card__actions) { grid-template-rows: 1fr auto; }\n.card:has(> .card__media):has(> .card__actions) { grid-template-rows: auto 1fr auto; }\n.card__actions { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--demo-border); }\n.card__actions a { color: var(--demo-accent); }",1789717747975]