[{"data":1,"prerenderedAt":3333},["ShallowReactive",2],{"page-\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has":3,"content-all-pages":2769,"live-demo:has-plan-picker":3327},{"id":4,"title":5,"body":6,"description":2744,"extension":2745,"meta":2746,"navigation":789,"path":2765,"seo":2766,"stem":2767,"__hash__":2768},"content\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Findex.md","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"type":7,"value":8,"toc":2718},"minimark",[9,19,45,51,88,91,96,128,157,275,283,286,343,360,364,383,402,406,419,494,512,514,518,639,657,659,663,669,675,873,876,880,952,956,1080,1084,1140,1144,1197,1203,1205,1209,1212,1216,1621,2129,2140,2142,2149,2154,2171,2184,2204,2222,2224,2228,2248,2271,2283,2292,2294,2298,2362,2364,2368,2467,2473,2475,2479,2574,2576,2580,2592,2604,2624,2644,2656,2660,2714],[10,11,13,14,18],"h1",{"id":12},"parent-aware-layouts-with-has-letting-containers-react-to-their-contents","Parent-Aware Layouts With ",[15,16,17],"code",{},":has()",": Letting Containers React to Their Contents",[20,21,22,23,25,26,31,32,34,35,39,40,44],"p",{},"For most of CSS's history, styling flowed one way: an element could be styled by its ancestors, its own classes and its earlier siblings, but never by anything inside it or after it. Layouts that depended on content — a card that needs a different grid when it has an image, a list that should switch to columns when it grows long, a form group that should highlight when its input is invalid — needed JavaScript or a template to translate content into classes. ",[15,24,17],{}," removed that restriction. This guide, part of ",[27,28,30],"a",{"href":29},"\u002Fmastering-container-queries-responsive-layouts\u002F","Mastering Container Queries & Responsive Layouts",", treats ",[15,33,17],{}," specifically as a ",[36,37,38],"em",{},"layout"," tool: how its matching works, which patterns it unlocks, how it interacts with the cascade and ",[27,41,43],{"href":42},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002F","container queries",", and what to watch for in production.",[20,46,47],{},[48,49,50],"strong",{},"Prerequisites — this guide assumes you can already:",[52,53,54,70,73,81],"ul",{},[55,56,57,58,61,62,65,66,69],"li",{},"Read compound and complex selectors, including the child (",[15,59,60],{},">","), next-sibling (",[15,63,64],{},"+",") and subsequent-sibling (",[15,67,68],{},"~",") combinators.",[55,71,72],{},"Calculate selector specificity as an (ID, class, type) triple.",[55,74,75,76,80],{},"Build a basic grid or flex layout (see ",[27,77,79],{"href":78},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002F","CSS Grid & Subgrid Layouts",").",[55,82,83,84,87],{},"Use ",[15,85,86],{},"@supports"," for progressive enhancement.",[89,90],"hr",{},[92,93,95],"h2",{"id":94},"the-core-concept-a-relational-pseudo-class","The Core Concept: A Relational Pseudo-Class",[20,97,98,99,101,102,105,106,109,110,113,114,117,118,113,121,124,125,127],{},"The Selectors Level 4 specification defines ",[15,100,17],{}," as a ",[36,103,104],{},"relational pseudo-class",": it takes a list of relative selectors and represents an element if any of those selectors, when anchored at that element, matches at least one element. \"Anchored\" is the key word. The relative selector ",[15,107,108],{},"> img"," anchored at a ",[15,111,112],{},".card"," means \"an ",[15,115,116],{},"img"," that is a child of this card\". The relative selector ",[15,119,120],{},"+ .error",[15,122,123],{},".error"," that is this element's next sibling\". The relative selector with no leading combinator, such as ",[15,126,116],{},", is treated as a descendant relation.",[20,129,130,131,134,135,138,139,141,142,145,146,145,149,152,153,156],{},"What makes this significant for layout is which element is the ",[36,132,133],{},"subject",". In ",[15,136,137],{},".card:has(> img)",", the declarations apply to ",[15,140,112],{},", not to the image. For the first time, a rule can change a container's ",[15,143,144],{},"display",", ",[15,147,148],{},"grid-template-*",[15,150,151],{},"flex-direction"," or ",[15,154,155],{},"gap"," based on facts about its children.",[158,159,164,165,164,169,164,173,164,181,164,191,164,196,164,207,164,212,164,216,164,220,164,228,164,232,164,239,164,244,164,248,164,252,164,257,164,259,164,266,164,271],"svg",{"viewBox":160,"role":116,"ariaLabel":161,"xmlns":162,"style":163},"0 0 720 340","Four relative selector shapes anchored at the same element: descendant, child, next sibling and subsequent sibling","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[166,167,168],"title",{},"What a :has() argument can reach",[170,171,172],"desc",{},"An anchor element in the centre. Descendant form reaches any element inside it, child form reaches only direct children, next-sibling form reaches the immediately following sibling, and subsequent-sibling form reaches any later sibling.",[174,175,180],"text",{"textAnchor":176,"x":177,"y":178,"style":179},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","Four directions from one anchor",[182,183],"rect",{"x":184,"y":185,"width":186,"height":187,"rx":188,"fill":189,"opacity":190},"250","50","220","176","12","#7aa2ff","0.16",[174,192,195],{"textAnchor":176,"x":177,"y":193,"style":194},"74","text-anchor:middle;fill:currentColor;font:700 13px ui-monospace,monospace","anchor",[182,197],{"x":198,"y":199,"width":200,"height":201,"rx":202,"fill":203,"stroke":204,"strokeWidth":205,"opacity":206},"270","88","180","40","6","none","currentColor","1.5","0.6",[174,208,211],{"textAnchor":176,"x":177,"y":209,"style":210},"113","text-anchor:middle;fill:currentColor;font:12px ui-monospace,monospace",":has(> x) child",[182,213],{"x":198,"y":214,"width":200,"height":215,"rx":202,"fill":203,"stroke":204,"strokeWidth":205,"opacity":206},"138","76",[174,217,219],{"textAnchor":176,"x":177,"y":218,"style":210},"160","wrapper",[182,221],{"x":222,"y":223,"width":224,"height":225,"rx":226,"fill":189,"opacity":227},"290","172","140","32","5","0.3",[174,229,231],{"textAnchor":176,"x":177,"y":230,"style":210},"193",":has(x) deep",[182,233],{"x":234,"y":235,"width":236,"height":237,"rx":238,"fill":189,"opacity":227},"490","84","200","44","8",[174,240,243],{"textAnchor":176,"x":241,"y":242,"style":210},"590","111",":has(+ x) next",[182,245],{"x":234,"y":246,"width":236,"height":237,"rx":238,"fill":189,"opacity":247},"150","0.18",[174,249,251],{"textAnchor":176,"x":241,"y":250,"style":210},"177",":has(~ x) later",[253,254],"line",{"x1":255,"y1":256,"x2":234,"y2":256,"stroke":204,"strokeWidth":205,"opacity":206},"470","106",[253,258],{"x1":255,"y1":223,"x2":234,"y2":223,"stroke":204,"strokeWidth":205,"opacity":206},[182,260],{"x":261,"y":184,"width":262,"height":263,"rx":264,"fill":203,"stroke":204,"strokeWidth":205,"opacity":265},"30","660","66","10","0.5",[174,267,270],{"textAnchor":176,"x":177,"y":268,"style":269},"276","text-anchor:middle;fill:currentColor;font:13px sans-serif","In every case the anchor is the element that gets styled.",[174,272,274],{"textAnchor":176,"x":177,"y":273,"style":269},"298","The argument is only a condition evaluated from it.",[276,277,279,280,282],"h3",{"id":278},"layout-questions-has-can-now-answer","Layout questions ",[15,281,17],{}," can now answer",[20,284,285],{},"Grouping the practical uses by the question they answer makes the feature easier to reach for at the right moment:",[52,287,288,309,321,333],{},[55,289,290,293,294,145,297,299,300,308],{},[48,291,292],{},"How many children are there?"," Combined with ",[15,295,296],{},":nth-child()",[15,298,17],{}," becomes a quantity query that changes a container's layout at a child count — covered in ",[27,301,303,304,307],{"href":302},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fquantity-queries-with-has\u002F","Quantity Queries With ",[305,306],"has",{},"()",".",[55,310,311,314,315,308],{},[48,312,313],{},"Which kinds of children are there?"," A card can add a media row only when it has media and a footer row only when it has actions — covered in ",[27,316,318,319,307],{"href":317},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fcontent-aware-card-layouts-with-has\u002F","Content-Aware Card Layouts With ",[305,320],{},[55,322,323,326,327,308],{},[48,324,325],{},"What state are the controls in?"," A form group can react to a checked, invalid or focused input — covered in ",[27,328,330,331,307],{"href":329},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fform-validation-layouts-with-has\u002F","Form Validation Layouts With ",[305,332],{},[55,334,335,338,339,342],{},[48,336,337],{},"What comes next?"," A heading followed immediately by a subtitle can tighten its bottom margin with ",[15,340,341],{},"h2:has(+ .subtitle)",", the long-requested \"previous sibling\" selector.",[20,344,345,346,352,353,359],{},"The two remaining guides in this section deal with the costs and alternatives: ",[27,347,349,351],{"href":348},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fhas-selector-performance\u002F",[305,350],{},"() Selector Performance"," explains invalidation and what keeps it cheap, and ",[27,354,356,358],{"href":355},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fhas-vs-container-style-queries\u002F",[305,357],{},"() vs Container Style Queries"," compares discovered state with published state.",[276,361,363],{"id":362},"what-it-replaced","What it replaced",[20,365,366,367,370,371,374,375,378,379,382],{},"It helps to remember what each of these patterns used to cost, because many codebases still carry the old versions. Content-dependent card layouts were modifier classes computed in the template. Quantity queries existed only in the item-styling form, ",[15,368,369],{},"li:nth-last-child(n+4) ~ li",", which could never touch the list. Form-group state was a ",[15,372,373],{},"focusin","\u002F",[15,376,377],{},"input"," listener copying validity onto a class. And \"style the element before this one\" was simply impossible: designers were told to restructure the markup so the thing that needed styling came ",[36,380,381],{},"after"," the thing it depended on.",[20,384,385,386,388,389,145,392,145,395,152,398,401],{},"Each workaround moved layout knowledge out of the stylesheet — into templates, scripts or markup order — and each could fall out of sync with the content it described. The consistent benefit of ",[15,387,17],{}," is that it moves that knowledge back, next to the rules that use it, and makes it impossible to go stale. When auditing an older codebase, searching for class names containing ",[15,390,391],{},"--has-",[15,393,394],{},"--with-",[15,396,397],{},"--no-",[15,399,400],{},"--count-"," is a quick way to find candidates.",[276,403,405],{"id":404},"specificity-the-trap-in-the-argument","Specificity: the trap in the argument",[20,407,408,410,411,414,415,418],{},[15,409,17],{}," behaves like ",[15,412,413],{},":is()"," and ",[15,416,417],{},":not()"," for specificity: it contributes the weight of its most specific argument and nothing of its own. That is usually harmless, but it makes the weight of a rule depend on something that reads like a condition rather than a target, which surprises people.",[158,420,164,423,164,426,164,429,164,432,164,437,164,442,164,445,164,450,164,453,164,457,164,460,164,463,164,465,164,469,164,472,164,476,164,479,164,483,164,486,164,489],{"viewBox":421,"role":116,"ariaLabel":422,"xmlns":162,"style":163},"0 0 720 300","Specificity triples for four selectors: a plain class, has with a class, has with an ID, and has wrapped in where",[166,424,425],{},"How :has() arguments change a rule's weight",[170,427,428],{},".card is 0,1,0. .card:has(.media) is 0,2,0. .card:has(#promo) is 1,1,0 and outranks both. :where(.card:has(#promo)) is 0,0,0.",[174,430,431],{"textAnchor":176,"x":177,"y":178,"style":179},"The argument sets the weight",[182,433],{"x":201,"y":434,"width":435,"height":237,"rx":238,"fill":203,"stroke":204,"strokeWidth":205,"opacity":436},"48","400","0.55",[174,438,112],{"textAnchor":439,"x":440,"y":215,"style":441},"start","60","text-anchor:start;fill:currentColor;font:13px ui-monospace,monospace",[182,443],{"x":255,"y":434,"width":444,"height":237,"rx":238,"fill":189,"opacity":190},"210",[174,446,449],{"textAnchor":176,"x":447,"y":215,"style":448},"575","text-anchor:middle;fill:currentColor;font:13px ui-monospace,monospace","(0, 1, 0)",[182,451],{"x":201,"y":452,"width":435,"height":237,"rx":238,"fill":203,"stroke":204,"strokeWidth":205,"opacity":436},"104",[174,454,456],{"textAnchor":439,"x":440,"y":455,"style":441},"132",".card:has(.media)",[182,458],{"x":255,"y":452,"width":444,"height":237,"rx":238,"fill":189,"opacity":459},"0.24",[174,461,462],{"textAnchor":176,"x":447,"y":455,"style":448},"(0, 2, 0)",[182,464],{"x":201,"y":218,"width":435,"height":237,"rx":238,"fill":203,"stroke":204,"strokeWidth":205,"opacity":436},[174,466,468],{"textAnchor":439,"x":440,"y":467,"style":441},"188",".card:has(#promo)",[182,470],{"x":255,"y":218,"width":444,"height":237,"rx":238,"fill":189,"opacity":471},"0.45",[174,473,475],{"textAnchor":176,"x":447,"y":467,"style":474},"text-anchor:middle;fill:currentColor;font:600 13px ui-monospace,monospace","(1, 1, 0) wins",[182,477],{"x":201,"y":478,"width":435,"height":237,"rx":238,"fill":203,"stroke":204,"strokeWidth":205,"opacity":436},"216",[174,480,482],{"textAnchor":439,"x":440,"y":481,"style":441},"244",":where(.card:has(#promo))",[182,484],{"x":255,"y":478,"width":444,"height":237,"rx":238,"fill":189,"opacity":485},"0.1",[174,487,488],{"textAnchor":176,"x":447,"y":481,"style":448},"(0, 0, 0)",[174,490,493],{"textAnchor":176,"x":177,"y":491,"style":492},"288","text-anchor:middle;fill:currentColor;font:12px sans-serif;opacity:0.75","An ID inside the argument outranks any number of classes on the subject.",[20,495,496,497,499,500,502,503,506,507,511],{},"Two habits keep this under control. Prefer classes and attributes inside ",[15,498,17],{}," arguments, never IDs, so the weight stays in the same band as the rest of a component's rules. And when a ",[15,501,17],{}," rule is meant to be a low-priority default that anything can override, wrap it in ",[15,504,505],{},":where()",", which zeroes the specificity entirely. ",[27,508,510],{"href":509},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks\u002F","Cascade layers"," are the structural alternative: place enhancement rules in a layer and their precedence is decided by layer order rather than by what happens to be inside the parentheses.",[89,513],{},[92,515,517],{"id":516},"syntax-and-parameters","Syntax and Parameters",[519,520,521,537],"table",{},[522,523,524],"thead",{},[525,526,527,531,534],"tr",{},[528,529,530],"th",{},"Token",[528,532,533],{},"Accepted values",[528,535,536],{},"Default \u002F notes",[538,539,540,554,571,588,602,613,626],"tbody",{},[525,541,542,548,551],{},[543,544,545],"td",{},[15,546,547],{},":has( \u003Crelative-selector-list> )",[543,549,550],{},"One or more relative selectors, comma-separated",[543,552,553],{},"No default; an empty argument is invalid",[525,555,556,559,568],{},[543,557,558],{},"Leading combinator",[543,560,561,562,145,564,145,566],{},"none (descendant), ",[15,563,60],{},[15,565,64],{},[15,567,68],{},[543,569,570],{},"Omitted means descendant",[525,572,573,576,582],{},[543,574,575],{},"Argument contents",[543,577,578,579,581],{},"Any selector except ",[15,580,17],{}," itself and pseudo-elements",[543,583,584,585,587],{},"Nesting ",[15,586,17],{}," is disallowed",[525,589,590,593,596],{},[543,591,592],{},"Forgiving parsing",[543,594,595],{},"Not forgiving: one invalid selector invalidates the list",[543,597,598,599,601],{},"Wrap uncertain parts in ",[15,600,413],{}," to make them forgiving",[525,603,604,607,610],{},[543,605,606],{},"Specificity",[543,608,609],{},"That of the most specific argument",[543,611,612],{},"The pseudo-class adds nothing itself",[525,614,615,618,623],{},[543,616,617],{},"Negation",[543,619,620],{},[15,621,622],{},":not(:has(...))",[543,624,625],{},"Standard way to express absence",[525,627,628,631,636],{},[543,629,630],{},"Composition",[543,632,633],{},[15,634,635],{},":has(a):has(b)",[543,637,638],{},"Both conditions must hold",[20,640,641,642,645,646,649,650,653,654,656],{},"The forgiving-parsing row matters in practice. ",[15,643,644],{},":has(:user-invalid, :invalid)"," in an engine that does not recognise ",[15,647,648],{},":user-invalid"," invalidates the entire selector, not just that branch. Writing ",[15,651,652],{},":has(:is(:user-invalid, :invalid))"," uses ",[15,655,413],{},"'s forgiving list, so the unknown branch is ignored and the known one still works.",[89,658],{},[92,660,662],{"id":661},"step-by-step-implementation-a-settings-panel-that-reacts-to-its-contents","Step-by-Step Implementation: A Settings Panel That Reacts to Its Contents",[20,664,665,666,668],{},"The steps below build one panel that uses each direction of ",[15,667,17],{}," in turn.",[276,670,672,673],{"id":671},"step-1-a-baseline-layout-without-has","Step 1: a baseline layout without ",[15,674,17],{},[676,677,682],"pre",{"className":678,"code":679,"language":680,"meta":681,"style":681},"language-css shiki shiki-themes github-light-high-contrast github-dark-high-contrast",".settings {\n  display: grid;\n  gap: 1rem;\n  padding: 1.25rem;\n  border: 1px solid #cbd5e1;\n  border-radius: 12px;\n}\n\n.settings__row {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  justify-content: space-between;\n  gap: 0.5rem 1rem;\n}\n","css","",[15,683,684,696,711,728,743,764,778,784,791,799,811,824,837,850,868],{"__ignoreMap":681},[685,686,688,692],"span",{"class":253,"line":687},1,[685,689,691],{"class":690},"s-5SL",".settings",[685,693,695],{"class":694},"suds8"," {\n",[685,697,699,702,705,708],{"class":253,"line":698},2,[685,700,701],{"class":690},"  display",[685,703,704],{"class":694},": ",[685,706,707],{"class":690},"grid",[685,709,710],{"class":694},";\n",[685,712,714,717,719,722,726],{"class":253,"line":713},3,[685,715,716],{"class":690},"  gap",[685,718,704],{"class":694},[685,720,721],{"class":690},"1",[685,723,725],{"class":724},"sHUrx","rem",[685,727,710],{"class":694},[685,729,731,734,736,739,741],{"class":253,"line":730},4,[685,732,733],{"class":690},"  padding",[685,735,704],{"class":694},[685,737,738],{"class":690},"1.25",[685,740,725],{"class":724},[685,742,710],{"class":694},[685,744,746,749,751,753,756,759,762],{"class":253,"line":745},5,[685,747,748],{"class":690},"  border",[685,750,704],{"class":694},[685,752,721],{"class":690},[685,754,755],{"class":724},"px",[685,757,758],{"class":690}," solid",[685,760,761],{"class":690}," #cbd5e1",[685,763,710],{"class":694},[685,765,767,770,772,774,776],{"class":253,"line":766},6,[685,768,769],{"class":690},"  border-radius",[685,771,704],{"class":694},[685,773,188],{"class":690},[685,775,755],{"class":724},[685,777,710],{"class":694},[685,779,781],{"class":253,"line":780},7,[685,782,783],{"class":694},"}\n",[685,785,787],{"class":253,"line":786},8,[685,788,790],{"emptyLinePlaceholder":789},true,"\n",[685,792,794,797],{"class":253,"line":793},9,[685,795,796],{"class":690},".settings__row",[685,798,695],{"class":694},[685,800,802,804,806,809],{"class":253,"line":801},10,[685,803,701],{"class":690},[685,805,704],{"class":694},[685,807,808],{"class":690},"flex",[685,810,710],{"class":694},[685,812,814,817,819,822],{"class":253,"line":813},11,[685,815,816],{"class":690},"  flex-wrap",[685,818,704],{"class":694},[685,820,821],{"class":690},"wrap",[685,823,710],{"class":694},[685,825,827,830,832,835],{"class":253,"line":826},12,[685,828,829],{"class":690},"  align-items",[685,831,704],{"class":694},[685,833,834],{"class":690},"center",[685,836,710],{"class":694},[685,838,840,843,845,848],{"class":253,"line":839},13,[685,841,842],{"class":690},"  justify-content",[685,844,704],{"class":694},[685,846,847],{"class":690},"space-between",[685,849,710],{"class":694},[685,851,853,855,857,859,861,864,866],{"class":253,"line":852},14,[685,854,716],{"class":690},[685,856,704],{"class":694},[685,858,265],{"class":690},[685,860,725],{"class":724},[685,862,863],{"class":690}," 1",[685,865,725],{"class":724},[685,867,710],{"class":694},[685,869,871],{"class":253,"line":870},15,[685,872,783],{"class":694},[20,874,875],{},"This baseline is complete: every browser renders a usable panel from it. Everything that follows is an enhancement layered on top.",[276,877,879],{"id":878},"step-2-react-to-how-many-rows-exist","Step 2: react to how many rows exist",[676,881,883],{"className":678,"code":882,"language":680,"meta":681,"style":681},"\u002F* Five or more rows: split into two columns when there is room. *\u002F\n.settings:has(> .settings__row:nth-child(5)) {\n  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));\n}\n",[15,884,885,891,911,948],{"__ignoreMap":681},[685,886,887],{"class":253,"line":687},[685,888,890],{"class":889},"sLBg1","\u002F* Five or more rows: split into two columns when there is room. *\u002F\n",[685,892,893,896,899,901,904,906,908],{"class":253,"line":698},[685,894,895],{"class":690},".settings:has",[685,897,898],{"class":694},"(",[685,900,60],{"class":724},[685,902,903],{"class":690}," .settings__row:nth-child",[685,905,898],{"class":694},[685,907,226],{"class":690},[685,909,910],{"class":694},")) {\n",[685,912,913,916,918,921,923,926,928,931,933,936,938,940,942,945],{"class":253,"line":713},[685,914,915],{"class":690},"  grid-template-columns",[685,917,704],{"class":694},[685,919,920],{"class":690},"repeat",[685,922,898],{"class":694},[685,924,925],{"class":690},"auto-fit",[685,927,145],{"class":694},[685,929,930],{"class":690},"minmax",[685,932,898],{"class":694},[685,934,935],{"class":690},"16",[685,937,725],{"class":724},[685,939,145],{"class":694},[685,941,721],{"class":690},[685,943,944],{"class":724},"fr",[685,946,947],{"class":694},"));\n",[685,949,950],{"class":253,"line":730},[685,951,783],{"class":694},[276,953,955],{"id":954},"step-3-react-to-control-state","Step 3: react to control state",[676,957,959],{"className":678,"code":958,"language":680,"meta":681,"style":681},"\u002F* A row whose toggle is off is visually de-emphasised. *\u002F\n.settings__row:has(input[type=\"checkbox\"]:not(:checked)) .settings__label {\n  color: #64748b;\n}\n\n\u002F* When the master switch is off, the whole panel dims its other rows. *\u002F\n.settings:has(#master-switch:not(:checked)) > .settings__row:not(:has(#master-switch)) {\n  opacity: 0.5;\n}\n",[15,960,961,966,1008,1020,1024,1028,1033,1065,1076],{"__ignoreMap":681},[685,962,963],{"class":253,"line":687},[685,964,965],{"class":889},"\u002F* A row whose toggle is off is visually de-emphasised. *\u002F\n",[685,967,968,971,973,976,979,982,985,989,992,995,997,1000,1003,1006],{"class":253,"line":698},[685,969,970],{"class":690},".settings__row:has",[685,972,898],{"class":694},[685,974,377],{"class":975},"sne4z",[685,977,978],{"class":694},"[",[685,980,981],{"class":690},"type",[685,983,984],{"class":724},"=",[685,986,988],{"class":987},"sT6z2","\"checkbox\"",[685,990,991],{"class":694},"]",[685,993,994],{"class":690},":not",[685,996,898],{"class":694},[685,998,999],{"class":690},":checked",[685,1001,1002],{"class":694},")) ",[685,1004,1005],{"class":690},".settings__label",[685,1007,695],{"class":694},[685,1009,1010,1013,1015,1018],{"class":253,"line":713},[685,1011,1012],{"class":690},"  color",[685,1014,704],{"class":694},[685,1016,1017],{"class":690},"#64748b",[685,1019,710],{"class":694},[685,1021,1022],{"class":253,"line":730},[685,1023,783],{"class":694},[685,1025,1026],{"class":253,"line":745},[685,1027,790],{"emptyLinePlaceholder":789},[685,1029,1030],{"class":253,"line":766},[685,1031,1032],{"class":889},"\u002F* When the master switch is off, the whole panel dims its other rows. *\u002F\n",[685,1034,1035,1037,1039,1042,1044,1046,1048,1050,1053,1055,1058,1060,1063],{"class":253,"line":780},[685,1036,895],{"class":690},[685,1038,898],{"class":694},[685,1040,1041],{"class":690},"#master-switch:not",[685,1043,898],{"class":694},[685,1045,999],{"class":690},[685,1047,1002],{"class":694},[685,1049,60],{"class":724},[685,1051,1052],{"class":690}," .settings__row:not",[685,1054,898],{"class":694},[685,1056,1057],{"class":690},":has",[685,1059,898],{"class":694},[685,1061,1062],{"class":690},"#master-switch",[685,1064,910],{"class":694},[685,1066,1067,1070,1072,1074],{"class":253,"line":786},[685,1068,1069],{"class":690},"  opacity",[685,1071,704],{"class":694},[685,1073,265],{"class":690},[685,1075,710],{"class":694},[685,1077,1078],{"class":253,"line":793},[685,1079,783],{"class":694},[276,1081,1083],{"id":1082},"step-4-react-to-what-follows","Step 4: react to what follows",[676,1085,1087],{"className":678,"code":1086,"language":680,"meta":681,"style":681},"\u002F* A row immediately followed by a help paragraph loses its bottom\n   border so the two read as one unit. *\u002F\n.settings__row:has(+ .settings__help) {\n  border-bottom: 0;\n  padding-bottom: 0;\n}\n",[15,1088,1089,1094,1099,1113,1125,1136],{"__ignoreMap":681},[685,1090,1091],{"class":253,"line":687},[685,1092,1093],{"class":889},"\u002F* A row immediately followed by a help paragraph loses its bottom\n",[685,1095,1096],{"class":253,"line":698},[685,1097,1098],{"class":889},"   border so the two read as one unit. *\u002F\n",[685,1100,1101,1103,1105,1107,1110],{"class":253,"line":713},[685,1102,970],{"class":690},[685,1104,898],{"class":694},[685,1106,64],{"class":724},[685,1108,1109],{"class":690}," .settings__help",[685,1111,1112],{"class":694},") {\n",[685,1114,1115,1118,1120,1123],{"class":253,"line":730},[685,1116,1117],{"class":690},"  border-bottom",[685,1119,704],{"class":694},[685,1121,1122],{"class":690},"0",[685,1124,710],{"class":694},[685,1126,1127,1130,1132,1134],{"class":253,"line":745},[685,1128,1129],{"class":690},"  padding-bottom",[685,1131,704],{"class":694},[685,1133,1122],{"class":690},[685,1135,710],{"class":694},[685,1137,1138],{"class":253,"line":766},[685,1139,783],{"class":694},[276,1141,1143],{"id":1142},"step-5-guard-the-enhancements","Step 5: guard the enhancements",[676,1145,1147],{"className":678,"code":1146,"language":680,"meta":681,"style":681},"@supports not selector(:has(*)) {\n  \u002F* Engines without :has(): keep the help paragraph visually attached\n     with a negative margin instead of the border change above. *\u002F\n  .settings__help { margin-top: -0.5rem; }\n}\n",[15,1148,1149,1162,1167,1172,1193],{"__ignoreMap":681},[685,1150,1151,1153,1156,1159],{"class":253,"line":687},[685,1152,86],{"class":724},[685,1154,1155],{"class":724}," not",[685,1157,1158],{"class":690}," selector",[685,1160,1161],{"class":694},"(:has(*)) {\n",[685,1163,1164],{"class":253,"line":698},[685,1165,1166],{"class":889},"  \u002F* Engines without :has(): keep the help paragraph visually attached\n",[685,1168,1169],{"class":253,"line":713},[685,1170,1171],{"class":889},"     with a negative margin instead of the border change above. *\u002F\n",[685,1173,1174,1177,1180,1183,1185,1188,1190],{"class":253,"line":730},[685,1175,1176],{"class":690},"  .settings__help",[685,1178,1179],{"class":694}," { ",[685,1181,1182],{"class":690},"margin-top",[685,1184,704],{"class":694},[685,1186,1187],{"class":690},"-0.5",[685,1189,725],{"class":724},[685,1191,1192],{"class":694},"; }\n",[685,1194,1195],{"class":253,"line":745},[685,1196,783],{"class":694},[20,1198,1199,1200,1202],{},"Each step's rule is independent, so a problem in one — say, a mistaken ID in step 3 — does not affect the others. That independence is what makes ",[15,1201,17],{}," enhancements safe to add incrementally to an existing component.",[89,1204],{},[92,1206,1208],{"id":1207},"annotated-production-example-a-pricing-plan-picker","Annotated Production Example: A Pricing Plan Picker",[20,1210,1211],{},"The component below is a set of radio-button cards. Every visual reaction — the selected card's emphasis, the summary text, the call-to-action label — is driven by which radio is checked, with no script.",[1213,1214],"live-demo",{"name":1215},"has-plan-picker",[676,1217,1221],{"className":1218,"code":1219,"language":1220,"meta":681,"style":681},"language-html shiki shiki-themes github-light-high-contrast github-dark-high-contrast","\u003Cform class=\"plans\">\n  \u003Cfieldset class=\"plans__options\">\n    \u003Clegend>Choose a plan\u003C\u002Flegend>\n    \u003Clabel class=\"plan\">\n      \u003Cinput type=\"radio\" name=\"plan\" value=\"starter\" checked>\n      \u003Cspan class=\"plan__name\">Starter\u003C\u002Fspan>\n      \u003Cspan class=\"plan__price\">$9\u002Fmo\u003C\u002Fspan>\n    \u003C\u002Flabel>\n    \u003Clabel class=\"plan\">\n      \u003Cinput type=\"radio\" name=\"plan\" value=\"team\">\n      \u003Cspan class=\"plan__name\">Team\u003C\u002Fspan>\n      \u003Cspan class=\"plan__price\">$29\u002Fmo\u003C\u002Fspan>\n    \u003C\u002Flabel>\n    \u003Clabel class=\"plan\">\n      \u003Cinput type=\"radio\" name=\"plan\" value=\"scale\">\n      \u003Cspan class=\"plan__name\">Scale\u003C\u002Fspan>\n      \u003Cspan class=\"plan__price\">$99\u002Fmo\u003C\u002Fspan>\n    \u003C\u002Flabel>\n  \u003C\u002Ffieldset>\n  \u003Cp class=\"plans__summary\">\u003C\u002Fp>\n  \u003Cbutton class=\"plans__cta\" type=\"submit\">Continue\u003C\u002Fbutton>\n\u003C\u002Fform>\n","html",[15,1222,1223,1242,1259,1274,1290,1325,1345,1365,1374,1388,1415,1434,1453,1461,1475,1502,1522,1542,1551,1561,1582,1611],{"__ignoreMap":681},[685,1224,1225,1228,1231,1234,1236,1239],{"class":253,"line":687},[685,1226,1227],{"class":694},"\u003C",[685,1229,1230],{"class":975},"form",[685,1232,1233],{"class":690}," class",[685,1235,984],{"class":694},[685,1237,1238],{"class":987},"\"plans\"",[685,1240,1241],{"class":694},">\n",[685,1243,1244,1247,1250,1252,1254,1257],{"class":253,"line":698},[685,1245,1246],{"class":694},"  \u003C",[685,1248,1249],{"class":975},"fieldset",[685,1251,1233],{"class":690},[685,1253,984],{"class":694},[685,1255,1256],{"class":987},"\"plans__options\"",[685,1258,1241],{"class":694},[685,1260,1261,1264,1267,1270,1272],{"class":253,"line":713},[685,1262,1263],{"class":694},"    \u003C",[685,1265,1266],{"class":975},"legend",[685,1268,1269],{"class":694},">Choose a plan\u003C\u002F",[685,1271,1266],{"class":975},[685,1273,1241],{"class":694},[685,1275,1276,1278,1281,1283,1285,1288],{"class":253,"line":730},[685,1277,1263],{"class":694},[685,1279,1280],{"class":975},"label",[685,1282,1233],{"class":690},[685,1284,984],{"class":694},[685,1286,1287],{"class":987},"\"plan\"",[685,1289,1241],{"class":694},[685,1291,1292,1295,1297,1300,1302,1305,1308,1310,1312,1315,1317,1320,1323],{"class":253,"line":745},[685,1293,1294],{"class":694},"      \u003C",[685,1296,377],{"class":975},[685,1298,1299],{"class":690}," type",[685,1301,984],{"class":694},[685,1303,1304],{"class":987},"\"radio\"",[685,1306,1307],{"class":690}," name",[685,1309,984],{"class":694},[685,1311,1287],{"class":987},[685,1313,1314],{"class":690}," value",[685,1316,984],{"class":694},[685,1318,1319],{"class":987},"\"starter\"",[685,1321,1322],{"class":690}," checked",[685,1324,1241],{"class":694},[685,1326,1327,1329,1331,1333,1335,1338,1341,1343],{"class":253,"line":766},[685,1328,1294],{"class":694},[685,1330,685],{"class":975},[685,1332,1233],{"class":690},[685,1334,984],{"class":694},[685,1336,1337],{"class":987},"\"plan__name\"",[685,1339,1340],{"class":694},">Starter\u003C\u002F",[685,1342,685],{"class":975},[685,1344,1241],{"class":694},[685,1346,1347,1349,1351,1353,1355,1358,1361,1363],{"class":253,"line":780},[685,1348,1294],{"class":694},[685,1350,685],{"class":975},[685,1352,1233],{"class":690},[685,1354,984],{"class":694},[685,1356,1357],{"class":987},"\"plan__price\"",[685,1359,1360],{"class":694},">$9\u002Fmo\u003C\u002F",[685,1362,685],{"class":975},[685,1364,1241],{"class":694},[685,1366,1367,1370,1372],{"class":253,"line":786},[685,1368,1369],{"class":694},"    \u003C\u002F",[685,1371,1280],{"class":975},[685,1373,1241],{"class":694},[685,1375,1376,1378,1380,1382,1384,1386],{"class":253,"line":793},[685,1377,1263],{"class":694},[685,1379,1280],{"class":975},[685,1381,1233],{"class":690},[685,1383,984],{"class":694},[685,1385,1287],{"class":987},[685,1387,1241],{"class":694},[685,1389,1390,1392,1394,1396,1398,1400,1402,1404,1406,1408,1410,1413],{"class":253,"line":801},[685,1391,1294],{"class":694},[685,1393,377],{"class":975},[685,1395,1299],{"class":690},[685,1397,984],{"class":694},[685,1399,1304],{"class":987},[685,1401,1307],{"class":690},[685,1403,984],{"class":694},[685,1405,1287],{"class":987},[685,1407,1314],{"class":690},[685,1409,984],{"class":694},[685,1411,1412],{"class":987},"\"team\"",[685,1414,1241],{"class":694},[685,1416,1417,1419,1421,1423,1425,1427,1430,1432],{"class":253,"line":813},[685,1418,1294],{"class":694},[685,1420,685],{"class":975},[685,1422,1233],{"class":690},[685,1424,984],{"class":694},[685,1426,1337],{"class":987},[685,1428,1429],{"class":694},">Team\u003C\u002F",[685,1431,685],{"class":975},[685,1433,1241],{"class":694},[685,1435,1436,1438,1440,1442,1444,1446,1449,1451],{"class":253,"line":826},[685,1437,1294],{"class":694},[685,1439,685],{"class":975},[685,1441,1233],{"class":690},[685,1443,984],{"class":694},[685,1445,1357],{"class":987},[685,1447,1448],{"class":694},">$29\u002Fmo\u003C\u002F",[685,1450,685],{"class":975},[685,1452,1241],{"class":694},[685,1454,1455,1457,1459],{"class":253,"line":839},[685,1456,1369],{"class":694},[685,1458,1280],{"class":975},[685,1460,1241],{"class":694},[685,1462,1463,1465,1467,1469,1471,1473],{"class":253,"line":852},[685,1464,1263],{"class":694},[685,1466,1280],{"class":975},[685,1468,1233],{"class":690},[685,1470,984],{"class":694},[685,1472,1287],{"class":987},[685,1474,1241],{"class":694},[685,1476,1477,1479,1481,1483,1485,1487,1489,1491,1493,1495,1497,1500],{"class":253,"line":870},[685,1478,1294],{"class":694},[685,1480,377],{"class":975},[685,1482,1299],{"class":690},[685,1484,984],{"class":694},[685,1486,1304],{"class":987},[685,1488,1307],{"class":690},[685,1490,984],{"class":694},[685,1492,1287],{"class":987},[685,1494,1314],{"class":690},[685,1496,984],{"class":694},[685,1498,1499],{"class":987},"\"scale\"",[685,1501,1241],{"class":694},[685,1503,1505,1507,1509,1511,1513,1515,1518,1520],{"class":253,"line":1504},16,[685,1506,1294],{"class":694},[685,1508,685],{"class":975},[685,1510,1233],{"class":690},[685,1512,984],{"class":694},[685,1514,1337],{"class":987},[685,1516,1517],{"class":694},">Scale\u003C\u002F",[685,1519,685],{"class":975},[685,1521,1241],{"class":694},[685,1523,1525,1527,1529,1531,1533,1535,1538,1540],{"class":253,"line":1524},17,[685,1526,1294],{"class":694},[685,1528,685],{"class":975},[685,1530,1233],{"class":690},[685,1532,984],{"class":694},[685,1534,1357],{"class":987},[685,1536,1537],{"class":694},">$99\u002Fmo\u003C\u002F",[685,1539,685],{"class":975},[685,1541,1241],{"class":694},[685,1543,1545,1547,1549],{"class":253,"line":1544},18,[685,1546,1369],{"class":694},[685,1548,1280],{"class":975},[685,1550,1241],{"class":694},[685,1552,1554,1557,1559],{"class":253,"line":1553},19,[685,1555,1556],{"class":694},"  \u003C\u002F",[685,1558,1249],{"class":975},[685,1560,1241],{"class":694},[685,1562,1564,1566,1568,1570,1572,1575,1578,1580],{"class":253,"line":1563},20,[685,1565,1246],{"class":694},[685,1567,20],{"class":975},[685,1569,1233],{"class":690},[685,1571,984],{"class":694},[685,1573,1574],{"class":987},"\"plans__summary\"",[685,1576,1577],{"class":694},">\u003C\u002F",[685,1579,20],{"class":975},[685,1581,1241],{"class":694},[685,1583,1585,1587,1590,1592,1594,1597,1599,1601,1604,1607,1609],{"class":253,"line":1584},21,[685,1586,1246],{"class":694},[685,1588,1589],{"class":975},"button",[685,1591,1233],{"class":690},[685,1593,984],{"class":694},[685,1595,1596],{"class":987},"\"plans__cta\"",[685,1598,1299],{"class":690},[685,1600,984],{"class":694},[685,1602,1603],{"class":987},"\"submit\"",[685,1605,1606],{"class":694},">Continue\u003C\u002F",[685,1608,1589],{"class":975},[685,1610,1241],{"class":694},[685,1612,1614,1617,1619],{"class":253,"line":1613},22,[685,1615,1616],{"class":694},"\u003C\u002F",[685,1618,1230],{"class":975},[685,1620,1241],{"class":694},[676,1622,1624],{"className":678,"code":1623,"language":680,"meta":681,"style":681},".plans__options {\n  display: grid;\n  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));\n  gap: 0.75rem;\n  margin: 0;\n  padding: 0;\n  border: 0;\n}\n\n.plan {\n  display: grid;\n  gap: 0.25rem;\n  padding: 1rem;\n  border: 2px solid #cbd5e1;\n  border-radius: 12px;\n  cursor: pointer;\n  transition: border-color 0.15s ease, transform 0.15s ease;\n}\n\n\u002F* The card is the subject; the checked radio inside it is the condition. *\u002F\n.plan:has(input:checked) {\n  border-color: #4f46e5;\n  transform: translateY(-2px);\n}\n\n\u002F* Keyboard focus lands on the visually small radio; surface it on the card. *\u002F\n.plan:has(input:focus-visible) {\n  outline: 2px solid #4f46e5;\n  outline-offset: 3px;\n}\n\n\u002F* The form reads the same state to write a summary and relabel the CTA. *\u002F\n.plans__summary::before { content: \"Starter: for one person.\"; }\n.plans:has(input[value=\"team\"]:checked) .plans__summary::before { content: \"Team: up to 10 seats.\"; }\n.plans:has(input[value=\"scale\"]:checked) .plans__summary::before { content: \"Scale: unlimited seats and SSO.\"; }\n\n@media (prefers-reduced-motion: reduce) {\n  .plan { transition: none; }\n  .plan:has(input:checked) { transform: none; }\n}\n",[15,1625,1626,1633,1643,1674,1687,1698,1708,1718,1722,1726,1733,1743,1756,1768,1785,1797,1809,1837,1841,1845,1850,1863,1875,1896,1901,1906,1912,1926,1945,1960,1965,1970,1976,1994,2033,2069,2074,2083,2100,2124],{"__ignoreMap":681},[685,1627,1628,1631],{"class":253,"line":687},[685,1629,1630],{"class":690},".plans__options",[685,1632,695],{"class":694},[685,1634,1635,1637,1639,1641],{"class":253,"line":698},[685,1636,701],{"class":690},[685,1638,704],{"class":694},[685,1640,707],{"class":690},[685,1642,710],{"class":694},[685,1644,1645,1647,1649,1651,1653,1655,1657,1659,1661,1664,1666,1668,1670,1672],{"class":253,"line":713},[685,1646,915],{"class":690},[685,1648,704],{"class":694},[685,1650,920],{"class":690},[685,1652,898],{"class":694},[685,1654,925],{"class":690},[685,1656,145],{"class":694},[685,1658,930],{"class":690},[685,1660,898],{"class":694},[685,1662,1663],{"class":690},"9",[685,1665,725],{"class":724},[685,1667,145],{"class":694},[685,1669,721],{"class":690},[685,1671,944],{"class":724},[685,1673,947],{"class":694},[685,1675,1676,1678,1680,1683,1685],{"class":253,"line":730},[685,1677,716],{"class":690},[685,1679,704],{"class":694},[685,1681,1682],{"class":690},"0.75",[685,1684,725],{"class":724},[685,1686,710],{"class":694},[685,1688,1689,1692,1694,1696],{"class":253,"line":745},[685,1690,1691],{"class":690},"  margin",[685,1693,704],{"class":694},[685,1695,1122],{"class":690},[685,1697,710],{"class":694},[685,1699,1700,1702,1704,1706],{"class":253,"line":766},[685,1701,733],{"class":690},[685,1703,704],{"class":694},[685,1705,1122],{"class":690},[685,1707,710],{"class":694},[685,1709,1710,1712,1714,1716],{"class":253,"line":780},[685,1711,748],{"class":690},[685,1713,704],{"class":694},[685,1715,1122],{"class":690},[685,1717,710],{"class":694},[685,1719,1720],{"class":253,"line":786},[685,1721,783],{"class":694},[685,1723,1724],{"class":253,"line":793},[685,1725,790],{"emptyLinePlaceholder":789},[685,1727,1728,1731],{"class":253,"line":801},[685,1729,1730],{"class":690},".plan",[685,1732,695],{"class":694},[685,1734,1735,1737,1739,1741],{"class":253,"line":813},[685,1736,701],{"class":690},[685,1738,704],{"class":694},[685,1740,707],{"class":690},[685,1742,710],{"class":694},[685,1744,1745,1747,1749,1752,1754],{"class":253,"line":826},[685,1746,716],{"class":690},[685,1748,704],{"class":694},[685,1750,1751],{"class":690},"0.25",[685,1753,725],{"class":724},[685,1755,710],{"class":694},[685,1757,1758,1760,1762,1764,1766],{"class":253,"line":839},[685,1759,733],{"class":690},[685,1761,704],{"class":694},[685,1763,721],{"class":690},[685,1765,725],{"class":724},[685,1767,710],{"class":694},[685,1769,1770,1772,1774,1777,1779,1781,1783],{"class":253,"line":852},[685,1771,748],{"class":690},[685,1773,704],{"class":694},[685,1775,1776],{"class":690},"2",[685,1778,755],{"class":724},[685,1780,758],{"class":690},[685,1782,761],{"class":690},[685,1784,710],{"class":694},[685,1786,1787,1789,1791,1793,1795],{"class":253,"line":870},[685,1788,769],{"class":690},[685,1790,704],{"class":694},[685,1792,188],{"class":690},[685,1794,755],{"class":724},[685,1796,710],{"class":694},[685,1798,1799,1802,1804,1807],{"class":253,"line":1504},[685,1800,1801],{"class":690},"  cursor",[685,1803,704],{"class":694},[685,1805,1806],{"class":690},"pointer",[685,1808,710],{"class":694},[685,1810,1811,1814,1817,1820,1823,1826,1829,1831,1833,1835],{"class":253,"line":1524},[685,1812,1813],{"class":690},"  transition",[685,1815,1816],{"class":694},": border-color ",[685,1818,1819],{"class":690},"0.15",[685,1821,1822],{"class":724},"s",[685,1824,1825],{"class":690}," ease",[685,1827,1828],{"class":694},", transform ",[685,1830,1819],{"class":690},[685,1832,1822],{"class":724},[685,1834,1825],{"class":690},[685,1836,710],{"class":694},[685,1838,1839],{"class":253,"line":1544},[685,1840,783],{"class":694},[685,1842,1843],{"class":253,"line":1553},[685,1844,790],{"emptyLinePlaceholder":789},[685,1846,1847],{"class":253,"line":1563},[685,1848,1849],{"class":889},"\u002F* The card is the subject; the checked radio inside it is the condition. *\u002F\n",[685,1851,1852,1855,1857,1859,1861],{"class":253,"line":1584},[685,1853,1854],{"class":690},".plan:has",[685,1856,898],{"class":694},[685,1858,377],{"class":975},[685,1860,999],{"class":690},[685,1862,1112],{"class":694},[685,1864,1865,1868,1870,1873],{"class":253,"line":1613},[685,1866,1867],{"class":690},"  border-color",[685,1869,704],{"class":694},[685,1871,1872],{"class":690},"#4f46e5",[685,1874,710],{"class":694},[685,1876,1878,1881,1883,1886,1888,1891,1893],{"class":253,"line":1877},23,[685,1879,1880],{"class":690},"  transform",[685,1882,704],{"class":694},[685,1884,1885],{"class":690},"translateY",[685,1887,898],{"class":694},[685,1889,1890],{"class":690},"-2",[685,1892,755],{"class":724},[685,1894,1895],{"class":694},");\n",[685,1897,1899],{"class":253,"line":1898},24,[685,1900,783],{"class":694},[685,1902,1904],{"class":253,"line":1903},25,[685,1905,790],{"emptyLinePlaceholder":789},[685,1907,1909],{"class":253,"line":1908},26,[685,1910,1911],{"class":889},"\u002F* Keyboard focus lands on the visually small radio; surface it on the card. *\u002F\n",[685,1913,1915,1917,1919,1921,1924],{"class":253,"line":1914},27,[685,1916,1854],{"class":690},[685,1918,898],{"class":694},[685,1920,377],{"class":975},[685,1922,1923],{"class":690},":focus-visible",[685,1925,1112],{"class":694},[685,1927,1929,1932,1934,1936,1938,1940,1943],{"class":253,"line":1928},28,[685,1930,1931],{"class":690},"  outline",[685,1933,704],{"class":694},[685,1935,1776],{"class":690},[685,1937,755],{"class":724},[685,1939,758],{"class":690},[685,1941,1942],{"class":690}," #4f46e5",[685,1944,710],{"class":694},[685,1946,1948,1951,1953,1956,1958],{"class":253,"line":1947},29,[685,1949,1950],{"class":690},"  outline-offset",[685,1952,704],{"class":694},[685,1954,1955],{"class":690},"3",[685,1957,755],{"class":724},[685,1959,710],{"class":694},[685,1961,1963],{"class":253,"line":1962},30,[685,1964,783],{"class":694},[685,1966,1968],{"class":253,"line":1967},31,[685,1969,790],{"emptyLinePlaceholder":789},[685,1971,1973],{"class":253,"line":1972},32,[685,1974,1975],{"class":889},"\u002F* The form reads the same state to write a summary and relabel the CTA. *\u002F\n",[685,1977,1979,1982,1984,1987,1989,1992],{"class":253,"line":1978},33,[685,1980,1981],{"class":690},".plans__summary::before",[685,1983,1179],{"class":694},[685,1985,1986],{"class":690},"content",[685,1988,704],{"class":694},[685,1990,1991],{"class":987},"\"Starter: for one person.\"",[685,1993,1192],{"class":694},[685,1995,1997,2000,2002,2004,2006,2009,2011,2013,2015,2017,2020,2022,2024,2026,2028,2031],{"class":253,"line":1996},34,[685,1998,1999],{"class":690},".plans:has",[685,2001,898],{"class":694},[685,2003,377],{"class":975},[685,2005,978],{"class":694},[685,2007,2008],{"class":690},"value",[685,2010,984],{"class":724},[685,2012,1412],{"class":987},[685,2014,991],{"class":694},[685,2016,999],{"class":690},[685,2018,2019],{"class":694},") ",[685,2021,1981],{"class":690},[685,2023,1179],{"class":694},[685,2025,1986],{"class":690},[685,2027,704],{"class":694},[685,2029,2030],{"class":987},"\"Team: up to 10 seats.\"",[685,2032,1192],{"class":694},[685,2034,2036,2038,2040,2042,2044,2046,2048,2050,2052,2054,2056,2058,2060,2062,2064,2067],{"class":253,"line":2035},35,[685,2037,1999],{"class":690},[685,2039,898],{"class":694},[685,2041,377],{"class":975},[685,2043,978],{"class":694},[685,2045,2008],{"class":690},[685,2047,984],{"class":724},[685,2049,1499],{"class":987},[685,2051,991],{"class":694},[685,2053,999],{"class":690},[685,2055,2019],{"class":694},[685,2057,1981],{"class":690},[685,2059,1179],{"class":694},[685,2061,1986],{"class":690},[685,2063,704],{"class":694},[685,2065,2066],{"class":987},"\"Scale: unlimited seats and SSO.\"",[685,2068,1192],{"class":694},[685,2070,2072],{"class":253,"line":2071},36,[685,2073,790],{"emptyLinePlaceholder":789},[685,2075,2077,2080],{"class":253,"line":2076},37,[685,2078,2079],{"class":724},"@media",[685,2081,2082],{"class":694}," (prefers-reduced-motion: reduce) {\n",[685,2084,2086,2089,2091,2094,2096,2098],{"class":253,"line":2085},38,[685,2087,2088],{"class":690},"  .plan",[685,2090,1179],{"class":694},[685,2092,2093],{"class":690},"transition",[685,2095,704],{"class":694},[685,2097,203],{"class":690},[685,2099,1192],{"class":694},[685,2101,2103,2106,2108,2110,2112,2115,2118,2120,2122],{"class":253,"line":2102},39,[685,2104,2105],{"class":690},"  .plan:has",[685,2107,898],{"class":694},[685,2109,377],{"class":975},[685,2111,999],{"class":690},[685,2113,2114],{"class":694},") { ",[685,2116,2117],{"class":690},"transform",[685,2119,704],{"class":694},[685,2121,203],{"class":690},[685,2123,1192],{"class":694},[685,2125,2127],{"class":253,"line":2126},40,[685,2128,783],{"class":694},[20,2130,2131,2132,2135,2136,308],{},"The radios remain real, visible form controls, so keyboard users move between plans with the arrow keys and screen readers announce \"Team, radio button, 2 of 3\". The summary uses generated content for brevity here; in production, put the plan descriptions in the DOM and show one at a time, because generated text is not dependably announced. The focus rule is the one most often missed: when the interactive element is small and the card is large, move the focus indicator to the card with ",[15,2133,2134],{},":has(:focus-visible)"," so it is actually visible — the reasoning is covered in ",[27,2137,2139],{"href":2138},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fcreating-accessible-focus-indicators\u002F","Creating Accessible Focus Indicators",[89,2141],{},[92,2143,2145,2146,2148],{"id":2144},"integrating-has-with-container-queries-and-layers","Integrating ",[15,2147,17],{}," With Container Queries and Layers",[20,2150,2151,2153],{},[15,2152,17],{}," works inside every other modern layout feature, and the combinations are where it earns its keep in a design system.",[20,2155,2156,2163,2164,2166,2167,2170],{},[48,2157,2158,2159,2162],{},"Inside ",[15,2160,2161],{},"@container"," blocks."," A container query decides that there is room; a ",[15,2165,17],{}," rule inside it decides whether there is anything worth using the room for. ",[15,2168,2169],{},"@container (width > 32rem) { .card:has(> .card__media) { grid-template-columns: 2fr 3fr; } }"," gives a side-by-side layout only to wide cards that actually have media, while wide text-only cards keep their single column. Neither feature can express that alone.",[20,2172,2173,2176,2177,2179,2180,2183],{},[48,2174,2175],{},"As a container's own condition."," An element can be both a size container and a ",[15,2178,17],{}," subject. The container type is unaffected by what matches; only the declarations change. This means a component can switch its ",[15,2181,2182],{},"container-type"," on or off by content — for example, only establishing an inline-size container when it holds a nested grid that needs to query it — though in practice leaving containment on is simpler and cheaper to reason about.",[20,2185,2186,2189,2190,2193,2194,2196,2197,2200,2201,2203],{},[48,2187,2188],{},"Inside cascade layers."," Treat content-aware rules as a distinct layer of concerns. A typical order is ",[15,2191,2192],{},"reset, tokens, base, components, component-states",", with ",[15,2195,17],{}," rules in ",[15,2198,2199],{},"component-states",". Because layer order beats specificity, a heavy ",[15,2202,17],{}," selector in an earlier layer can never unexpectedly override a light class selector in a later one.",[20,2205,2206,2211,2212,2215,2216,2218,2219,2221],{},[48,2207,2208,2209,308],{},"With ",[15,2210,86],{}," Test for the capability with ",[15,2213,2214],{},"@supports selector(:has(*))",". The asterisk is deliberate — some engines reject an empty ",[15,2217,17],{}," argument even in a support test — and the result is a clean branch for fallbacks that should apply only when ",[15,2220,17],{}," is missing.",[89,2223],{},[92,2225,2227],{"id":2226},"performance-and-accessibility-notes","Performance and Accessibility Notes",[20,2229,2230,2233,2234,2236,2237,2240,2241,2244,2245,2247],{},[48,2231,2232],{},"Invalidation cost."," ",[15,2235,17],{}," is paid when its argument's state changes. Narrow anchors and stable arguments are essentially free; broad anchors such as ",[15,2238,2239],{},"body"," combined with volatile arguments such as ",[15,2242,2243],{},":hover"," can force wide style recalculation on every pointer move. Keep hover- and focus-driven ",[15,2246,17],{}," rules anchored on the nearest component.",[20,2249,2250,2253,2254,2256,2257,2260,2261,414,2263,2266,2267,308],{},[48,2251,2252],{},"Motion."," Layout changes triggered by ",[15,2255,17],{}," happen instantly unless animated. When they are animated — a card lifting on selection, a panel expanding — gate the motion behind ",[15,2258,2259],{},"prefers-reduced-motion",", as in the example, and prefer ",[15,2262,2117],{},[15,2264,2265],{},"opacity"," over properties that re-run layout. The motion-specific guidance is in ",[27,2268,2270],{"href":2269},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Freducing-motion-preferences-in-css\u002F","Reducing Motion Preferences in CSS",[20,2272,2273,2233,2276,2278,2279,2282],{},[48,2274,2275],{},"Semantics stay put.",[15,2277,17],{}," never changes the DOM, focus order or accessibility tree; it changes presentation only. That makes it safe, but it also means it cannot fix semantics. A \"disabled-looking\" button styled via ",[15,2280,2281],{},":has(:invalid)"," is still enabled for assistive technology.",[20,2284,2285,2288,2289,2291],{},[48,2286,2287],{},"Colour is not state."," If a ",[15,2290,17],{}," rule signals state only through colour — a red border for an invalid field group — add a non-colour cue such as text or an icon, per WCAG 1.4.1.",[89,2293],{},[92,2295,2297],{"id":2296},"devtools-debugging-workflow","DevTools Debugging Workflow",[2299,2300,2301,2310,2335,2344,2353],"ol",{},[55,2302,2303,2306,2307,2309],{},[48,2304,2305],{},"Confirm the subject."," Select the element you expect to be styled. In the Styles pane, a matching ",[15,2308,17],{}," rule appears like any other rule. If it is absent, the selector did not match this element.",[55,2311,2312,2315,2316,2319,2320,145,2322,145,2325,152,2327,2330,2331,2334],{},[48,2313,2314],{},"Force state."," Use the ",[15,2317,2318],{},":hov"," toggle in Chrome, Edge and Firefox, or the element state toggles in Safari's Web Inspector, to force ",[15,2321,2243],{},[15,2323,2324],{},":focus",[15,2326,1923],{},[15,2328,2329],{},":active"," on the ",[36,2332,2333],{},"descendant"," named in the argument, then re-select the anchor to see whether the rule appears.",[55,2336,2337,2340,2341,2343],{},[48,2338,2339],{},"Check the combinator."," If the rule matches when it should not, look for a missing ",[15,2342,60],{}," — a descendant argument can match deeply nested components.",[55,2345,2346,2349,2350,2352],{},[48,2347,2348],{},"Check specificity."," Hover the selector in Chromium's Styles pane to see its specificity. A ",[15,2351,17],{}," with an ID or several classes in its argument can outweigh rules you intended to win.",[55,2354,2355,2358,2359,2361],{},[48,2356,2357],{},"Profile if slow."," Record a Performance trace with selector statistics enabled and sort by elapsed time to find expensive ",[15,2360,17],{}," rules.",[89,2363],{},[92,2365,2367],{"id":2366},"browser-compatibility","Browser Compatibility",[519,2369,2370,2386],{},[522,2371,2372],{},[525,2373,2374,2377,2380,2383],{},[528,2375,2376],{},"Feature",[528,2378,2379],{},"Chrome \u002F Edge",[528,2381,2382],{},"Firefox",[528,2384,2385],{},"Safari",[538,2387,2388,2403,2419,2437,2453],{},[525,2389,2390,2394,2397,2400],{},[543,2391,2392],{},[15,2393,17],{},[543,2395,2396],{},"105+",[543,2398,2399],{},"121+",[543,2401,2402],{},"15.4+",[525,2404,2405,2410,2413,2416],{},[543,2406,2407],{},[15,2408,2409],{},"@supports selector()",[543,2411,2412],{},"83+",[543,2414,2415],{},"69+",[543,2417,2418],{},"14.1+",[525,2420,2421,2428,2431,2434],{},[543,2422,2423,2425,2426],{},[15,2424,648],{}," inside ",[15,2427,17],{},[543,2429,2430],{},"119+",[543,2432,2433],{},"88+",[543,2435,2436],{},"16.5+",[525,2438,2439,2445,2448,2451],{},[543,2440,2441,2425,2443],{},[15,2442,1923],{},[15,2444,17],{},[543,2446,2447],{},"86+",[543,2449,2450],{},"85+",[543,2452,2402],{},[525,2454,2455,2458,2461,2464],{},[543,2456,2457],{},"Style queries (the published-state alternative)",[543,2459,2460],{},"111+",[543,2462,2463],{},"151+",[543,2465,2466],{},"18+",[20,2468,2469,2470,2472],{},"Every current engine supports ",[15,2471,17],{},". The remaining risk is older installed versions, which is why the baseline-plus-enhancement structure in the step-by-step section is still worth keeping.",[89,2474],{},[92,2476,2478],{"id":2477},"common-pitfalls","Common Pitfalls",[519,2480,2481,2494],{},[522,2482,2483],{},[525,2484,2485,2488,2491],{},[528,2486,2487],{},"Pitfall",[528,2489,2490],{},"Cause",[528,2492,2493],{},"Resolution",[538,2495,2496,2512,2528,2541,2561],{},[525,2497,2498,2501,2506],{},[543,2499,2500],{},"Outer component reacts to an inner one's content",[543,2502,2503,2504],{},"Descendant argument without ",[15,2505,60],{},[543,2507,83,2508,2511],{},[15,2509,2510],{},":has(> x)"," for direct children",[525,2513,2514,2517,2522],{},[543,2515,2516],{},"Rule unexpectedly wins the cascade",[543,2518,2519,2521],{},[15,2520,17],{}," takes its argument's specificity",[543,2523,2524,2525,2527],{},"Keep arguments to classes; use ",[15,2526,505],{}," to zero weight",[525,2529,2530,2533,2536],{},[543,2531,2532],{},"Whole selector ignored in some browsers",[543,2534,2535],{},"One unknown pseudo-class in a non-forgiving list",[543,2537,2538,2539],{},"Wrap the argument in ",[15,2540,413],{},[525,2542,2543,2546,2556],{},[543,2544,2545],{},"Hidden items still counted",[543,2547,2548,2551,2552,2555],{},[15,2549,2550],{},":nth-child"," counts ",[15,2553,2554],{},"display: none"," elements",[543,2557,83,2558],{},[15,2559,2560],{},":nth-child(n of :not([hidden]))",[525,2562,2563,2566,2571],{},[543,2564,2565],{},"Jank on hover",[543,2567,2568],{},[15,2569,2570],{},"body:has(... :hover)",[543,2572,2573],{},"Anchor on the nearest component instead",[89,2575],{},[92,2577,2579],{"id":2578},"faq","FAQ",[20,2581,2582,2588,2589,2591],{},[48,2583,2584,2585,2587],{},"Is ",[15,2586,17],{}," really a parent selector?","\nIt is more general. ",[15,2590,17],{}," matches an element if the relative selector inside it matches something relative to that element, so it can test descendants, direct children, the next sibling or any later sibling. Selecting a parent by its child is the most common use, not the only one.",[20,2593,2594,2600,2601,2603],{},[48,2595,2596,2597,2599],{},"What specificity does ",[15,2598,17],{}," have?","\nThe pseudo-class itself adds nothing; it takes the specificity of the most specific selector in its argument list. ",[15,2602,468],{}," therefore carries an ID's weight, which can make it win against rules you expected to override it.",[20,2605,2606,2614,2615,2617,2618,2620,2621,2623],{},[48,2607,2608,2609,2425,2611,2613],{},"Can I nest ",[15,2610,17],{},[15,2612,17],{},"?","\nNo. ",[15,2616,17],{}," is not allowed inside another ",[15,2619,17],{}," argument, and pseudo-elements are not allowed in its argument either. Chain two ",[15,2622,17],{}," pseudo-classes on the same element instead, or restructure the condition around a different anchor.",[20,2625,2626,2632,2633,2635,2636,2638,2639,2641,2642,308],{},[48,2627,2628,2629,2631],{},"What happens in a browser without ",[15,2630,17],{}," support?","\nA selector containing ",[15,2634,17],{}," is invalid there, so the whole rule is dropped. Write the default layout without ",[15,2637,17],{}," so it works everywhere, then add ",[15,2640,17],{}," rules as enhancements, optionally inside ",[15,2643,2214],{},[20,2645,2646,2652,2653,2655],{},[48,2647,2648,2649,2651],{},"Should layout depend on ",[15,2650,17],{}," or on a container query?","\nUse ",[15,2654,17],{}," when the layout depends on what a component contains or which state its controls are in. Use a container query when it depends on how much space the component has. Many components need both, and they compose without conflict.",[92,2657,2659],{"id":2658},"related","Related",[52,2661,2662,2669,2676,2683,2690,2697,2704],{},[55,2663,2664,2668],{},[27,2665,303,2666,307],{"href":302},[305,2667],{}," — layouts keyed to a child count.",[55,2670,2671,2675],{},[27,2672,318,2673,307],{"href":317},[305,2674],{}," — replacing modifier classes.",[55,2677,2678,2682],{},[27,2679,330,2680,307],{"href":329},[305,2681],{}," — groups styled from input state.",[55,2684,2685,2689],{},[27,2686,2687,351],{"href":348},[305,2688],{}," — invalidation and profiling.",[55,2691,2692,2696],{},[27,2693,2694,358],{"href":355},[305,2695],{}," — discovered versus published state.",[55,2698,2699,2703],{},[27,2700,2702],{"href":2701},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002F","Style Queries & Container State"," — the sibling section on published state.",[55,2705,2706,2710,2711,2713],{},[27,2707,2709],{"href":2708},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002F","Hover & Focus State Design"," — interaction states that ",[15,2712,17],{}," can lift to a container.",[2715,2716,2717],"style",{},"html pre.shiki code .s-5SL, html code.shiki .s-5SL{--shiki-default:#023B95;--shiki-dark:#91CBFF}html pre.shiki code .suds8, html code.shiki .suds8{--shiki-default:#0E1116;--shiki-dark:#F0F3F6}html pre.shiki code .sHUrx, html code.shiki .sHUrx{--shiki-default:#A0111F;--shiki-dark:#FF9492}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sLBg1, html code.shiki .sLBg1{--shiki-default:#66707B;--shiki-dark:#BDC4CC}html pre.shiki code .sne4z, html code.shiki .sne4z{--shiki-default:#024C1A;--shiki-dark:#72F088}html pre.shiki code .sT6z2, html code.shiki .sT6z2{--shiki-default:#032563;--shiki-dark:#ADDCFF}",{"title":681,"searchDepth":698,"depth":698,"links":2719},[2720,2726,2727,2735,2736,2738,2739,2740,2741,2742,2743],{"id":94,"depth":698,"text":95,"children":2721},[2722,2724,2725],{"id":278,"depth":713,"text":2723},"Layout questions :has() can now answer",{"id":362,"depth":713,"text":363},{"id":404,"depth":713,"text":405},{"id":516,"depth":698,"text":517},{"id":661,"depth":698,"text":662,"children":2728},[2729,2731,2732,2733,2734],{"id":671,"depth":713,"text":2730},"Step 1: a baseline layout without :has()",{"id":878,"depth":713,"text":879},{"id":954,"depth":713,"text":955},{"id":1082,"depth":713,"text":1083},{"id":1142,"depth":713,"text":1143},{"id":1207,"depth":698,"text":1208},{"id":2144,"depth":698,"text":2737},"Integrating :has() With Container Queries and Layers",{"id":2226,"depth":698,"text":2227},{"id":2296,"depth":698,"text":2297},{"id":2366,"depth":698,"text":2367},{"id":2477,"depth":698,"text":2478},{"id":2578,"depth":698,"text":2579},{"id":2658,"depth":698,"text":2659},"Use :has() as a layout tool: containers that respond to their children’s count, content, state and siblings, with specificity rules, fallbacks and performance.","md",{"pageTitle":2747,"datePublished":2748,"dateModified":2748,"faq":2749},"Parent-Aware Layouts With :has()","2026-09-18",[2750,2753,2756,2759,2762],{"q":2751,"a":2752},"Is :has() really a parent selector?","It is more general. :has() matches an element if the relative selector inside it matches something relative to that element, so it can test descendants, direct children, the next sibling or any later sibling. Selecting a parent by its child is the most common use, not the only one.",{"q":2754,"a":2755},"What specificity does :has() have?","The pseudo-class itself adds nothing; it takes the specificity of the most specific selector in its argument list. .card:has(#promo) therefore carries an ID's weight, which can make it win against rules you expected to override it.",{"q":2757,"a":2758},"Can I nest :has() inside :has()?","No. :has() is not allowed inside another :has() argument, and pseudo-elements are not allowed in its argument either. Chain two :has() pseudo-classes on the same element instead, or restructure the condition around a different anchor.",{"q":2760,"a":2761},"What happens in a browser without :has() support?","A selector containing :has() is invalid there, so the whole rule is dropped. Write the default layout without :has() so it works everywhere, then add :has() rules as enhancements, optionally inside @supports selector(:has(*)).",{"q":2763,"a":2764},"Should layout depend on :has() or on a container query?","Use :has() when the layout depends on what a component contains or which state its controls are in. Use a container query when it depends on how much space the component has. Many components need both, and they compose without conflict.","\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has",{"title":5,"description":2744},"mastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Findex","EKj9Pg6hhTKVKRNLKGUUIZJxf_jApC6u1EqqJ2DoZow",[2770,2773,2776,2779,2782,2785,2788,2791,2794,2797,2800,2803,2806,2809,2812,2815,2818,2821,2824,2827,2830,2833,2836,2839,2842,2845,2848,2851,2854,2857,2860,2863,2866,2869,2872,2875,2878,2881,2884,2887,2890,2893,2896,2899,2902,2905,2908,2911,2914,2917,2920,2923,2926,2929,2932,2935,2938,2941,2944,2947,2950,2953,2956,2959,2962,2965,2968,2971,2974,2977,2980,2983,2986,2989,2992,2995,2998,3001,3004,3007,3010,3013,3016,3019,3022,3025,3028,3031,3034,3037,3040,3043,3046,3049,3051,3054,3057,3060,3063,3066,3069,3072,3075,3078,3081,3084,3087,3090,3093,3096,3099,3102,3105,3108,3111,3114,3117,3120,3123,3126,3129,3132,3135,3138,3141,3144,3147,3150,3153,3156,3159,3162,3165,3168,3171,3174,3177,3180,3183,3186,3189,3191,3194,3197,3200,3203,3206,3209,3212,3215,3218,3221,3224,3227,3230,3233,3236,3239,3242,3245,3246,3249,3252,3255,3258,3261,3264,3267,3270,3273,3276,3279,3282,3285,3288,3291,3294,3297,3300,3303,3306,3309,3312,3315,3318,3321,3324],{"path":2771,"title":2772},"\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":2774,"title":2775},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":2777,"title":2778},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":2780,"title":2781},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":2783,"title":2784},"\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":2786,"title":2787},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":2789,"title":2790},"\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":2792,"title":2793},"\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":2795,"title":2796},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":2798,"title":2799},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":2801,"title":2802},"\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":2804,"title":2805},"\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":2807,"title":2808},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":2810,"title":2811},"\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":2813,"title":2814},"\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":2816,"title":2817},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":2819,"title":2820},"\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":2822,"title":2823},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":2825,"title":2826},"\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":2828,"title":2829},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":2831,"title":2832},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":2834,"title":2835},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":2837,"title":2838},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":2840,"title":2841},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":2843,"title":2844},"\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":2846,"title":2847},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":2849,"title":2850},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":2852,"title":2853},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":2855,"title":2856},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":2858,"title":2859},"\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":2861,"title":2862},"\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":2864,"title":2865},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":2867,"title":2868},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":2870,"title":2871},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":2873,"title":2874},"\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":2876,"title":2877},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":2879,"title":2880},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":2882,"title":2883},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":2885,"title":2886},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":2888,"title":2889},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":2891,"title":2892},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":2894,"title":2895},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":2897,"title":2898},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":2900,"title":2901},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":2903,"title":2904},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"path":2906,"title":2907},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":2909,"title":2910},"\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":2912,"title":2913},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":2915,"title":2916},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":2918,"title":2919},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":2921,"title":2922},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":2924,"title":2925},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":2927,"title":2928},"\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":2930,"title":2931},"\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":2933,"title":2934},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":2936,"title":2937},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states","Button Press and  States",{"path":2939,"title":2940},"\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":2942,"title":2943},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":2945,"title":2946},"\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":2948,"title":2949},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":2951,"title":2952},"\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":2954,"title":2955},"\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":2957,"title":2958},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":2960,"title":2961},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking","Stacking Animations With animation-composition",{"path":2963,"title":2964},"\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":2966,"title":2967},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":2969,"title":2970},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":2972,"title":2973},"\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":2975,"title":2976},"\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":2978,"title":2979},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":2981,"title":2982},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":2984,"title":2985},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":2987,"title":2988},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply","Animating box-shadow and Filters Cheaply",{"path":2990,"title":2991},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":2993,"title":2994},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite","Layout, Paint and Composite: What Triggers What",{"path":2996,"title":2997},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":2999,"title":3000},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":3002,"title":3003},"\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":3005,"title":3006},"\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":3008,"title":3009},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":3011,"title":3012},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":3014,"title":3015},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects","Scroll-Driven Parallax Effects in CSS",{"path":3017,"title":3018},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":3020,"title":3021},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":3023,"title":3024},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":3026,"title":3027},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range","View Timelines and animation-range",{"path":3029,"title":3030},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":3032,"title":3033},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":3035,"title":3036},"\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":3038,"title":3039},"\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":3041,"title":3042},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":3044,"title":3045},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":3047,"title":3048},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":374,"title":3050},"Modern CSS Layouts & Micro-Interactions",{"path":3052,"title":3053},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":3055,"title":3056},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":3058,"title":3059},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":3061,"title":3062},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":3064,"title":3065},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":3067,"title":3068},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":3070,"title":3071},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":3073,"title":3074},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":3076,"title":3077},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":3079,"title":3080},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":3082,"title":3083},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":3085,"title":3086},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":3088,"title":3089},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":3091,"title":3092},"\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":3094,"title":3095},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":3097,"title":3098},"\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":3100,"title":3101},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":3103,"title":3104},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":3106,"title":3107},"\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":3109,"title":3110},"\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":3112,"title":3113},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics","Container Query Syntax Basics",{"path":3115,"title":3116},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":3118,"title":3119},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":3121,"title":3122},"\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":3124,"title":3125},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":3127,"title":3128},"\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":3130,"title":3131},"\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":3133,"title":3134},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":3136,"title":3137},"\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":3139,"title":3140},"\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":3142,"title":3143},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":3145,"title":3146},"\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":3148,"title":3149},"\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":3151,"title":3152},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":3154,"title":3155},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":3157,"title":3158},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":3160,"title":3161},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":3163,"title":3164},"\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":3166,"title":3167},"\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":3169,"title":3170},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":3172,"title":3173},"\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":3175,"title":3176},"\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":3178,"title":3179},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":3181,"title":3182},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":3184,"title":3185},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":3187,"title":3188},"\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":3190,"title":30},"\u002Fmastering-container-queries-responsive-layouts",{"path":3192,"title":3193},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":3195,"title":3196},"\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":3198,"title":3199},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":3201,"title":3202},"\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":3204,"title":3205},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":3207,"title":3208},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":3210,"title":3211},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":3213,"title":3214},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":3216,"title":3217},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":3219,"title":3220},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":3222,"title":3223},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":3225,"title":3226},"\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":3228,"title":3229},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset","Writing a Minimal Modern CSS Reset: Every Line Justified",{"path":3231,"title":3232},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fcontent-aware-card-layouts-with-has","Content-Aware Card Layouts With :has(): One Component, Many Shapes",{"path":3234,"title":3235},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has","Empty and Loading States With ()",{"path":3237,"title":3238},"\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":3240,"title":3241},"\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":3243,"title":3244},"\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":2765,"title":5},{"path":3247,"title":3248},"\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":3250,"title":3251},"\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":3253,"title":3254},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":3256,"title":3257},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":3259,"title":3260},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":3262,"title":3263},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":3265,"title":3266},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":3268,"title":3269},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":3271,"title":3272},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":3274,"title":3275},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions","Tabs That Become an Accordion: One Component, Two Layouts",{"path":3277,"title":3278},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":3280,"title":3281},"\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":3283,"title":3284},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":3286,"title":3287},"\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":3289,"title":3290},"\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":3292,"title":3293},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":3295,"title":3296},"\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":3298,"title":3299},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":3301,"title":3302},"\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":3304,"title":3305},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":3307,"title":3308},"\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":3310,"title":3311},"\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":3313,"title":3314},"\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":3316,"title":3317},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":3319,"title":3320},"\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":3322,"title":3323},"\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":3325,"title":3326},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":3328,"caption":3329,"height":3330,"resizable":789,"html":3331,"css":3332},"Plan picker driven by the checked radio","Click a plan or use the arrow keys: the card, the summary line and the focus ring all follow the checked radio.",280,"\n\u003Cform class=\"plans\">\n  \u003Cfieldset class=\"plans__options\">\n    \u003Clegend>Choose a plan\u003C\u002Flegend>\n    \u003Clabel class=\"plan\">\u003Cinput type=\"radio\" name=\"plan\" value=\"starter\" checked>\u003Cspan class=\"plan__name\">Starter\u003C\u002Fspan>\u003Cspan class=\"plan__price\">$9\u002Fmo\u003C\u002Fspan>\u003C\u002Flabel>\n    \u003Clabel class=\"plan\">\u003Cinput type=\"radio\" name=\"plan\" value=\"team\">\u003Cspan class=\"plan__name\">Team\u003C\u002Fspan>\u003Cspan class=\"plan__price\">$29\u002Fmo\u003C\u002Fspan>\u003C\u002Flabel>\n    \u003Clabel class=\"plan\">\u003Cinput type=\"radio\" name=\"plan\" value=\"scale\">\u003Cspan class=\"plan__name\">Scale\u003C\u002Fspan>\u003Cspan class=\"plan__price\">$99\u002Fmo\u003C\u002Fspan>\u003C\u002Flabel>\n  \u003C\u002Ffieldset>\n  \u003Cp class=\"plans__summary\">\u003C\u002Fp>\n  \u003Cbutton class=\"plans__cta\" type=\"submit\">Continue\u003C\u002Fbutton>\n\u003C\u002Fform>","\nbody { display: block; }\n.plans__options {\n  display: grid;\n  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));\n  gap: 0.75rem;\n  margin: 0;\n  padding: 0;\n  border: 0;\n}\n.plans__options legend { margin-bottom: 0.5rem; font-weight: 600; }\n.plan {\n  display: grid;\n  gap: 0.25rem;\n  padding: 1rem;\n  border: 2px solid var(--demo-border);\n  border-radius: 12px;\n  cursor: pointer;\n  transition: border-color 0.15s ease, transform 0.15s ease;\n}\n.plan:has(input:checked) { border-color: var(--demo-accent); transform: translateY(-2px); }\n.plan:has(input:focus-visible) { outline: 2px solid var(--demo-accent); outline-offset: 3px; }\n.plans__summary::before { content: \"Starter: for one person.\"; }\n.plans:has(input[value=\"team\"]:checked) .plans__summary::before { content: \"Team: up to 10 seats.\"; }\n.plans:has(input[value=\"scale\"]:checked) .plans__summary::before { content: \"Scale: unlimited seats and SSO.\"; }\n.plans__cta { font: inherit; padding: 0.45rem 0.9rem; border-radius: 6px; border: 1px solid var(--demo-border); background: var(--demo-surface); color: inherit; }\n@media (prefers-reduced-motion: reduce) {\n  .plan { transition: none; }\n  .plan:has(input:checked) { transform: none; }\n}",1789717745489]