[{"data":1,"prerenderedAt":1889},["ShallowReactive",2],{"page-\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has\u002F":3,"content-all-pages":1324,"live-demo:has-empty-loading":1883},{"id":4,"title":5,"body":6,"description":1303,"extension":1304,"meta":1305,"navigation":280,"path":1320,"seo":1321,"stem":1322,"__hash__":1323},"content\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has\u002Findex.md","Empty and Loading States With ()",{"type":7,"value":8,"toc":1288},"minimark",[9,18,60,65,72,190,194,197,201,424,922,930,934,948,952,970,974,993,997,1012,1088,1103,1111,1127,1134,1165,1169,1188,1192,1203,1217,1230,1246,1250,1284],[10,11,13,14,17],"h1",{"id":12},"empty-and-loading-states-with","Empty and Loading States With ",[15,16],"has",{},"()",[19,20,21,22,26,27,30,31,34,35,38,39,42,43,46,47,54,55,59],"p",{},"Every list, table and search result area has at least three states beyond \"full of content\": loading, empty and failed. They are usually wired up with classes — script adds ",[23,24,25],"code",{},"is-loading",", removes it, adds ",[23,28,29],{},"is-empty"," — and every one of those toggles is a chance for the visual state to drift from the real one. The markup already knows the truth: a list with no ",[23,32,33],{},"\u003Cli>"," is empty, a region with ",[23,36,37],{},"aria-busy=\"true\""," is loading, a form with an invalid field has an error. ",[23,40,41],{},":has()"," lets the container read that truth directly, and ",[23,44,45],{},":empty"," handles the simplest case. This page builds a results panel whose empty, loading and error layouts come from its own content. It belongs to ",[48,49,51,52,17],"a",{"href":50},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002F","Parent-Aware Layouts With ",[15,53],{}," in the ",[48,56,58],{"href":57},"\u002Fmastering-container-queries-responsive-layouts\u002F","Mastering Container Queries & Responsive Layouts"," guide.",[61,62,64],"h2",{"id":63},"deriving-state-from-content","Deriving state from content",[19,66,67,68,71],{},"The idea is to let the DOM that script already produces be the only source of state. Script renders results into a list, sets ",[23,69,70],{},"aria-busy"," while fetching, and inserts an error message on failure — all things it must do anyway for the content and for assistive technology. CSS then chooses the layout from what is present.",[73,74,80,81,80,85,80,89,80,97,80,107,80,112,80,116,80,120,80,126,80,130,80,134,80,138,80,146,80,149,80,153,80,158,80,161,80,166,80,169,80,172,80,177,80,180,80,183,80,186],"svg",{"viewBox":75,"role":76,"ariaLabel":77,"xmlns":78,"style":79},"0 0 720 300","img","Four states of a results panel, each derived from its content: loading when aria-busy is true, empty when the list has no items, error when an alert is present, and populated otherwise","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[82,83,84],"title",{},"The markup is the state",[86,87,88],"desc",{},"Four panels. Loading: the panel has aria-busy true, and skeleton rows are shown. Empty: the list has no li elements, and an empty-state message is shown. Error: the panel contains an element with role alert, and the error layout is shown. Populated: the list has items, and they are shown normally. Each panel lists the selector that detects its state.",[90,91,96],"text",{"textAnchor":92,"x":93,"y":94,"style":95},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","Four states, zero state classes",[98,99],"rect",{"x":100,"y":101,"width":102,"height":103,"rx":104,"fill":105,"opacity":106},"20","50","160","200","10","#7aa2ff","0.15",[98,108],{"x":109,"y":101,"width":102,"height":103,"rx":104,"fill":110,"opacity":111},"195","currentColor","0.08",[98,113],{"x":114,"y":101,"width":102,"height":103,"rx":104,"fill":110,"opacity":115},"370","0.12",[98,117],{"x":118,"y":101,"width":102,"height":103,"rx":104,"fill":105,"opacity":119},"545","0.25",[90,121,125],{"textAnchor":92,"x":122,"y":123,"style":124},"100","78","text-anchor:middle;fill:currentColor;font:600 13px sans-serif","Loading",[90,127,129],{"textAnchor":92,"x":128,"y":123,"style":124},"275","Empty",[90,131,133],{"textAnchor":92,"x":132,"y":123,"style":124},"450","Error",[90,135,137],{"textAnchor":92,"x":136,"y":123,"style":124},"625","Populated",[98,139],{"x":140,"y":141,"width":142,"height":143,"rx":144,"fill":110,"opacity":145},"40","96","120","12","4","0.2",[98,147],{"x":140,"y":148,"width":122,"height":143,"rx":144,"fill":110,"opacity":145},"116",[98,150],{"x":140,"y":151,"width":152,"height":143,"rx":144,"fill":110,"opacity":145},"136","110",[90,154,157],{"textAnchor":92,"x":128,"y":155,"style":156},"130","text-anchor:middle;fill:currentColor;font:12px sans-serif","\"No results\"",[90,159,160],{"textAnchor":92,"x":132,"y":155,"style":156},"\"Could not load\"",[98,162],{"x":163,"y":141,"width":142,"height":164,"rx":144,"fill":105,"opacity":165},"565","14","0.6",[98,167],{"x":163,"y":168,"width":142,"height":164,"rx":144,"fill":105,"opacity":165},"118",[98,170],{"x":163,"y":171,"width":142,"height":164,"rx":144,"fill":105,"opacity":165},"140",[90,173,176],{"textAnchor":92,"x":122,"y":174,"style":175},"206","text-anchor:middle;fill:currentColor;font:10px ui-monospace,monospace","[aria-busy=true]",[90,178,179],{"textAnchor":92,"x":128,"y":174,"style":175},":not(:has(li))",[90,181,182],{"textAnchor":92,"x":132,"y":174,"style":175},":has([role=alert])",[90,184,185],{"textAnchor":92,"x":136,"y":174,"style":175},":has(li)",[90,187,189],{"textAnchor":92,"x":93,"y":188,"style":156},"284","Script renders content and ARIA; CSS reads them.",[61,191,193],{"id":192},"the-complete-implementation","The complete implementation",[19,195,196],{},"The demo renders the same component four times with different content — busy, empty, failed and populated — and the one stylesheet below produces all four layouts. Nothing in the markup names the state; each panel just contains what a real data fetch would leave behind.",[198,199],"live-demo",{"name":200},"has-empty-loading",[202,203,208],"pre",{"className":204,"code":205,"language":206,"meta":207,"style":207},"language-html shiki shiki-themes github-light-high-contrast github-dark-high-contrast","\u003Csection class=\"results\" aria-labelledby=\"results-title\" aria-busy=\"false\">\n  \u003Ch2 id=\"results-title\">Results\u003C\u002Fh2>\n\n  \u003Cul class=\"results__list\">\n    \u003C!-- items rendered here -->\n  \u003C\u002Ful>\n\n  \u003Cp class=\"results__empty\">No results. Try a broader search.\u003C\u002Fp>\n  \u003Cdiv class=\"results__skeleton\" aria-hidden=\"true\">\n    \u003Cspan>\u003C\u002Fspan>\u003Cspan>\u003C\u002Fspan>\u003Cspan>\u003C\u002Fspan>\n  \u003C\u002Fdiv>\n  \u003C!-- On failure, script inserts: \u003Cp role=\"alert\">Could not load results.\u003C\u002Fp> -->\n\u003C\u002Fsection>\n","html","",[23,209,210,253,275,282,299,306,316,321,342,367,399,408,414],{"__ignoreMap":207},[211,212,215,219,223,227,230,234,237,239,242,245,247,250],"span",{"class":213,"line":214},"line",1,[211,216,218],{"class":217},"suds8","\u003C",[211,220,222],{"class":221},"sne4z","section",[211,224,226],{"class":225},"s-5SL"," class",[211,228,229],{"class":217},"=",[211,231,233],{"class":232},"sT6z2","\"results\"",[211,235,236],{"class":225}," aria-labelledby",[211,238,229],{"class":217},[211,240,241],{"class":232},"\"results-title\"",[211,243,244],{"class":225}," aria-busy",[211,246,229],{"class":217},[211,248,249],{"class":232},"\"false\"",[211,251,252],{"class":217},">\n",[211,254,256,259,261,264,266,268,271,273],{"class":213,"line":255},2,[211,257,258],{"class":217},"  \u003C",[211,260,61],{"class":221},[211,262,263],{"class":225}," id",[211,265,229],{"class":217},[211,267,241],{"class":232},[211,269,270],{"class":217},">Results\u003C\u002F",[211,272,61],{"class":221},[211,274,252],{"class":217},[211,276,278],{"class":213,"line":277},3,[211,279,281],{"emptyLinePlaceholder":280},true,"\n",[211,283,285,287,290,292,294,297],{"class":213,"line":284},4,[211,286,258],{"class":217},[211,288,289],{"class":221},"ul",[211,291,226],{"class":225},[211,293,229],{"class":217},[211,295,296],{"class":232},"\"results__list\"",[211,298,252],{"class":217},[211,300,302],{"class":213,"line":301},5,[211,303,305],{"class":304},"sLBg1","    \u003C!-- items rendered here -->\n",[211,307,309,312,314],{"class":213,"line":308},6,[211,310,311],{"class":217},"  \u003C\u002F",[211,313,289],{"class":221},[211,315,252],{"class":217},[211,317,319],{"class":213,"line":318},7,[211,320,281],{"emptyLinePlaceholder":280},[211,322,324,326,328,330,332,335,338,340],{"class":213,"line":323},8,[211,325,258],{"class":217},[211,327,19],{"class":221},[211,329,226],{"class":225},[211,331,229],{"class":217},[211,333,334],{"class":232},"\"results__empty\"",[211,336,337],{"class":217},">No results. Try a broader search.\u003C\u002F",[211,339,19],{"class":221},[211,341,252],{"class":217},[211,343,345,347,350,352,354,357,360,362,365],{"class":213,"line":344},9,[211,346,258],{"class":217},[211,348,349],{"class":221},"div",[211,351,226],{"class":225},[211,353,229],{"class":217},[211,355,356],{"class":232},"\"results__skeleton\"",[211,358,359],{"class":225}," aria-hidden",[211,361,229],{"class":217},[211,363,364],{"class":232},"\"true\"",[211,366,252],{"class":217},[211,368,370,373,375,378,380,383,385,387,389,391,393,395,397],{"class":213,"line":369},10,[211,371,372],{"class":217},"    \u003C",[211,374,211],{"class":221},[211,376,377],{"class":217},">\u003C\u002F",[211,379,211],{"class":221},[211,381,382],{"class":217},">\u003C",[211,384,211],{"class":221},[211,386,377],{"class":217},[211,388,211],{"class":221},[211,390,382],{"class":217},[211,392,211],{"class":221},[211,394,377],{"class":217},[211,396,211],{"class":221},[211,398,252],{"class":217},[211,400,402,404,406],{"class":213,"line":401},11,[211,403,311],{"class":217},[211,405,349],{"class":221},[211,407,252],{"class":217},[211,409,411],{"class":213,"line":410},12,[211,412,413],{"class":304},"  \u003C!-- On failure, script inserts: \u003Cp role=\"alert\">Could not load results.\u003C\u002Fp> -->\n",[211,415,417,420,422],{"class":213,"line":416},13,[211,418,419],{"class":217},"\u003C\u002F",[211,421,222],{"class":221},[211,423,252],{"class":217},[202,425,429],{"className":426,"code":427,"language":428,"meta":207,"style":207},"language-css shiki shiki-themes github-light-high-contrast github-dark-high-contrast","\u002F* Hidden unless their state applies. *\u002F\n.results__empty,\n.results__skeleton { display: none; }\n\n\u002F* Empty: not loading, no items, no error. *\u002F\n.results:not([aria-busy=\"true\"]):not(:has(li, [role=\"alert\"])) .results__empty {\n  display: block;\n}\n\n\u002F* Loading: show skeletons, hide stale content. *\u002F\n.results[aria-busy=\"true\"] .results__skeleton { display: grid; }\n.results[aria-busy=\"true\"] .results__list { display: none; }\n\n\u002F* Error: tint the panel and hide the list. *\u002F\n.results:has([role=\"alert\"]) {\n  border-color: #dc2626;\n  background: #fef2f2;\n}\n.results:has([role=\"alert\"]) .results__list { display: none; }\n\n\u002F* Skeleton shimmer, removed for reduced motion. *\u002F\n.results__skeleton span {\n  display: block;\n  block-size: 1rem;\n  border-radius: 4px;\n  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%) 0 0 \u002F 200% 100%;\n  animation: shimmer 1.4s linear infinite;\n}\n@keyframes shimmer { to { background-position: -200% 0; } }\n@media (prefers-reduced-motion: reduce) {\n  .results__skeleton span { animation: none; }\n}\n","css",[23,430,431,436,444,464,468,473,524,537,542,546,551,581,608,612,618,635,648,661,666,694,699,705,715,726,742,757,829,852,857,889,898,917],{"__ignoreMap":207},[211,432,433],{"class":213,"line":214},[211,434,435],{"class":304},"\u002F* Hidden unless their state applies. *\u002F\n",[211,437,438,441],{"class":213,"line":255},[211,439,440],{"class":225},".results__empty",[211,442,443],{"class":217},",\n",[211,445,446,449,452,455,458,461],{"class":213,"line":277},[211,447,448],{"class":225},".results__skeleton",[211,450,451],{"class":217}," { ",[211,453,454],{"class":225},"display",[211,456,457],{"class":217},": ",[211,459,460],{"class":225},"none",[211,462,463],{"class":217},"; }\n",[211,465,466],{"class":213,"line":284},[211,467,281],{"emptyLinePlaceholder":280},[211,469,470],{"class":213,"line":301},[211,471,472],{"class":304},"\u002F* Empty: not loading, no items, no error. *\u002F\n",[211,474,475,478,481,483,486,488,491,494,497,500,502,505,508,511,513,516,519,521],{"class":213,"line":308},[211,476,477],{"class":225},".results:not",[211,479,480],{"class":217},"([",[211,482,70],{"class":225},[211,484,229],{"class":485},"sHUrx",[211,487,364],{"class":232},[211,489,490],{"class":217},"])",[211,492,493],{"class":225},":not",[211,495,496],{"class":217},"(",[211,498,499],{"class":225},":has",[211,501,496],{"class":217},[211,503,504],{"class":221},"li",[211,506,507],{"class":217},", [",[211,509,510],{"class":225},"role",[211,512,229],{"class":485},[211,514,515],{"class":232},"\"alert\"",[211,517,518],{"class":217},"])) ",[211,520,440],{"class":225},[211,522,523],{"class":217}," {\n",[211,525,526,529,531,534],{"class":213,"line":318},[211,527,528],{"class":225},"  display",[211,530,457],{"class":217},[211,532,533],{"class":225},"block",[211,535,536],{"class":217},";\n",[211,538,539],{"class":213,"line":323},[211,540,541],{"class":217},"}\n",[211,543,544],{"class":213,"line":344},[211,545,281],{"emptyLinePlaceholder":280},[211,547,548],{"class":213,"line":369},[211,549,550],{"class":304},"\u002F* Loading: show skeletons, hide stale content. *\u002F\n",[211,552,553,556,559,561,563,565,568,570,572,574,576,579],{"class":213,"line":401},[211,554,555],{"class":225},".results",[211,557,558],{"class":217},"[",[211,560,70],{"class":225},[211,562,229],{"class":485},[211,564,364],{"class":232},[211,566,567],{"class":217},"] ",[211,569,448],{"class":225},[211,571,451],{"class":217},[211,573,454],{"class":225},[211,575,457],{"class":217},[211,577,578],{"class":225},"grid",[211,580,463],{"class":217},[211,582,583,585,587,589,591,593,595,598,600,602,604,606],{"class":213,"line":410},[211,584,555],{"class":225},[211,586,558],{"class":217},[211,588,70],{"class":225},[211,590,229],{"class":485},[211,592,364],{"class":232},[211,594,567],{"class":217},[211,596,597],{"class":225},".results__list",[211,599,451],{"class":217},[211,601,454],{"class":225},[211,603,457],{"class":217},[211,605,460],{"class":225},[211,607,463],{"class":217},[211,609,610],{"class":213,"line":416},[211,611,281],{"emptyLinePlaceholder":280},[211,613,615],{"class":213,"line":614},14,[211,616,617],{"class":304},"\u002F* Error: tint the panel and hide the list. *\u002F\n",[211,619,621,624,626,628,630,632],{"class":213,"line":620},15,[211,622,623],{"class":225},".results:has",[211,625,480],{"class":217},[211,627,510],{"class":225},[211,629,229],{"class":485},[211,631,515],{"class":232},[211,633,634],{"class":217},"]) {\n",[211,636,638,641,643,646],{"class":213,"line":637},16,[211,639,640],{"class":225},"  border-color",[211,642,457],{"class":217},[211,644,645],{"class":225},"#dc2626",[211,647,536],{"class":217},[211,649,651,654,656,659],{"class":213,"line":650},17,[211,652,653],{"class":225},"  background",[211,655,457],{"class":217},[211,657,658],{"class":225},"#fef2f2",[211,660,536],{"class":217},[211,662,664],{"class":213,"line":663},18,[211,665,541],{"class":217},[211,667,669,671,673,675,677,679,682,684,686,688,690,692],{"class":213,"line":668},19,[211,670,623],{"class":225},[211,672,480],{"class":217},[211,674,510],{"class":225},[211,676,229],{"class":485},[211,678,515],{"class":232},[211,680,681],{"class":217},"]) ",[211,683,597],{"class":225},[211,685,451],{"class":217},[211,687,454],{"class":225},[211,689,457],{"class":217},[211,691,460],{"class":225},[211,693,463],{"class":217},[211,695,697],{"class":213,"line":696},20,[211,698,281],{"emptyLinePlaceholder":280},[211,700,702],{"class":213,"line":701},21,[211,703,704],{"class":304},"\u002F* Skeleton shimmer, removed for reduced motion. *\u002F\n",[211,706,708,710,713],{"class":213,"line":707},22,[211,709,448],{"class":225},[211,711,712],{"class":221}," span",[211,714,523],{"class":217},[211,716,718,720,722,724],{"class":213,"line":717},23,[211,719,528],{"class":225},[211,721,457],{"class":217},[211,723,533],{"class":225},[211,725,536],{"class":217},[211,727,729,732,734,737,740],{"class":213,"line":728},24,[211,730,731],{"class":225},"  block-size",[211,733,457],{"class":217},[211,735,736],{"class":225},"1",[211,738,739],{"class":485},"rem",[211,741,536],{"class":217},[211,743,745,748,750,752,755],{"class":213,"line":744},25,[211,746,747],{"class":225},"  border-radius",[211,749,457],{"class":217},[211,751,144],{"class":225},[211,753,754],{"class":485},"px",[211,756,536],{"class":217},[211,758,760,762,764,767,769,772,775,778,781,784,787,789,792,795,797,799,801,804,806,809,812,815,818,820,822,825,827],{"class":213,"line":759},26,[211,761,653],{"class":225},[211,763,457],{"class":217},[211,765,766],{"class":225},"linear-gradient",[211,768,496],{"class":217},[211,770,771],{"class":225},"90",[211,773,774],{"class":485},"deg",[211,776,777],{"class":217},", ",[211,779,780],{"class":225},"#e2e8f0",[211,782,783],{"class":225}," 25",[211,785,786],{"class":485},"%",[211,788,777],{"class":217},[211,790,791],{"class":225},"#f1f5f9",[211,793,794],{"class":225}," 50",[211,796,786],{"class":485},[211,798,777],{"class":217},[211,800,780],{"class":225},[211,802,803],{"class":225}," 75",[211,805,786],{"class":485},[211,807,808],{"class":217},") ",[211,810,811],{"class":225},"0",[211,813,814],{"class":225}," 0",[211,816,817],{"class":217}," \u002F ",[211,819,103],{"class":225},[211,821,786],{"class":485},[211,823,824],{"class":225}," 100",[211,826,786],{"class":485},[211,828,536],{"class":217},[211,830,832,835,838,841,844,847,850],{"class":213,"line":831},27,[211,833,834],{"class":225},"  animation",[211,836,837],{"class":217},": shimmer ",[211,839,840],{"class":225},"1.4",[211,842,843],{"class":485},"s",[211,845,846],{"class":225}," linear",[211,848,849],{"class":225}," infinite",[211,851,536],{"class":217},[211,853,855],{"class":213,"line":854},28,[211,856,541],{"class":217},[211,858,860,863,867,869,872,874,877,879,882,884,886],{"class":213,"line":859},29,[211,861,862],{"class":485},"@keyframes",[211,864,866],{"class":865},"soyes"," shimmer",[211,868,451],{"class":217},[211,870,871],{"class":225},"to",[211,873,451],{"class":217},[211,875,876],{"class":225},"background-position",[211,878,457],{"class":217},[211,880,881],{"class":225},"-200",[211,883,786],{"class":485},[211,885,814],{"class":225},[211,887,888],{"class":217},"; } }\n",[211,890,892,895],{"class":213,"line":891},30,[211,893,894],{"class":485},"@media",[211,896,897],{"class":217}," (prefers-reduced-motion: reduce) {\n",[211,899,901,904,906,908,911,913,915],{"class":213,"line":900},31,[211,902,903],{"class":225},"  .results__skeleton",[211,905,712],{"class":221},[211,907,451],{"class":217},[211,909,910],{"class":225},"animation",[211,912,457],{"class":217},[211,914,460],{"class":225},[211,916,463],{"class":217},[211,918,920],{"class":213,"line":919},32,[211,921,541],{"class":217},[19,923,924,925,929],{},"The empty-state selector is the one to read carefully. It matches only when the panel is not loading ",[926,927,928],"em",{},"and"," contains neither an item nor an alert. Without the loading check, the \"No results\" message would flash during every fetch, because the list is briefly empty while data is on its way. The order of the checks does not matter to the browser, but writing the loading guard first makes the intent obvious to the next person who edits it.",[61,931,933],{"id":932},"the-state-before-the-first-fetch","The state before the first fetch",[19,935,936,937,940,941,943,944,947],{},"One trap is the moment between page load and the first request. If the server sends the panel with an empty list and ",[23,938,939],{},"aria-busy=\"false\"",", the empty-state message appears immediately — telling the user there are no results before anything has been searched. Two fixes work. Render the panel with ",[23,942,37],{}," in the initial HTML when data will load straight away, so the skeleton shows first. Or, for search pages that wait for user input, keep the list out of the DOM until the first search, and extend the empty selector to require the list: ",[23,945,946],{},".results:has(.results__list):not(:has(li))",". Either way, the markup continues to describe the real state, and the CSS continues to read it.",[61,949,951],{"id":950},"smoothing-state-changes","Smoothing state changes",[19,953,954,955,957,958,961,962,965,966,969],{},"Switching between these layouts is a change of ",[23,956,454],{},", which cannot be transitioned directly. For the content that appears, ",[23,959,960],{},"@starting-style"," gives a gentle entrance: ",[23,963,964],{},".results__list li { transition: opacity 200ms ease-out; } @starting-style { .results__list li { opacity: 0; } }"," fades newly rendered items in, including every item that appears after a fetch. Keep it short, and skip it entirely under ",[23,967,968],{},"prefers-reduced-motion: reduce",". Resist animating the empty-state message or the error layout in: those states should appear promptly and without delay, because they carry information the user is waiting for.",[61,971,973],{"id":972},"beyond-lists-tables-grids-and-slots","Beyond lists: tables, grids and slots",[19,975,976,977,980,981,984,985,988,989,992],{},"The pattern applies to any container whose emptiness is structural. A table can reveal a placeholder row kept in its footer with ",[23,978,979],{},"table:not(:has(tbody tr)) .empty-row { display: table-row; }",". A dashboard grid can collapse a widget whose chart has not rendered with ",[23,982,983],{},".widget:not(:has(svg, canvas))",". A notification tray can hide its header when it contains no notifications. In each case, ask what the DOM looks like in the state you want to style, and write the selector that describes exactly that shape. Keep a comment next to each such selector naming the state it detects — ",[23,986,987],{},"\u002F* empty: loaded, no rows *\u002F"," — because a selector built from negations is easy to misread later. When the same state shape appears in several components, consider a shared utility such as ",[23,990,991],{},".has-empty-state",", applied once to each container, so the logic lives in one rule and every component gets the same behaviour, including the loading guard that keeps the empty message from flashing during a fetch.",[61,994,996],{"id":995},"the-key-technique-prefer-semantic-hooks-to-presentational-ones","The key technique: prefer semantic hooks to presentational ones",[19,998,999,1001,1002,1005,1006,1008,1009,1011],{},[23,1000,70],{}," and ",[23,1003,1004],{},"role=\"alert\""," are not arbitrary. Screen readers use ",[23,1007,70],{}," to hold announcements until a region finishes updating, and they announce ",[23,1010,1004],{}," content immediately. By styling from those attributes, the visual state and the accessible state can never disagree: if the skeleton is showing, assistive technology knows the region is busy; if the error layout is showing, the error was announced.",[73,1013,80,1016,80,1019,80,1022,80,1025,80,1030,80,1033,80,1041,80,1043,80,1045,80,1048,80,1051,80,1053,80,1058,80,1062,80,1066,80,1070,80,1075,80,1078,80,1081,80,1084],{"viewBox":1014,"role":76,"ariaLabel":1015,"xmlns":78,"style":79},"0 0 720 250","One attribute, two consumers: aria-busy is read by assistive technology to delay announcements and by CSS to show skeletons; role alert is announced immediately and triggers the error layout",[82,1017,1018],{},"Shared state for CSS and assistive technology",[86,1020,1021],{},"Two rows. Row one: the attribute aria-busy true feeds two arrows, one to screen reader behaviour, which waits before announcing, and one to CSS, which shows skeletons. Row two: an element with role alert feeds screen reader behaviour, which announces immediately, and CSS, which shows the error layout.",[90,1023,1024],{"textAnchor":92,"x":93,"y":94,"style":95},"One source of truth, two readers",[98,1026],{"x":140,"y":1027,"width":103,"height":101,"rx":1028,"fill":105,"opacity":1029},"60","8","0.3",[98,1031],{"x":140,"y":1032,"width":103,"height":101,"rx":1028,"fill":105,"opacity":1029},"150",[98,1034],{"x":1035,"y":1036,"width":1037,"height":1038,"rx":1039,"fill":460,"stroke":110,"strokeWidth":1040},"330","46","170","36","6","1.5",[98,1042],{"x":1035,"y":771,"width":1037,"height":1038,"rx":1039,"fill":460,"stroke":110,"strokeWidth":1040},[98,1044],{"x":1035,"y":151,"width":1037,"height":1038,"rx":1039,"fill":460,"stroke":110,"strokeWidth":1040},[98,1046],{"x":1035,"y":1047,"width":1037,"height":1038,"rx":1039,"fill":460,"stroke":110,"strokeWidth":1040},"180",[90,1049,37],{"textAnchor":92,"x":171,"y":771,"style":1050},"text-anchor:middle;fill:currentColor;font:12px ui-monospace,monospace",[90,1052,1004],{"textAnchor":92,"x":171,"y":1047,"style":1050},[90,1054,1057],{"textAnchor":92,"x":1055,"y":1056,"style":156},"415","69","screen reader waits",[90,1059,1061],{"textAnchor":92,"x":1055,"y":1060,"style":156},"113","CSS: skeletons",[90,1063,1065],{"textAnchor":92,"x":1055,"y":1064,"style":156},"159","announced at once",[90,1067,1069],{"textAnchor":92,"x":1055,"y":1068,"style":156},"203","CSS: error layout",[213,1071],{"x1":1072,"y1":1073,"x2":1035,"y2":1074,"stroke":110,"strokeWidth":1040,"opacity":165},"240","80","64",[213,1076],{"x1":1072,"y1":771,"x2":1035,"y2":1077,"stroke":110,"strokeWidth":1040,"opacity":165},"108",[213,1079],{"x1":1072,"y1":1037,"x2":1035,"y2":1080,"stroke":110,"strokeWidth":1040,"opacity":165},"154",[213,1082],{"x1":1072,"y1":1047,"x2":1035,"y2":1083,"stroke":110,"strokeWidth":1040,"opacity":165},"198",[90,1085,1087],{"textAnchor":92,"x":1086,"y":155,"style":156},"600","never out of sync",[19,1089,1090,1091,1094,1095,1098,1099,1102],{},"The same principle extends further. A form section can style itself from ",[23,1092,1093],{},":has(:user-invalid)","; a disclosure can style from ",[23,1096,1097],{},"[aria-expanded=\"true\"]","; a table can show a \"select all\" bar from ",[23,1100,1101],{},":has(input:checked)",". Each time, the attribute that assistive technology depends on is also the styling hook.",[61,1104,1106,1107,1110],{"id":1105},"where-fits","Where ",[1108,1109],"empty",{}," fits",[19,1112,1113,1115,1116,1119,1120,1122,1123,1126],{},[23,1114,45],{}," matches an element with no children at all — no elements, no text, no comments aside. It is the lightest way to hide an empty container, for example an error slot that is only sometimes filled: ",[23,1117,1118],{},".error-slot:empty { display: none; }",". Its weakness is whitespace. Templates often leave a newline or spaces between the opening and closing tags, and that whitespace is a text node that stops ",[23,1121,45],{}," from matching. Selectors Level 4 proposes ignoring whitespace-only text, but browsers have not broadly adopted it, so do not rely on it. When the markup comes from a template engine, ",[23,1124,1125],{},":not(:has(*))"," is more robust for \"no child elements\", though it ignores text content entirely. Pick the selector that matches how the content arrives.",[61,1128,1130,1131,1133],{"id":1129},"scoping-for-performance","Scoping ",[15,1132],{},"() for performance",[19,1135,1136,1137,1139,1140,1143,1144,1146,1147,1150,1151,1154,1155,1157,1158,1164],{},"Browsers optimise ",[23,1138,41],{}," well, but the cost depends on how widely a selector has to be re-evaluated when the DOM changes. ",[23,1141,1142],{},".results:has(li)"," is cheap: only mutations inside a ",[23,1145,555],{}," element can affect it. ",[23,1148,1149],{},"body:has(.results li)"," is more expensive, because the browser must consider changes anywhere under ",[23,1152,1153],{},"body",". Anchor ",[23,1156,41],{}," to the component that owns the state, as the implementation does. ",[48,1159,1161,1163],{"href":1160},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fhas-selector-performance\u002F",[15,1162],{},"() Selector Performance"," explains what engines do and which patterns to avoid.",[61,1166,1168],{"id":1167},"browser-support","Browser support",[19,1170,1171,1173,1174,1177,1178,1180,1181,1184,1185,1187],{},[23,1172,41],{}," is supported in Chrome and Edge 105+, Firefox 121+ and Safari 15.4+. ",[23,1175,1176],{},":user-invalid",", mentioned above, is supported in Chrome and Edge 119+, Firefox 88+ and Safari 16.5+. ",[23,1179,45],{}," is supported in every current browser, with the whitespace nuance described above, and ",[23,1182,1183],{},"prefers-reduced-motion"," in Chrome 74+, Edge 79+, Firefox 63+ and Safari 10.1+. In browsers without ",[23,1186,41],{},", the empty and error rules do not apply; keep the error message itself visible by default so failures are never hidden.",[61,1189,1191],{"id":1190},"faq","FAQ",[19,1193,1194,1198,1199,1202],{},[1195,1196,1197],"strong",{},"How do I show an empty-state message when a list has no items?","\nPlace the message next to the list and show it with a selector such as ",[23,1200,1201],{},".results:not(:has(li)) .empty-state",". When items are rendered into the list, the selector stops matching and the message hides, with no class toggling in script.",[19,1204,1205,1211,1213,1214,1216],{},[1195,1206,1207,1208,1210],{},"Why doesn't ",[1108,1209],{}," match my element?",[23,1212,45],{}," only matches elements with no children at all, including text nodes. Whitespace between the tags counts as a text node, and although Selectors Level 4 proposes ignoring whitespace, browsers have not broadly adopted that change, so template whitespace often stops ",[23,1215,45],{}," from matching.",[19,1218,1219,1225,1226,1229],{},[1195,1220,1221,1222,1224],{},"Can ",[15,1223],{},"() react to aria-busy for loading states?","\nYes. A container can style itself with ",[23,1227,1228],{},":has([aria-busy='true'])"," to show skeletons or dim content while a region loads. Using the ARIA attribute ties the visual state to the state assistive technology already announces.",[19,1231,1232,1238,1239,1242,1243,1245],{},[1195,1233,1234,1235,1237],{},"Is ",[15,1236],{},"() fast enough for frequently changing states?","\nFor scoped selectors anchored to a component, yes. Avoid broad selectors like ",[23,1240,1241],{},"body:has(...)"," that must be rechecked on every DOM change anywhere in the page; anchor the ",[23,1244,41],{}," to the nearest container that owns the state.",[61,1247,1249],{"id":1248},"related","Related",[289,1251,1252,1259,1268,1277],{},[504,1253,1254,1258],{},[48,1255,51,1256,17],{"href":50},[15,1257],{}," — the parent guide.",[504,1260,1261,1267],{},[48,1262,1264,1265,17],{"href":1263},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fform-validation-layouts-with-has\u002F","Form Validation Layouts With ",[15,1266],{}," — error states in forms.",[504,1269,1270,1276],{},[48,1271,1273,1274,17],{"href":1272},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fcontent-aware-card-layouts-with-has\u002F","Content-Aware Card Layouts With ",[15,1275],{}," — layout from optional content.",[504,1278,1279,1283],{},[48,1280,1282],{"href":1281},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-loading-spinners-and-skeletons\u002F","CSS-Only Loading Spinners and Skeletons"," — the skeleton animation.",[1285,1286,1287],"style",{},"html pre.shiki code .suds8, html code.shiki .suds8{--shiki-default:#0E1116;--shiki-dark:#F0F3F6}html pre.shiki code .sne4z, html code.shiki .sne4z{--shiki-default:#024C1A;--shiki-dark:#72F088}html pre.shiki code .s-5SL, html code.shiki .s-5SL{--shiki-default:#023B95;--shiki-dark:#91CBFF}html pre.shiki code .sT6z2, html code.shiki .sT6z2{--shiki-default:#032563;--shiki-dark:#ADDCFF}html pre.shiki code .sLBg1, html code.shiki .sLBg1{--shiki-default:#66707B;--shiki-dark:#BDC4CC}html .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 .sHUrx, html code.shiki .sHUrx{--shiki-default:#A0111F;--shiki-dark:#FF9492}html pre.shiki code .soyes, html code.shiki .soyes{--shiki-default:#702C00;--shiki-dark:#FFB757}",{"title":207,"searchDepth":255,"depth":255,"links":1289},[1290,1291,1292,1293,1294,1295,1296,1298,1300,1301,1302],{"id":63,"depth":255,"text":64},{"id":192,"depth":255,"text":193},{"id":932,"depth":255,"text":933},{"id":950,"depth":255,"text":951},{"id":972,"depth":255,"text":973},{"id":995,"depth":255,"text":996},{"id":1105,"depth":255,"text":1297},"Where  fits",{"id":1129,"depth":255,"text":1299},"Scoping () for performance",{"id":1167,"depth":255,"text":1168},{"id":1190,"depth":255,"text":1191},{"id":1248,"depth":255,"text":1249},"Show empty-state messages, loading skeletons and error layouts from the markup’s own state with :has() and :empty, so containers adapt without extra classes.","md",{"pageTitle":1306,"datePublished":1307,"dateModified":1307,"faq":1308},"Empty and Loading States With :has()","2026-09-18",[1309,1311,1314,1317],{"q":1197,"a":1310},"Place the message next to the list and show it with a selector such as .results:not(:has(li)) .empty-state. When items are rendered into the list, the selector stops matching and the message hides, with no class toggling in script.",{"q":1312,"a":1313},"Why doesn't :empty match my element?",":empty only matches elements with no children at all, including text nodes. Whitespace between the tags counts as a text node, and although Selectors Level 4 proposes ignoring whitespace, browsers have not broadly adopted that change, so template whitespace often stops :empty from matching.",{"q":1315,"a":1316},"Can :has() react to aria-busy for loading states?","Yes. A container can style itself with :has([aria-busy='true']) to show skeletons or dim content while a region loads. Using the ARIA attribute ties the visual state to the state assistive technology already announces.",{"q":1318,"a":1319},"Is :has() fast enough for frequently changing states?","For scoped selectors anchored to a component, yes. Avoid broad selectors like body:has(...) that must be rechecked on every DOM change anywhere in the page; anchor the :has() to the nearest container that owns the state.","\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has",{"title":5,"description":1303},"mastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has\u002Findex","kzF9xyfyzUx8qZyOyMEpAOO_eucZztfE_vc6PZZLE_4",[1325,1328,1331,1334,1337,1340,1343,1346,1349,1352,1355,1358,1361,1364,1367,1370,1373,1376,1379,1382,1385,1388,1391,1394,1397,1400,1403,1406,1409,1412,1415,1418,1421,1424,1427,1430,1433,1436,1439,1442,1445,1448,1451,1454,1457,1460,1463,1466,1469,1472,1475,1478,1481,1484,1487,1490,1493,1496,1499,1502,1505,1508,1511,1514,1517,1520,1523,1526,1529,1532,1535,1538,1541,1544,1547,1550,1553,1556,1559,1562,1565,1568,1571,1574,1577,1580,1583,1586,1589,1592,1595,1598,1601,1604,1607,1610,1613,1616,1619,1622,1625,1628,1631,1634,1637,1640,1643,1646,1649,1652,1655,1658,1661,1664,1667,1670,1673,1676,1679,1682,1685,1688,1691,1694,1697,1700,1703,1706,1709,1712,1715,1718,1721,1724,1727,1730,1733,1736,1739,1742,1745,1747,1750,1753,1756,1759,1762,1765,1768,1771,1774,1777,1780,1783,1786,1789,1790,1793,1796,1799,1802,1805,1808,1811,1814,1817,1820,1823,1826,1829,1832,1835,1838,1841,1844,1847,1850,1853,1856,1859,1862,1865,1868,1871,1874,1877,1880],{"path":1326,"title":1327},"\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":1329,"title":1330},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":1332,"title":1333},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":1335,"title":1336},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":1338,"title":1339},"\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":1341,"title":1342},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":1344,"title":1345},"\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":1347,"title":1348},"\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":1350,"title":1351},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":1353,"title":1354},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":1356,"title":1357},"\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":1359,"title":1360},"\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":1362,"title":1363},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":1365,"title":1366},"\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":1368,"title":1369},"\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":1371,"title":1372},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":1374,"title":1375},"\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":1377,"title":1378},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":1380,"title":1381},"\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":1383,"title":1384},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":1386,"title":1387},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":1389,"title":1390},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":1392,"title":1393},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":1395,"title":1396},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":1398,"title":1399},"\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":1401,"title":1402},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":1404,"title":1405},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":1407,"title":1408},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":1410,"title":1411},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":1413,"title":1414},"\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":1416,"title":1417},"\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":1419,"title":1420},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":1422,"title":1423},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":1425,"title":1426},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":1428,"title":1429},"\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":1431,"title":1432},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":1434,"title":1435},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":1437,"title":1438},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":1440,"title":1441},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":1443,"title":1444},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":1446,"title":1447},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":1449,"title":1450},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":1452,"title":1453},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":1455,"title":1456},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":1458,"title":1459},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"path":1461,"title":1462},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":1464,"title":1465},"\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":1467,"title":1468},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":1470,"title":1471},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":1473,"title":1474},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":1476,"title":1477},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":1479,"title":1480},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":1482,"title":1483},"\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":1485,"title":1486},"\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":1488,"title":1489},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":1491,"title":1492},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states","Button Press and  States",{"path":1494,"title":1495},"\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":1497,"title":1498},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":1500,"title":1501},"\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":1503,"title":1504},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":1506,"title":1507},"\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":1509,"title":1510},"\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":1512,"title":1513},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":1515,"title":1516},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking","Stacking Animations With animation-composition",{"path":1518,"title":1519},"\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":1521,"title":1522},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":1524,"title":1525},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":1527,"title":1528},"\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":1530,"title":1531},"\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":1533,"title":1534},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":1536,"title":1537},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":1539,"title":1540},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":1542,"title":1543},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply","Animating box-shadow and Filters Cheaply",{"path":1545,"title":1546},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":1548,"title":1549},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite","Layout, Paint and Composite: What Triggers What",{"path":1551,"title":1552},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":1554,"title":1555},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":1557,"title":1558},"\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":1560,"title":1561},"\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":1563,"title":1564},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":1566,"title":1567},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":1569,"title":1570},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects","Scroll-Driven Parallax Effects in CSS",{"path":1572,"title":1573},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":1575,"title":1576},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":1578,"title":1579},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":1581,"title":1582},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range","View Timelines and animation-range",{"path":1584,"title":1585},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":1587,"title":1588},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":1590,"title":1591},"\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":1593,"title":1594},"\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":1596,"title":1597},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":1599,"title":1600},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":1602,"title":1603},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":1605,"title":1606},"\u002F","Modern CSS Layouts & Micro-Interactions",{"path":1608,"title":1609},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":1611,"title":1612},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":1614,"title":1615},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":1617,"title":1618},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":1620,"title":1621},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":1623,"title":1624},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":1626,"title":1627},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":1629,"title":1630},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":1632,"title":1633},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":1635,"title":1636},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":1638,"title":1639},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":1641,"title":1642},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":1644,"title":1645},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":1647,"title":1648},"\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":1650,"title":1651},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":1653,"title":1654},"\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":1656,"title":1657},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":1659,"title":1660},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":1662,"title":1663},"\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":1665,"title":1666},"\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":1668,"title":1669},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics","Container Query Syntax Basics",{"path":1671,"title":1672},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":1674,"title":1675},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":1677,"title":1678},"\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":1680,"title":1681},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":1683,"title":1684},"\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":1686,"title":1687},"\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":1689,"title":1690},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":1692,"title":1693},"\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":1695,"title":1696},"\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":1698,"title":1699},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":1701,"title":1702},"\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":1704,"title":1705},"\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":1707,"title":1708},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":1710,"title":1711},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":1713,"title":1714},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":1716,"title":1717},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":1719,"title":1720},"\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":1722,"title":1723},"\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":1725,"title":1726},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":1728,"title":1729},"\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":1731,"title":1732},"\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":1734,"title":1735},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":1737,"title":1738},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":1740,"title":1741},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":1743,"title":1744},"\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":1746,"title":58},"\u002Fmastering-container-queries-responsive-layouts",{"path":1748,"title":1749},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":1751,"title":1752},"\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":1754,"title":1755},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":1757,"title":1758},"\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":1760,"title":1761},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":1763,"title":1764},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":1766,"title":1767},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":1769,"title":1770},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":1772,"title":1773},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":1775,"title":1776},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":1778,"title":1779},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":1781,"title":1782},"\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":1784,"title":1785},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset","Writing a Minimal Modern CSS Reset: Every Line Justified",{"path":1787,"title":1788},"\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":1320,"title":5},{"path":1791,"title":1792},"\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":1794,"title":1795},"\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":1797,"title":1798},"\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":1800,"title":1801},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"path":1803,"title":1804},"\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":1806,"title":1807},"\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":1809,"title":1810},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":1812,"title":1813},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":1815,"title":1816},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":1818,"title":1819},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":1821,"title":1822},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":1824,"title":1825},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":1827,"title":1828},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":1830,"title":1831},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions","Tabs That Become an Accordion: One Component, Two Layouts",{"path":1833,"title":1834},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":1836,"title":1837},"\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":1839,"title":1840},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":1842,"title":1843},"\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":1845,"title":1846},"\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":1848,"title":1849},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":1851,"title":1852},"\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":1854,"title":1855},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":1857,"title":1858},"\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":1860,"title":1861},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":1863,"title":1864},"\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":1866,"title":1867},"\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":1869,"title":1870},"\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":1872,"title":1873},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":1875,"title":1876},"\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":1878,"title":1879},"\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":1881,"title":1882},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":1884,"caption":1885,"height":1886,"resizable":280,"html":1887,"css":1888},"One component, four content-derived states","The same markup and CSS rendered four times. Only the content differs: aria-busy, an empty list, an alert, or list items. No state classes are used.",300,"\n\u003Cdiv class=\"grid\">\n  \u003Csection class=\"results\" aria-label=\"Loading example\" aria-busy=\"true\">\n    \u003Ch3>Loading\u003C\u002Fh3>\u003Cul class=\"results__list\">\u003C\u002Ful>\n    \u003Cp class=\"results__empty\">No results.\u003C\u002Fp>\n    \u003Cdiv class=\"results__skeleton\" aria-hidden=\"true\">\u003Cspan>\u003C\u002Fspan>\u003Cspan>\u003C\u002Fspan>\u003Cspan>\u003C\u002Fspan>\u003C\u002Fdiv>\n  \u003C\u002Fsection>\n  \u003Csection class=\"results\" aria-label=\"Empty example\" aria-busy=\"false\">\n    \u003Ch3>Empty\u003C\u002Fh3>\u003Cul class=\"results__list\">\u003C\u002Ful>\n    \u003Cp class=\"results__empty\">No results. Try a broader search.\u003C\u002Fp>\n    \u003Cdiv class=\"results__skeleton\" aria-hidden=\"true\">\u003Cspan>\u003C\u002Fspan>\u003Cspan>\u003C\u002Fspan>\u003Cspan>\u003C\u002Fspan>\u003C\u002Fdiv>\n  \u003C\u002Fsection>\n  \u003Csection class=\"results\" aria-label=\"Error example\" aria-busy=\"false\">\n    \u003Ch3>Error\u003C\u002Fh3>\u003Cul class=\"results__list\">\u003C\u002Ful>\n    \u003Cp class=\"results__empty\">No results.\u003C\u002Fp>\n    \u003Cdiv class=\"results__skeleton\" aria-hidden=\"true\">\u003Cspan>\u003C\u002Fspan>\u003Cspan>\u003C\u002Fspan>\u003Cspan>\u003C\u002Fspan>\u003C\u002Fdiv>\n    \u003Cp role=\"alert\">Could not load results.\u003C\u002Fp>\n  \u003C\u002Fsection>\n  \u003Csection class=\"results\" aria-label=\"Populated example\" aria-busy=\"false\">\n    \u003Ch3>Populated\u003C\u002Fh3>\n    \u003Cul class=\"results__list\">\u003Cli>Grid layouts\u003C\u002Fli>\u003Cli>Flexbox patterns\u003C\u002Fli>\u003Cli>Container queries\u003C\u002Fli>\u003C\u002Ful>\n    \u003Cp class=\"results__empty\">No results.\u003C\u002Fp>\n    \u003Cdiv class=\"results__skeleton\" aria-hidden=\"true\">\u003Cspan>\u003C\u002Fspan>\u003Cspan>\u003C\u002Fspan>\u003Cspan>\u003C\u002Fspan>\u003C\u002Fdiv>\n  \u003C\u002Fsection>\n\u003C\u002Fdiv>","\n.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.75rem; padding: 1rem; }\n.results { border: 1px solid var(--demo-border); border-radius: 10px; padding: 0.75rem; background: var(--demo-surface); font-size: 0.85rem; }\n.results h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }\n.results__list { margin: 0; padding-inline-start: 1.1rem; }\n.results p { margin: 0; }\n.results__empty, .results__skeleton { display: none; }\n.results:not([aria-busy=\"true\"]):not(:has(li, [role=\"alert\"])) .results__empty { display: block; color: var(--demo-muted); }\n.results[aria-busy=\"true\"] .results__skeleton { display: grid; gap: 0.4rem; }\n.results[aria-busy=\"true\"] .results__list { display: none; }\n.results:has([role=\"alert\"]) { border-color: #dc2626; background: color-mix(in srgb, #dc2626 10%, var(--demo-surface)); }\n.results:has([role=\"alert\"]) .results__list { display: none; }\n.results__skeleton span { display: block; block-size: 0.8rem; border-radius: 4px; background: linear-gradient(90deg, var(--demo-border) 25%, var(--demo-surface) 50%, var(--demo-border) 75%) 0 0 \u002F 200% 100%; animation: shimmer 1.4s linear infinite; }\n@keyframes shimmer { to { background-position: -200% 0; } }\n@media (prefers-reduced-motion: reduce) { .results__skeleton span { animation: none; } }",1789717744838]