[{"data":1,"prerenderedAt":2445},["ShallowReactive",2],{"page-\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions\u002F":3,"content-all-pages":1882,"live-demo:tabs-accordion":2439},{"id":4,"title":5,"body":6,"description":1863,"extension":1864,"meta":1865,"navigation":375,"path":1878,"seo":1879,"stem":1880,"__hash__":1881},"content\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions\u002Findex.md","Tabs That Become an Accordion: One Component, Two Layouts",{"type":7,"value":8,"toc":1851},"minimark",[9,13,33,38,62,69,180,184,187,191,1368,1410,1418,1427,1504,1507,1511,1514,1532,1542,1548,1554,1558,1600,1604,1619,1739,1745,1749,1773,1777,1789,1795,1810,1816,1820,1848],[10,11,5],"h1",{"id":12},"tabs-that-become-an-accordion-one-component-two-layouts",[14,15,16,17,21,22,27,28,32],"p",{},"Tabs are efficient on wide screens: all section labels are visible at once and one panel shows at a time. On narrow screens they fail — the labels overflow or wrap into a confusing second row — and designs switch to an accordion, where labels stack and each panel opens beneath its own label. Most implementations ship two components and swap them with a media query and JavaScript. The narrow problem this page solves is building one component from native ",[18,19,20],"code",{},"\u003Cdetails>"," elements that behaves as an accordion when narrow and lays itself out as tabs when wide, with a container query deciding which and no script at all. It belongs to ",[23,24,26],"a",{"href":25},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002F","Responsive Component Patterns"," in the ",[23,29,31],{"href":30},"\u002Fmastering-container-queries-responsive-layouts\u002F","Mastering Container Queries & Responsive Layouts"," guide.",[34,35,37],"h2",{"id":36},"why-details-elements-can-be-tabs","Why details elements can be tabs",[14,39,40,41,47,48,54,55,57,58,61],{},"Three platform features make this possible. ",[42,43,44],"strong",{},[18,45,46],{},"\u003Cdetails name=\"…\">"," groups disclosures so that opening one closes the others, which is exactly the \"one panel at a time\" behaviour of tabs, with no script. ",[42,49,50,53],{},[18,51,52],{},"display: contents"," and grid placement"," let each ",[18,56,20],{}," element's summary and content be positioned independently in a shared grid — summaries across the top, content below. ",[42,59,60],{},"Container queries"," switch between the two layouts based on the component's width.",[14,63,64,65,68],{},"The accessibility model is that of disclosures: each summary is a button that expands its section. That is different from the ARIA tabs pattern, which uses ",[18,66,67],{},"role=\"tablist\""," and arrow-key navigation. For content sections — product details, FAQ categories, documentation variants — disclosure semantics are appropriate and arguably simpler for assistive technology users. For application interfaces where users expect arrow keys to move between tabs, the ARIA pattern with script remains the right choice.",[70,71,77,78,77,82,77,86,77,94,77,100,77,112,77,119,77,124,77,129,77,133,77,138,77,141,77,145,77,149,77,152,77,155,77,159,77,161,77,164,77,167,77,171,77,175],"svg",{"viewBox":72,"role":73,"ariaLabel":74,"xmlns":75,"style":76},"0 0 720 320","img","The same details elements shown stacked as an accordion in a narrow container and laid out as a tab row with one panel in a wide container","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[79,80,81],"title",{},"Same markup, two arrangements",[83,84,85],"desc",{},"Left, narrow: three summaries stacked vertically, the second open with its panel directly beneath it. Right, wide: three summaries in a row across the top, the second highlighted, and its panel spanning the full width below the row.",[87,88,93],"text",{"textAnchor":89,"x":90,"y":91,"style":92},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","details[name] as accordion or tabs",[87,95,99],{"textAnchor":89,"x":96,"y":97,"style":98},"170","56","text-anchor:middle;fill:currentColor;font:600 12px sans-serif","narrow: accordion",[101,102],"rect",{"x":103,"y":104,"width":105,"height":106,"rx":107,"fill":108,"stroke":109,"strokeWidth":110,"opacity":111},"60","68","220","30","6","none","currentColor","1.5","0.6",[87,113,118],{"textAnchor":114,"x":115,"y":116,"style":117},"start","80","88","text-anchor:start;fill:currentColor;font:12px sans-serif","Overview",[101,120],{"x":103,"y":121,"width":105,"height":106,"rx":107,"fill":122,"opacity":123},"104","#7aa2ff","0.45",[87,125,128],{"textAnchor":114,"x":115,"y":126,"style":127},"124","text-anchor:start;fill:currentColor;font:600 12px sans-serif","Specifications",[101,130],{"x":103,"y":131,"width":105,"height":115,"rx":107,"fill":122,"opacity":132},"138","0.14",[87,134,137],{"textAnchor":89,"x":96,"y":135,"style":136},"182","text-anchor:middle;fill:currentColor;font:12px sans-serif","open panel",[101,139],{"x":103,"y":140,"width":105,"height":106,"rx":107,"fill":108,"stroke":109,"strokeWidth":110,"opacity":111},"224",[87,142,144],{"textAnchor":114,"x":115,"y":143,"style":117},"244","Reviews",[87,146,148],{"textAnchor":89,"x":147,"y":97,"style":98},"530","wide: tabs",[101,150],{"x":90,"y":104,"width":151,"height":106,"rx":107,"fill":108,"stroke":109,"strokeWidth":110,"opacity":111},"106",[87,153,118],{"textAnchor":89,"x":154,"y":116,"style":136},"413",[101,156],{"x":157,"y":104,"width":158,"height":106,"rx":107,"fill":122,"opacity":123},"474","112",[87,160,128],{"textAnchor":89,"x":147,"y":116,"style":98},[101,162],{"x":163,"y":104,"width":151,"height":106,"rx":107,"fill":108,"stroke":109,"strokeWidth":110,"opacity":111},"594",[87,165,144],{"textAnchor":89,"x":166,"y":116,"style":136},"647",[101,168],{"x":90,"y":151,"width":169,"height":170,"rx":107,"fill":122,"opacity":132},"340","148",[87,172,174],{"textAnchor":89,"x":147,"y":173,"style":136},"184","open panel spans the row",[87,176,179],{"textAnchor":89,"x":90,"y":177,"style":178},"296","text-anchor:middle;fill:currentColor;font:12px sans-serif;opacity:0.8","Opening one closes the others because they share a name attribute.",[34,181,183],{"id":182},"the-complete-implementation","The complete implementation",[14,185,186],{},"Resize the demo: below about 36rem it is an accordion; above, a tab row with the selected panel below.",[188,189],"live-demo",{"name":190},"tabs-accordion",[192,193,198],"pre",{"className":194,"code":195,"language":196,"meta":197,"style":197},"language-html shiki shiki-themes github-light-high-contrast github-dark-high-contrast","\u003C!doctype html>\n\u003Chtml lang=\"en\">\n\u003Chead>\n\u003Cmeta charset=\"utf-8\">\n\u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\u003Ctitle>Tabs that become an accordion\u003C\u002Ftitle>\n\u003Cstyle>\n  body { font: 15px\u002F1.5 system-ui, sans-serif; margin: 1rem; }\n\n  .tabset-host { container-type: inline-size; }\n\n  \u002F* ---------- Narrow default: a plain accordion ---------- *\u002F\n  .tabset details {\n    border: 1px solid #cbd5e1;\n    border-radius: 8px;\n    margin-block-end: 0.5rem;\n  }\n  .tabset summary {\n    padding: 0.6rem 0.9rem;\n    cursor: pointer;\n    font-weight: 600;\n  }\n  .tabset summary:focus-visible { outline: 2px solid #4338ca; outline-offset: 2px; }\n  .tabset .panel { padding: 0 0.9rem 0.9rem; }\n\n  \u002F* ---------- Wide: a tab strip ---------- *\u002F\n  @container (width > 36rem) {\n    .tabset {\n      display: grid;\n      \u002F* One auto column per tab, then the panel row spans them all. *\u002F\n      grid-template-columns: repeat(3, auto) 1fr;\n      grid-template-rows: auto 1fr;\n    }\n\n    \u002F* Let each details' children join the tabset grid directly. *\u002F\n    .tabset details { display: contents; }\n\n    .tabset summary {\n      grid-row: 1;\n      border: 1px solid #cbd5e1;\n      border-block-end: 0;\n      border-radius: 8px 8px 0 0;\n      list-style: none;                 \u002F* hide the disclosure triangle *\u002F\n    }\n    .tabset summary::-webkit-details-marker { display: none; }\n\n    .tabset details[open] > summary {\n      background: #eef2ff;\n      color: #312e81;\n    }\n\n    \u002F* With details as display: contents, the grid item for the content\n       is the ::details-content box that wraps .panel, so place that. *\u002F\n    .tabset details::details-content {\n      grid-row: 2;\n      grid-column: 1 \u002F -1;              \u002F* span the whole strip *\u002F\n    }\n    .tabset .panel {\n      padding: 1rem;\n      border: 1px solid #cbd5e1;\n      border-radius: 0 8px 8px 8px;\n    }\n  }\n\u003C\u002Fstyle>\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Cdiv class=\"tabset-host\">\n    \u003Cdiv class=\"tabset\">\n      \u003Cdetails name=\"product\" open>\n        \u003Csummary>Overview\u003C\u002Fsummary>\n        \u003Cdiv class=\"panel\">\u003Cp>A lightweight two-person tent for three seasons.\u003C\u002Fp>\u003C\u002Fdiv>\n      \u003C\u002Fdetails>\n      \u003Cdetails name=\"product\">\n        \u003Csummary>Specifications\u003C\u002Fsummary>\n        \u003Cdiv class=\"panel\">\u003Cp>1.4 kg · packed 42 × 14 cm · 2 doors.\u003C\u002Fp>\u003C\u002Fdiv>\n      \u003C\u002Fdetails>\n      \u003Cdetails name=\"product\">\n        \u003Csummary>Reviews\u003C\u002Fsummary>\n        \u003Cdiv class=\"panel\">\u003Cp>\"Pitches in five minutes, even in wind.\"\u003C\u002Fp>\u003C\u002Fdiv>\n      \u003C\u002Fdetails>\n    \u003C\u002Fdiv>\n  \u003C\u002Fdiv>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n","html","",[18,199,200,220,240,250,268,293,307,317,370,377,391,396,403,415,436,451,466,472,482,501,514,527,532,572,600,605,611,620,628,641,647,679,696,702,707,713,732,737,746,758,776,788,812,828,833,853,858,881,894,907,912,917,923,929,944,955,977,982,991,1005,1022,1045,1050,1055,1065,1074,1084,1103,1120,1141,1157,1188,1198,1213,1227,1255,1264,1279,1293,1321,1330,1340,1350,1359],{"__ignoreMap":197},[201,202,205,209,213,217],"span",{"class":203,"line":204},"line",1,[201,206,208],{"class":207},"suds8","\u003C!",[201,210,212],{"class":211},"sne4z","doctype",[201,214,216],{"class":215},"s-5SL"," html",[201,218,219],{"class":207},">\n",[201,221,223,226,228,231,234,238],{"class":203,"line":222},2,[201,224,225],{"class":207},"\u003C",[201,227,196],{"class":211},[201,229,230],{"class":215}," lang",[201,232,233],{"class":207},"=",[201,235,237],{"class":236},"sT6z2","\"en\"",[201,239,219],{"class":207},[201,241,243,245,248],{"class":203,"line":242},3,[201,244,225],{"class":207},[201,246,247],{"class":211},"head",[201,249,219],{"class":207},[201,251,253,255,258,261,263,266],{"class":203,"line":252},4,[201,254,225],{"class":207},[201,256,257],{"class":211},"meta",[201,259,260],{"class":215}," charset",[201,262,233],{"class":207},[201,264,265],{"class":236},"\"utf-8\"",[201,267,219],{"class":207},[201,269,271,273,275,278,280,283,286,288,291],{"class":203,"line":270},5,[201,272,225],{"class":207},[201,274,257],{"class":211},[201,276,277],{"class":215}," name",[201,279,233],{"class":207},[201,281,282],{"class":236},"\"viewport\"",[201,284,285],{"class":215}," content",[201,287,233],{"class":207},[201,289,290],{"class":236},"\"width=device-width, initial-scale=1\"",[201,292,219],{"class":207},[201,294,296,298,300,303,305],{"class":203,"line":295},6,[201,297,225],{"class":207},[201,299,79],{"class":211},[201,301,302],{"class":207},">Tabs that become an accordion\u003C\u002F",[201,304,79],{"class":211},[201,306,219],{"class":207},[201,308,310,312,315],{"class":203,"line":309},7,[201,311,225],{"class":207},[201,313,314],{"class":211},"style",[201,316,219],{"class":207},[201,318,320,323,326,329,332,335,339,342,344,347,350,353,356,359,361,364,367],{"class":203,"line":319},8,[201,321,322],{"class":211},"  body",[201,324,325],{"class":207}," { ",[201,327,328],{"class":215},"font",[201,330,331],{"class":207},": ",[201,333,334],{"class":215},"15",[201,336,338],{"class":337},"sHUrx","px",[201,340,341],{"class":207},"\u002F",[201,343,110],{"class":215},[201,345,346],{"class":215}," system-ui",[201,348,349],{"class":207},", ",[201,351,352],{"class":215},"sans-serif",[201,354,355],{"class":207},"; ",[201,357,358],{"class":215},"margin",[201,360,331],{"class":207},[201,362,363],{"class":215},"1",[201,365,366],{"class":337},"rem",[201,368,369],{"class":207},"; }\n",[201,371,373],{"class":203,"line":372},9,[201,374,376],{"emptyLinePlaceholder":375},true,"\n",[201,378,380,383,385,388],{"class":203,"line":379},10,[201,381,382],{"class":215},"  .tabset-host",[201,384,325],{"class":207},[201,386,387],{"class":215},"container-type",[201,389,390],{"class":207},": inline-size; }\n",[201,392,394],{"class":203,"line":393},11,[201,395,376],{"emptyLinePlaceholder":375},[201,397,399],{"class":203,"line":398},12,[201,400,402],{"class":401},"sLBg1","  \u002F* ---------- Narrow default: a plain accordion ---------- *\u002F\n",[201,404,406,409,412],{"class":203,"line":405},13,[201,407,408],{"class":215},"  .tabset",[201,410,411],{"class":211}," details",[201,413,414],{"class":207}," {\n",[201,416,418,421,423,425,427,430,433],{"class":203,"line":417},14,[201,419,420],{"class":215},"    border",[201,422,331],{"class":207},[201,424,363],{"class":215},[201,426,338],{"class":337},[201,428,429],{"class":215}," solid",[201,431,432],{"class":215}," #cbd5e1",[201,434,435],{"class":207},";\n",[201,437,439,442,444,447,449],{"class":203,"line":438},15,[201,440,441],{"class":215},"    border-radius",[201,443,331],{"class":207},[201,445,446],{"class":215},"8",[201,448,338],{"class":337},[201,450,435],{"class":207},[201,452,454,457,459,462,464],{"class":203,"line":453},16,[201,455,456],{"class":215},"    margin-block-end",[201,458,331],{"class":207},[201,460,461],{"class":215},"0.5",[201,463,366],{"class":337},[201,465,435],{"class":207},[201,467,469],{"class":203,"line":468},17,[201,470,471],{"class":207},"  }\n",[201,473,475,477,480],{"class":203,"line":474},18,[201,476,408],{"class":215},[201,478,479],{"class":211}," summary",[201,481,414],{"class":207},[201,483,485,488,490,492,494,497,499],{"class":203,"line":484},19,[201,486,487],{"class":215},"    padding",[201,489,331],{"class":207},[201,491,111],{"class":215},[201,493,366],{"class":337},[201,495,496],{"class":215}," 0.9",[201,498,366],{"class":337},[201,500,435],{"class":207},[201,502,504,507,509,512],{"class":203,"line":503},20,[201,505,506],{"class":215},"    cursor",[201,508,331],{"class":207},[201,510,511],{"class":215},"pointer",[201,513,435],{"class":207},[201,515,517,520,522,525],{"class":203,"line":516},21,[201,518,519],{"class":215},"    font-weight",[201,521,331],{"class":207},[201,523,524],{"class":215},"600",[201,526,435],{"class":207},[201,528,530],{"class":203,"line":529},22,[201,531,471],{"class":207},[201,533,535,537,539,542,544,547,549,552,554,556,559,561,564,566,568,570],{"class":203,"line":534},23,[201,536,408],{"class":215},[201,538,479],{"class":211},[201,540,541],{"class":215},":focus-visible",[201,543,325],{"class":207},[201,545,546],{"class":215},"outline",[201,548,331],{"class":207},[201,550,551],{"class":215},"2",[201,553,338],{"class":337},[201,555,429],{"class":215},[201,557,558],{"class":215}," #4338ca",[201,560,355],{"class":207},[201,562,563],{"class":215},"outline-offset",[201,565,331],{"class":207},[201,567,551],{"class":215},[201,569,338],{"class":337},[201,571,369],{"class":207},[201,573,575,577,580,582,585,587,590,592,594,596,598],{"class":203,"line":574},24,[201,576,408],{"class":215},[201,578,579],{"class":215}," .panel",[201,581,325],{"class":207},[201,583,584],{"class":215},"padding",[201,586,331],{"class":207},[201,588,589],{"class":215},"0",[201,591,496],{"class":215},[201,593,366],{"class":337},[201,595,496],{"class":215},[201,597,366],{"class":337},[201,599,369],{"class":207},[201,601,603],{"class":203,"line":602},25,[201,604,376],{"emptyLinePlaceholder":375},[201,606,608],{"class":203,"line":607},26,[201,609,610],{"class":401},"  \u002F* ---------- Wide: a tab strip ---------- *\u002F\n",[201,612,614,617],{"class":203,"line":613},27,[201,615,616],{"class":337},"  @container",[201,618,619],{"class":207}," (width > 36rem) {\n",[201,621,623,626],{"class":203,"line":622},28,[201,624,625],{"class":215},"    .tabset",[201,627,414],{"class":207},[201,629,631,634,636,639],{"class":203,"line":630},29,[201,632,633],{"class":215},"      display",[201,635,331],{"class":207},[201,637,638],{"class":215},"grid",[201,640,435],{"class":207},[201,642,644],{"class":203,"line":643},30,[201,645,646],{"class":401},"      \u002F* One auto column per tab, then the panel row spans them all. *\u002F\n",[201,648,650,653,655,658,661,664,666,669,672,674,677],{"class":203,"line":649},31,[201,651,652],{"class":215},"      grid-template-columns",[201,654,331],{"class":207},[201,656,657],{"class":215},"repeat",[201,659,660],{"class":207},"(",[201,662,663],{"class":215},"3",[201,665,349],{"class":207},[201,667,668],{"class":215},"auto",[201,670,671],{"class":207},") ",[201,673,363],{"class":215},[201,675,676],{"class":337},"fr",[201,678,435],{"class":207},[201,680,682,685,687,689,692,694],{"class":203,"line":681},32,[201,683,684],{"class":215},"      grid-template-rows",[201,686,331],{"class":207},[201,688,668],{"class":215},[201,690,691],{"class":215}," 1",[201,693,676],{"class":337},[201,695,435],{"class":207},[201,697,699],{"class":203,"line":698},33,[201,700,701],{"class":207},"    }\n",[201,703,705],{"class":203,"line":704},34,[201,706,376],{"emptyLinePlaceholder":375},[201,708,710],{"class":203,"line":709},35,[201,711,712],{"class":401},"    \u002F* Let each details' children join the tabset grid directly. *\u002F\n",[201,714,716,718,720,722,725,727,730],{"class":203,"line":715},36,[201,717,625],{"class":215},[201,719,411],{"class":211},[201,721,325],{"class":207},[201,723,724],{"class":215},"display",[201,726,331],{"class":207},[201,728,729],{"class":215},"contents",[201,731,369],{"class":207},[201,733,735],{"class":203,"line":734},37,[201,736,376],{"emptyLinePlaceholder":375},[201,738,740,742,744],{"class":203,"line":739},38,[201,741,625],{"class":215},[201,743,479],{"class":211},[201,745,414],{"class":207},[201,747,749,752,754,756],{"class":203,"line":748},39,[201,750,751],{"class":215},"      grid-row",[201,753,331],{"class":207},[201,755,363],{"class":215},[201,757,435],{"class":207},[201,759,761,764,766,768,770,772,774],{"class":203,"line":760},40,[201,762,763],{"class":215},"      border",[201,765,331],{"class":207},[201,767,363],{"class":215},[201,769,338],{"class":337},[201,771,429],{"class":215},[201,773,432],{"class":215},[201,775,435],{"class":207},[201,777,779,782,784,786],{"class":203,"line":778},41,[201,780,781],{"class":215},"      border-block-end",[201,783,331],{"class":207},[201,785,589],{"class":215},[201,787,435],{"class":207},[201,789,791,794,796,798,800,803,805,808,810],{"class":203,"line":790},42,[201,792,793],{"class":215},"      border-radius",[201,795,331],{"class":207},[201,797,446],{"class":215},[201,799,338],{"class":337},[201,801,802],{"class":215}," 8",[201,804,338],{"class":337},[201,806,807],{"class":215}," 0",[201,809,807],{"class":215},[201,811,435],{"class":207},[201,813,815,818,820,822,825],{"class":203,"line":814},43,[201,816,817],{"class":215},"      list-style",[201,819,331],{"class":207},[201,821,108],{"class":215},[201,823,824],{"class":207},";                 ",[201,826,827],{"class":401},"\u002F* hide the disclosure triangle *\u002F\n",[201,829,831],{"class":203,"line":830},44,[201,832,701],{"class":207},[201,834,836,838,840,843,845,847,849,851],{"class":203,"line":835},45,[201,837,625],{"class":215},[201,839,479],{"class":211},[201,841,842],{"class":215},"::-webkit-details-marker",[201,844,325],{"class":207},[201,846,724],{"class":215},[201,848,331],{"class":207},[201,850,108],{"class":215},[201,852,369],{"class":207},[201,854,856],{"class":203,"line":855},46,[201,857,376],{"emptyLinePlaceholder":375},[201,859,861,863,865,868,871,874,877,879],{"class":203,"line":860},47,[201,862,625],{"class":215},[201,864,411],{"class":211},[201,866,867],{"class":207},"[",[201,869,870],{"class":215},"open",[201,872,873],{"class":207},"] ",[201,875,876],{"class":337},">",[201,878,479],{"class":211},[201,880,414],{"class":207},[201,882,884,887,889,892],{"class":203,"line":883},48,[201,885,886],{"class":215},"      background",[201,888,331],{"class":207},[201,890,891],{"class":215},"#eef2ff",[201,893,435],{"class":207},[201,895,897,900,902,905],{"class":203,"line":896},49,[201,898,899],{"class":215},"      color",[201,901,331],{"class":207},[201,903,904],{"class":215},"#312e81",[201,906,435],{"class":207},[201,908,910],{"class":203,"line":909},50,[201,911,701],{"class":207},[201,913,915],{"class":203,"line":914},51,[201,916,376],{"emptyLinePlaceholder":375},[201,918,920],{"class":203,"line":919},52,[201,921,922],{"class":401},"    \u002F* With details as display: contents, the grid item for the content\n",[201,924,926],{"class":203,"line":925},53,[201,927,928],{"class":401},"       is the ::details-content box that wraps .panel, so place that. *\u002F\n",[201,930,932,934,936,939,942],{"class":203,"line":931},54,[201,933,625],{"class":215},[201,935,411],{"class":211},[201,937,938],{"class":207},"::",[201,940,941],{"class":211},"details-content",[201,943,414],{"class":207},[201,945,947,949,951,953],{"class":203,"line":946},55,[201,948,751],{"class":215},[201,950,331],{"class":207},[201,952,551],{"class":215},[201,954,435],{"class":207},[201,956,958,961,963,965,968,971,974],{"class":203,"line":957},56,[201,959,960],{"class":215},"      grid-column",[201,962,331],{"class":207},[201,964,363],{"class":215},[201,966,967],{"class":207}," \u002F ",[201,969,970],{"class":215},"-1",[201,972,973],{"class":207},";              ",[201,975,976],{"class":401},"\u002F* span the whole strip *\u002F\n",[201,978,980],{"class":203,"line":979},57,[201,981,701],{"class":207},[201,983,985,987,989],{"class":203,"line":984},58,[201,986,625],{"class":215},[201,988,579],{"class":215},[201,990,414],{"class":207},[201,992,994,997,999,1001,1003],{"class":203,"line":993},59,[201,995,996],{"class":215},"      padding",[201,998,331],{"class":207},[201,1000,363],{"class":215},[201,1002,366],{"class":337},[201,1004,435],{"class":207},[201,1006,1008,1010,1012,1014,1016,1018,1020],{"class":203,"line":1007},60,[201,1009,763],{"class":215},[201,1011,331],{"class":207},[201,1013,363],{"class":215},[201,1015,338],{"class":337},[201,1017,429],{"class":215},[201,1019,432],{"class":215},[201,1021,435],{"class":207},[201,1023,1025,1027,1029,1031,1033,1035,1037,1039,1041,1043],{"class":203,"line":1024},61,[201,1026,793],{"class":215},[201,1028,331],{"class":207},[201,1030,589],{"class":215},[201,1032,802],{"class":215},[201,1034,338],{"class":337},[201,1036,802],{"class":215},[201,1038,338],{"class":337},[201,1040,802],{"class":215},[201,1042,338],{"class":337},[201,1044,435],{"class":207},[201,1046,1048],{"class":203,"line":1047},62,[201,1049,701],{"class":207},[201,1051,1053],{"class":203,"line":1052},63,[201,1054,471],{"class":207},[201,1056,1058,1061,1063],{"class":203,"line":1057},64,[201,1059,1060],{"class":207},"\u003C\u002F",[201,1062,314],{"class":211},[201,1064,219],{"class":207},[201,1066,1068,1070,1072],{"class":203,"line":1067},65,[201,1069,1060],{"class":207},[201,1071,247],{"class":211},[201,1073,219],{"class":207},[201,1075,1077,1079,1082],{"class":203,"line":1076},66,[201,1078,225],{"class":207},[201,1080,1081],{"class":211},"body",[201,1083,219],{"class":207},[201,1085,1087,1090,1093,1096,1098,1101],{"class":203,"line":1086},67,[201,1088,1089],{"class":207},"  \u003C",[201,1091,1092],{"class":211},"div",[201,1094,1095],{"class":215}," class",[201,1097,233],{"class":207},[201,1099,1100],{"class":236},"\"tabset-host\"",[201,1102,219],{"class":207},[201,1104,1106,1109,1111,1113,1115,1118],{"class":203,"line":1105},68,[201,1107,1108],{"class":207},"    \u003C",[201,1110,1092],{"class":211},[201,1112,1095],{"class":215},[201,1114,233],{"class":207},[201,1116,1117],{"class":236},"\"tabset\"",[201,1119,219],{"class":207},[201,1121,1123,1126,1129,1131,1133,1136,1139],{"class":203,"line":1122},69,[201,1124,1125],{"class":207},"      \u003C",[201,1127,1128],{"class":211},"details",[201,1130,277],{"class":215},[201,1132,233],{"class":207},[201,1134,1135],{"class":236},"\"product\"",[201,1137,1138],{"class":215}," open",[201,1140,219],{"class":207},[201,1142,1144,1147,1150,1153,1155],{"class":203,"line":1143},70,[201,1145,1146],{"class":207},"        \u003C",[201,1148,1149],{"class":211},"summary",[201,1151,1152],{"class":207},">Overview\u003C\u002F",[201,1154,1149],{"class":211},[201,1156,219],{"class":207},[201,1158,1160,1162,1164,1166,1168,1171,1174,1176,1179,1181,1184,1186],{"class":203,"line":1159},71,[201,1161,1146],{"class":207},[201,1163,1092],{"class":211},[201,1165,1095],{"class":215},[201,1167,233],{"class":207},[201,1169,1170],{"class":236},"\"panel\"",[201,1172,1173],{"class":207},">\u003C",[201,1175,14],{"class":211},[201,1177,1178],{"class":207},">A lightweight two-person tent for three seasons.\u003C\u002F",[201,1180,14],{"class":211},[201,1182,1183],{"class":207},">\u003C\u002F",[201,1185,1092],{"class":211},[201,1187,219],{"class":207},[201,1189,1191,1194,1196],{"class":203,"line":1190},72,[201,1192,1193],{"class":207},"      \u003C\u002F",[201,1195,1128],{"class":211},[201,1197,219],{"class":207},[201,1199,1201,1203,1205,1207,1209,1211],{"class":203,"line":1200},73,[201,1202,1125],{"class":207},[201,1204,1128],{"class":211},[201,1206,277],{"class":215},[201,1208,233],{"class":207},[201,1210,1135],{"class":236},[201,1212,219],{"class":207},[201,1214,1216,1218,1220,1223,1225],{"class":203,"line":1215},74,[201,1217,1146],{"class":207},[201,1219,1149],{"class":211},[201,1221,1222],{"class":207},">Specifications\u003C\u002F",[201,1224,1149],{"class":211},[201,1226,219],{"class":207},[201,1228,1230,1232,1234,1236,1238,1240,1242,1244,1247,1249,1251,1253],{"class":203,"line":1229},75,[201,1231,1146],{"class":207},[201,1233,1092],{"class":211},[201,1235,1095],{"class":215},[201,1237,233],{"class":207},[201,1239,1170],{"class":236},[201,1241,1173],{"class":207},[201,1243,14],{"class":211},[201,1245,1246],{"class":207},">1.4 kg · packed 42 × 14 cm · 2 doors.\u003C\u002F",[201,1248,14],{"class":211},[201,1250,1183],{"class":207},[201,1252,1092],{"class":211},[201,1254,219],{"class":207},[201,1256,1258,1260,1262],{"class":203,"line":1257},76,[201,1259,1193],{"class":207},[201,1261,1128],{"class":211},[201,1263,219],{"class":207},[201,1265,1267,1269,1271,1273,1275,1277],{"class":203,"line":1266},77,[201,1268,1125],{"class":207},[201,1270,1128],{"class":211},[201,1272,277],{"class":215},[201,1274,233],{"class":207},[201,1276,1135],{"class":236},[201,1278,219],{"class":207},[201,1280,1282,1284,1286,1289,1291],{"class":203,"line":1281},78,[201,1283,1146],{"class":207},[201,1285,1149],{"class":211},[201,1287,1288],{"class":207},">Reviews\u003C\u002F",[201,1290,1149],{"class":211},[201,1292,219],{"class":207},[201,1294,1296,1298,1300,1302,1304,1306,1308,1310,1313,1315,1317,1319],{"class":203,"line":1295},79,[201,1297,1146],{"class":207},[201,1299,1092],{"class":211},[201,1301,1095],{"class":215},[201,1303,233],{"class":207},[201,1305,1170],{"class":236},[201,1307,1173],{"class":207},[201,1309,14],{"class":211},[201,1311,1312],{"class":207},">\"Pitches in five minutes, even in wind.\"\u003C\u002F",[201,1314,14],{"class":211},[201,1316,1183],{"class":207},[201,1318,1092],{"class":211},[201,1320,219],{"class":207},[201,1322,1324,1326,1328],{"class":203,"line":1323},80,[201,1325,1193],{"class":207},[201,1327,1128],{"class":211},[201,1329,219],{"class":207},[201,1331,1333,1336,1338],{"class":203,"line":1332},81,[201,1334,1335],{"class":207},"    \u003C\u002F",[201,1337,1092],{"class":211},[201,1339,219],{"class":207},[201,1341,1343,1346,1348],{"class":203,"line":1342},82,[201,1344,1345],{"class":207},"  \u003C\u002F",[201,1347,1092],{"class":211},[201,1349,219],{"class":207},[201,1351,1353,1355,1357],{"class":203,"line":1352},83,[201,1354,1060],{"class":207},[201,1356,1081],{"class":211},[201,1358,219],{"class":207},[201,1360,1362,1364,1366],{"class":203,"line":1361},84,[201,1363,1060],{"class":207},[201,1365,196],{"class":211},[201,1367,219],{"class":207},[14,1369,1370,1372,1373,1375,1376,1378,1379,1382,1383,1385,1386,1389,1390,1393,1394,1396,1397,1399,1400,1402,1403,1406,1407,1409],{},[18,1371,52],{}," on each ",[18,1374,20],{}," is what lets the summaries line up in a single row: the ",[18,1377,20],{}," boxes disappear from layout, and what they contain becomes direct grid items of ",[18,1380,1381],{},".tabset",". For a ",[18,1384,20],{}," element that means two boxes: the ",[18,1387,1388],{},"\u003Csummary>",", and the ",[18,1391,1392],{},"::details-content"," pseudo-element that wraps everything else. Summaries go in row 1, each in its own auto-sized column in source order; the ",[18,1395,1392],{}," boxes go in row 2 spanning every column. A closed ",[18,1398,20],{}," hides its ",[18,1401,1392],{}," natively, so only the open panel occupies row 2. Placing ",[18,1404,1405],{},".panel"," directly would not work, because its parent box is the ",[18,1408,1392],{}," wrapper, not the grid.",[34,1411,1413,1414,1417],{"id":1412},"the-key-technique-exclusivity-from-the-name-attribute","The key technique: exclusivity from the ",[18,1415,1416],{},"name"," attribute",[14,1419,1420,1421,1423,1424,1426],{},"Tabs require that exactly one panel is open. Shared ",[18,1422,1416],{}," attributes enforce the \"at most one\" half: opening any member of the group closes the others, just as selecting a radio button deselects its siblings. Starting with one element ",[18,1425,870],{}," provides the \"at least one\" half on load.",[70,1428,77,1431,77,1434,77,1437,77,1440,77,1445,77,1450,77,1454,77,1456,77,1459,77,1462,77,1465,77,1471,77,1475,77,1481,77,1485,77,1488,77,1491,77,1493,77,1495,77,1497,77,1500],{"viewBox":1429,"role":73,"ariaLabel":1430,"xmlns":75,"style":76},"0 0 720 260","Three details elements with the same name: opening the third closes the first, like a radio group",[79,1432,1433],{},"Exclusive disclosures",[83,1435,1436],{},"Before: the first of three details elements named product is open. The user activates the third summary. After: the third is open and the browser has closed the first automatically. No script is involved.",[87,1438,1439],{"textAnchor":89,"x":90,"y":91,"style":92},"\u003Cdetails name=\"product\"> × 3",[87,1441,1444],{"textAnchor":89,"x":1442,"y":1443,"style":98},"160","58","before",[101,1446],{"x":103,"y":1447,"width":1448,"height":1449,"rx":107,"fill":122,"opacity":123},"70","200","34",[87,1451,1453],{"textAnchor":89,"x":1442,"y":1452,"style":136},"92","Overview · open",[101,1455],{"x":103,"y":158,"width":1448,"height":1449,"rx":107,"fill":108,"stroke":109,"strokeWidth":110,"opacity":111},[87,1457,128],{"textAnchor":89,"x":1442,"y":1458,"style":136},"134",[101,1460],{"x":103,"y":1461,"width":1448,"height":1449,"rx":107,"fill":108,"stroke":109,"strokeWidth":110,"opacity":111},"154",[87,1463,144],{"textAnchor":89,"x":1442,"y":1464,"style":136},"176",[203,1466],{"x1":1467,"y1":1468,"x2":1469,"y2":1468,"stroke":109,"strokeWidth":551,"opacity":1470},"290","130","420","0.7",[1472,1473],"path",{"d":1474,"fill":109,"opacity":1470},"M410 124 L422 130 L410 136 Z",[87,1476,1480],{"textAnchor":89,"x":1477,"y":1478,"style":1479},"355","120","text-anchor:middle;fill:currentColor;font:11px sans-serif","open Reviews",[87,1482,1484],{"textAnchor":89,"x":1483,"y":1443,"style":98},"560","after",[101,1486],{"x":1487,"y":1447,"width":1448,"height":1449,"rx":107,"fill":108,"stroke":109,"strokeWidth":110,"opacity":111},"460",[87,1489,1490],{"textAnchor":89,"x":1483,"y":1452,"style":136},"Overview · closed",[101,1492],{"x":1487,"y":158,"width":1448,"height":1449,"rx":107,"fill":108,"stroke":109,"strokeWidth":110,"opacity":111},[87,1494,128],{"textAnchor":89,"x":1483,"y":1458,"style":136},[101,1496],{"x":1487,"y":1461,"width":1448,"height":1449,"rx":107,"fill":122,"opacity":123},[87,1498,1499],{"textAnchor":89,"x":1483,"y":1464,"style":136},"Reviews · open",[87,1501,1503],{"textAnchor":89,"x":90,"y":1502,"style":136},"232","Unlike tabs, clicking the open summary closes it; nothing forces one to stay open.",[14,1505,1506],{},"One behavioural difference from true tabs remains: activating the summary of the open panel closes it, leaving no panel visible. In the accordion layout that is expected. In the tab layout it can feel odd; a small script can re-open it, or the design can accept it — an empty panel area with all labels visible is a clear, recoverable state.",[34,1508,1510],{"id":1509},"when-the-labels-no-longer-fit","When the labels no longer fit",[14,1512,1513],{},"The tab layout assumes all summaries fit on one row. With three short labels that is safe above 36rem; with six labels, or labels translated into a longer language, it may not be. Three options keep the component robust as content changes.",[14,1515,1516,1519,1520,1524,1525,1527,1528,1531],{},[42,1517,1518],{},"Raise the threshold with the count."," A ",[23,1521,1523],{"href":1522},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fquantity-queries-with-has\u002F","quantity query"," can require more width before switching to tabs when there are more sections: the tab rules for five or more ",[18,1526,20],{}," elements sit inside a wider ",[18,1529,1530],{},"@container"," condition.",[14,1533,1534,1537,1538,1541],{},[42,1535,1536],{},"Let the strip scroll."," Make row 1 a horizontally scrolling strip by placing the summaries in their own grid columns inside an ",[18,1539,1540],{},"overflow-x: auto"," region. Keyboard users can still Tab through them, and the active tab scrolls into view when focused. This suits product pages with many specification groups.",[14,1543,1544,1547],{},[42,1545,1546],{},"Fall back to the accordion earlier than necessary."," An accordion never runs out of room. If the labels are long and unpredictable, a conservative threshold that switches to tabs only in genuinely wide containers is simpler than engineering a strip that copes with every case.",[14,1549,1550,1551,1553],{},"Whichever option is chosen, test with the longest label the content will realistically have, and at 200% text zoom — where a threshold in ",[18,1552,366],{}," rises with the text and the component returns to the accordion before the labels collide.",[34,1555,1557],{"id":1556},"accessibility-considerations","Accessibility considerations",[1559,1560,1561,1575,1581,1594],"ul",{},[1562,1563,1564,1567,1568,1571,1572,1574],"li",{},[42,1565,1566],{},"Semantics."," Screen readers announce each summary as a button with expanded or collapsed state, in both layouts. Users navigating by heading will not find the section labels unless summaries contain headings, so put an ",[18,1569,1570],{},"\u003Ch3>"," inside each ",[18,1573,1388],{}," if the sections are substantial.",[1562,1576,1577,1580],{},[42,1578,1579],{},"Keyboard."," Tab moves between summaries; Enter or Space toggles. There is no arrow-key navigation between tabs, which users of the ARIA tabs pattern expect; document the component's behaviour in your design system so it is chosen knowingly.",[1562,1582,1583,1586,1587,1589,1590,1593],{},[42,1584,1585],{},"Find in page."," Closed ",[18,1588,20],{}," contents are searchable in current browsers, and a match opens its disclosure automatically — an advantage over many scripted tab implementations that hide inactive panels with ",[18,1591,1592],{},"display: none",".",[1562,1595,1596,1599],{},[42,1597,1598],{},"Visual state."," The open tab's highlighted summary uses both colour and shape (it joins the panel), so the state is not conveyed by colour alone.",[34,1601,1603],{"id":1602},"variation-animating-the-panel","Variation: animating the panel",[14,1605,1606,1607,1610,1611,1613,1614,1618],{},"In the accordion layout, panels can grow to their height smoothly with ",[18,1608,1609],{},"interpolate-size"," and ",[18,1612,1392],{},", described in ",[23,1615,1617],{"href":1616},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Finterpolate-size-for-height-auto-animation\u002F","Animating height: auto With interpolate-size",". In the tab layout, a short fade is usually better than a height animation, because the panel area stays roughly the same size.",[192,1620,1624],{"className":1621,"code":1622,"language":1623,"meta":197,"style":197},"language-css shiki shiki-themes github-light-high-contrast github-dark-high-contrast","@container (width > 36rem) {\n  @media (prefers-reduced-motion: no-preference) {\n    .tabset details[open] > .panel {\n      animation: tab-in 180ms ease-out;\n    }\n  }\n}\n\n@keyframes tab-in {\n  from { opacity: 0; translate: 0 0.25rem; }\n}\n","css",[18,1625,1626,1632,1640,1658,1677,1681,1685,1690,1694,1705,1735],{"__ignoreMap":197},[201,1627,1628,1630],{"class":203,"line":204},[201,1629,1530],{"class":337},[201,1631,619],{"class":207},[201,1633,1634,1637],{"class":203,"line":222},[201,1635,1636],{"class":337},"  @media",[201,1638,1639],{"class":207}," (prefers-reduced-motion: no-preference) {\n",[201,1641,1642,1644,1646,1648,1650,1652,1654,1656],{"class":203,"line":242},[201,1643,625],{"class":215},[201,1645,411],{"class":211},[201,1647,867],{"class":207},[201,1649,870],{"class":215},[201,1651,873],{"class":207},[201,1653,876],{"class":337},[201,1655,579],{"class":215},[201,1657,414],{"class":207},[201,1659,1660,1663,1666,1669,1672,1675],{"class":203,"line":252},[201,1661,1662],{"class":215},"      animation",[201,1664,1665],{"class":207},": tab-in ",[201,1667,1668],{"class":215},"180",[201,1670,1671],{"class":337},"ms",[201,1673,1674],{"class":215}," ease-out",[201,1676,435],{"class":207},[201,1678,1679],{"class":203,"line":270},[201,1680,701],{"class":207},[201,1682,1683],{"class":203,"line":295},[201,1684,471],{"class":207},[201,1686,1687],{"class":203,"line":309},[201,1688,1689],{"class":207},"}\n",[201,1691,1692],{"class":203,"line":319},[201,1693,376],{"emptyLinePlaceholder":375},[201,1695,1696,1699,1703],{"class":203,"line":372},[201,1697,1698],{"class":337},"@keyframes",[201,1700,1702],{"class":1701},"soyes"," tab-in",[201,1704,414],{"class":207},[201,1706,1707,1710,1712,1715,1717,1719,1721,1724,1726,1728,1731,1733],{"class":203,"line":379},[201,1708,1709],{"class":215},"  from",[201,1711,325],{"class":207},[201,1713,1714],{"class":215},"opacity",[201,1716,331],{"class":207},[201,1718,589],{"class":215},[201,1720,355],{"class":207},[201,1722,1723],{"class":215},"translate",[201,1725,331],{"class":207},[201,1727,589],{"class":215},[201,1729,1730],{"class":215}," 0.25",[201,1732,366],{"class":337},[201,1734,369],{"class":207},[201,1736,1737],{"class":203,"line":393},[201,1738,1689],{"class":207},[14,1740,1741,1742,1744],{},"The animation plays each time a panel opens, because the panel element is rendered afresh when its ",[18,1743,20],{}," opens. Keep it short: users switching tabs rapidly to compare content should not wait for each panel to arrive.",[34,1746,1748],{"id":1747},"browser-support","Browser support",[14,1750,1751,1752,1754,1755,1757,1758,1760,1761,1764,1765,1767,1768,1770,1771,1593],{},"The ",[18,1753,1416],{}," attribute for exclusive ",[18,1756,20],{}," groups is supported in current versions of Chrome, Edge, Firefox and Safari; in older engines, multiple disclosures can be open at once, which degrades the tab layout to several visible panels but loses no content. The ",[18,1759,1392],{}," pseudo-element, which the tab layout places in the grid, is supported in Chrome and Edge 131+, Firefox 143+ and Safari 18.4+; where it is missing, keep the accordion layout by wrapping the wide rules in ",[18,1762,1763],{},"@supports selector(::details-content)",". Container queries are supported in Chrome and Edge 105+, Firefox 110+ and Safari 16+. ",[18,1766,52],{}," on ",[18,1769,20],{}," behaves consistently in current engines for layout purposes; test with your screen readers, as some older combinations mishandled the semantics of elements with ",[18,1772,52],{},[34,1774,1776],{"id":1775},"faq","FAQ",[14,1778,1779,1782,1783,1785,1786,1788],{},[42,1780,1781],{},"Can the same markup be both tabs and an accordion?","\nYes, if it is built from ",[18,1784,1128],{}," elements that share a ",[18,1787,1416],{}," attribute. The name makes them mutually exclusive, like tabs. In narrow containers they display as a normal stacked accordion; in wide containers CSS grid places every summary in a row at the top and the open panel below.",[14,1790,1791,1794],{},[42,1792,1793],{},"Is a details-based tab strip accessible?","\nIt is accessible as a set of disclosures: each summary is announced as a button that expands and collapses, and keyboard users Tab between them. It is not announced with the ARIA tabs pattern of tablist, tab and tabpanel. For many content sections that is acceptable; for application-style tabs with arrow-key navigation, use the ARIA pattern with script.",[14,1796,1797,1806,1807,1809],{},[42,1798,1799,1800,1802,1803,1805],{},"What does the ",[18,1801,1416],{}," attribute on ",[18,1804,1128],{}," do?","\nIt groups ",[18,1808,1128],{}," elements into an exclusive set: opening one closes any other open element with the same name. It behaves like radio buttons for disclosures and needs no script.",[14,1811,1812,1815],{},[42,1813,1814],{},"Why use a container query rather than a media query for this switch?","\nTab strips need horizontal room for all their labels. The same component may sit in a wide main column or a narrow sidebar, and only a container query knows how much room it actually has.",[34,1817,1819],{"id":1818},"related","Related",[1559,1821,1822,1827,1834,1841],{},[1562,1823,1824,1826],{},[23,1825,26],{"href":25}," — the parent guide.",[1562,1828,1829,1833],{},[23,1830,1832],{"href":1831},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure\u002F","CSS-Only Accordions and Disclosure"," — the accordion half in depth.",[1562,1835,1836,1840],{},[23,1837,1839],{"href":1838},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-template-areas-responsive-layouts\u002F","Grid Template Areas for Responsive Layouts"," — more grid placement techniques.",[1562,1842,1843,1847],{},[23,1844,1846],{"href":1845},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002F","Container Query Syntax Basics"," — the query that makes the switch.",[314,1849,1850],{},"html pre.shiki code .suds8, html code.shiki .suds8{--shiki-default:#0E1116;--shiki-dark:#F0F3F6}html pre.shiki code .sne4z, html code.shiki .sne4z{--shiki-default:#024C1A;--shiki-dark:#72F088}html pre.shiki code .s-5SL, html code.shiki .s-5SL{--shiki-default:#023B95;--shiki-dark:#91CBFF}html pre.shiki code .sT6z2, html code.shiki .sT6z2{--shiki-default:#032563;--shiki-dark:#ADDCFF}html pre.shiki code .sHUrx, html code.shiki .sHUrx{--shiki-default:#A0111F;--shiki-dark:#FF9492}html pre.shiki code .sLBg1, html code.shiki .sLBg1{--shiki-default:#66707B;--shiki-dark:#BDC4CC}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .soyes, html code.shiki .soyes{--shiki-default:#702C00;--shiki-dark:#FFB757}",{"title":197,"searchDepth":222,"depth":222,"links":1852},[1853,1854,1855,1857,1858,1859,1860,1861,1862],{"id":36,"depth":222,"text":37},{"id":182,"depth":222,"text":183},{"id":1412,"depth":222,"text":1856},"The key technique: exclusivity from the name attribute",{"id":1509,"depth":222,"text":1510},{"id":1556,"depth":222,"text":1557},{"id":1602,"depth":222,"text":1603},{"id":1747,"depth":222,"text":1748},{"id":1775,"depth":222,"text":1776},{"id":1818,"depth":222,"text":1819},"One accessible component that shows tabs in wide containers and stacked details disclosures in narrow ones, using the name attribute, grid and a query.","md",{"pageTitle":1866,"datePublished":1867,"dateModified":1867,"faq":1868},"Tabs That Become an Accordion When Narrow","2026-09-18",[1869,1871,1873,1876],{"q":1781,"a":1870},"Yes, if it is built from details elements that share a name attribute. The name makes them mutually exclusive, like tabs. In narrow containers they display as a normal stacked accordion; in wide containers CSS grid places every summary in a row at the top and the open panel below.",{"q":1793,"a":1872},"It is accessible as a set of disclosures: each summary is announced as a button that expands and collapses, and keyboard users Tab between them. It is not announced with the ARIA tabs pattern of tablist, tab and tabpanel. For many content sections that is acceptable; for application-style tabs with arrow-key navigation, use the ARIA pattern with script.",{"q":1874,"a":1875},"What does the name attribute on details do?","It groups details elements into an exclusive set: opening one closes any other open element with the same name. It behaves like radio buttons for disclosures and needs no script.",{"q":1814,"a":1877},"Tab strips need horizontal room for all their labels. The same component may sit in a wide main column or a narrow sidebar, and only a container query knows how much room it actually has.","\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions",{"title":5,"description":1863},"mastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions\u002Findex","S4aLhGuDkr-e2L1RyA_ukbw4tEihKneikto1jTtYwU4",[1883,1886,1889,1892,1895,1898,1901,1904,1907,1910,1913,1916,1919,1922,1925,1928,1931,1934,1937,1940,1943,1946,1949,1952,1955,1958,1961,1964,1967,1970,1973,1976,1979,1982,1985,1988,1991,1994,1997,2000,2003,2006,2009,2012,2015,2018,2021,2024,2027,2030,2033,2036,2039,2042,2045,2048,2051,2054,2057,2060,2063,2066,2069,2072,2075,2078,2081,2084,2087,2090,2093,2096,2099,2102,2105,2108,2111,2114,2117,2120,2123,2126,2129,2132,2135,2138,2141,2144,2147,2150,2153,2156,2159,2162,2164,2167,2170,2173,2176,2179,2182,2185,2188,2191,2194,2197,2200,2203,2206,2209,2212,2215,2218,2221,2224,2226,2229,2232,2235,2238,2241,2244,2247,2250,2253,2256,2259,2262,2265,2268,2271,2274,2277,2280,2283,2286,2289,2292,2295,2298,2301,2303,2306,2309,2312,2315,2318,2321,2324,2327,2330,2333,2336,2339,2342,2345,2348,2351,2354,2357,2360,2363,2366,2369,2372,2375,2378,2381,2384,2387,2388,2391,2394,2397,2400,2403,2406,2409,2412,2415,2418,2421,2424,2427,2430,2433,2436],{"path":1884,"title":1885},"\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":1887,"title":1888},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":1890,"title":1891},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":1893,"title":1894},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":1896,"title":1897},"\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":1899,"title":1900},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":1902,"title":1903},"\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":1905,"title":1906},"\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":1908,"title":1909},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":1911,"title":1912},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":1914,"title":1915},"\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":1917,"title":1918},"\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":1920,"title":1921},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":1923,"title":1924},"\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":1926,"title":1927},"\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":1929,"title":1930},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":1932,"title":1933},"\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":1935,"title":1936},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":1938,"title":1939},"\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":1941,"title":1942},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":1944,"title":1945},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":1947,"title":1948},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":1950,"title":1951},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":1953,"title":1954},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":1956,"title":1957},"\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":1959,"title":1960},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":1962,"title":1963},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":1965,"title":1966},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":1968,"title":1969},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":1971,"title":1972},"\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":1974,"title":1975},"\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":1977,"title":1978},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":1980,"title":1981},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":1983,"title":1984},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":1986,"title":1987},"\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":1989,"title":1990},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":1992,"title":1993},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":1995,"title":1996},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":1998,"title":1999},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":2001,"title":2002},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":2004,"title":2005},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":2007,"title":2008},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":2010,"title":2011},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":2013,"title":2014},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":2016,"title":2017},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"path":2019,"title":2020},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":2022,"title":2023},"\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":2025,"title":2026},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":2028,"title":2029},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":2031,"title":2032},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":2034,"title":2035},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":2037,"title":2038},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":2040,"title":2041},"\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":2043,"title":2044},"\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":2046,"title":2047},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":2049,"title":2050},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states","Button Press and  States",{"path":2052,"title":2053},"\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":2055,"title":2056},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":2058,"title":2059},"\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":2061,"title":2062},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":2064,"title":2065},"\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":2067,"title":2068},"\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":2070,"title":2071},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":2073,"title":2074},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking","Stacking Animations With animation-composition",{"path":2076,"title":2077},"\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":2079,"title":2080},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":2082,"title":2083},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":2085,"title":2086},"\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":2088,"title":2089},"\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":2091,"title":2092},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":2094,"title":2095},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":2097,"title":2098},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":2100,"title":2101},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply","Animating box-shadow and Filters Cheaply",{"path":2103,"title":2104},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":2106,"title":2107},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite","Layout, Paint and Composite: What Triggers What",{"path":2109,"title":2110},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":2112,"title":2113},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":2115,"title":2116},"\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":2118,"title":2119},"\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":2121,"title":2122},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":2124,"title":2125},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":2127,"title":2128},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects","Scroll-Driven Parallax Effects in CSS",{"path":2130,"title":2131},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":2133,"title":2134},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":2136,"title":2137},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":2139,"title":2140},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range","View Timelines and animation-range",{"path":2142,"title":2143},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":2145,"title":2146},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":2148,"title":2149},"\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":2151,"title":2152},"\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":2154,"title":2155},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":2157,"title":2158},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":2160,"title":2161},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":341,"title":2163},"Modern CSS Layouts & Micro-Interactions",{"path":2165,"title":2166},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":2168,"title":2169},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":2171,"title":2172},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":2174,"title":2175},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":2177,"title":2178},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":2180,"title":2181},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":2183,"title":2184},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":2186,"title":2187},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":2189,"title":2190},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":2192,"title":2193},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":2195,"title":2196},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":2198,"title":2199},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":2201,"title":2202},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":2204,"title":2205},"\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":2207,"title":2208},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":2210,"title":2211},"\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":2213,"title":2214},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":2216,"title":2217},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":2219,"title":2220},"\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":2222,"title":2223},"\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":2225,"title":1846},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics",{"path":2227,"title":2228},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":2230,"title":2231},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":2233,"title":2234},"\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":2236,"title":2237},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":2239,"title":2240},"\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":2242,"title":2243},"\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":2245,"title":2246},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":2248,"title":2249},"\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":2251,"title":2252},"\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":2254,"title":2255},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":2257,"title":2258},"\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":2260,"title":2261},"\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":2263,"title":2264},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":2266,"title":2267},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":2269,"title":2270},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":2272,"title":2273},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":2275,"title":2276},"\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":2278,"title":2279},"\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":2281,"title":2282},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":2284,"title":2285},"\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":2287,"title":2288},"\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":2290,"title":2291},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":2293,"title":2294},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":2296,"title":2297},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":2299,"title":2300},"\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":2302,"title":31},"\u002Fmastering-container-queries-responsive-layouts",{"path":2304,"title":2305},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":2307,"title":2308},"\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":2310,"title":2311},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":2313,"title":2314},"\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":2316,"title":2317},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":2319,"title":2320},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":2322,"title":2323},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":2325,"title":2326},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":2328,"title":2329},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":2331,"title":2332},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":2334,"title":2335},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":2337,"title":2338},"\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":2340,"title":2341},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset","Writing a Minimal Modern CSS Reset: Every Line Justified",{"path":2343,"title":2344},"\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":2346,"title":2347},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has","Empty and Loading States With ()",{"path":2349,"title":2350},"\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":2352,"title":2353},"\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":2355,"title":2356},"\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":2358,"title":2359},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"path":2361,"title":2362},"\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":2364,"title":2365},"\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":2367,"title":2368},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":2370,"title":2371},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":2373,"title":2374},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":2376,"title":2377},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":2379,"title":2380},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":2382,"title":2383},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":2385,"title":2386},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":1878,"title":5},{"path":2389,"title":2390},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":2392,"title":2393},"\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":2395,"title":2396},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":2398,"title":2399},"\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":2401,"title":2402},"\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":2404,"title":2405},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":2407,"title":2408},"\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":2410,"title":2411},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":2413,"title":2414},"\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":2416,"title":2417},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":2419,"title":2420},"\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":2422,"title":2423},"\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":2425,"title":2426},"\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":2428,"title":2429},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":2431,"title":2432},"\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":2434,"title":2435},"\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":2437,"title":2438},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":2440,"caption":2441,"height":2442,"resizable":375,"html":2443,"css":2444},"details elements as an accordion or a tab strip","Narrow: an accordion. Drag the frame wider than about 36rem: the same markup becomes a tab row with the open panel below. Only one opens at a time.",300,"\n\u003Cdiv class=\"tabset-host\">\n  \u003Cdiv class=\"tabset\">\n    \u003Cdetails name=\"product\" open>\u003Csummary>Overview\u003C\u002Fsummary>\u003Cdiv class=\"panel\">\u003Cp>A lightweight two-person tent for three seasons.\u003C\u002Fp>\u003C\u002Fdiv>\u003C\u002Fdetails>\n    \u003Cdetails name=\"product\">\u003Csummary>Specifications\u003C\u002Fsummary>\u003Cdiv class=\"panel\">\u003Cp>1.4 kg · packed 42 × 14 cm · 2 doors.\u003C\u002Fp>\u003C\u002Fdiv>\u003C\u002Fdetails>\n    \u003Cdetails name=\"product\">\u003Csummary>Reviews\u003C\u002Fsummary>\u003Cdiv class=\"panel\">\u003Cp>\"Pitches in five minutes, even in wind.\"\u003C\u002Fp>\u003C\u002Fdiv>\u003C\u002Fdetails>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>","\nbody { place-items: start stretch; }\n.tabset-host { container-type: inline-size; }\n.tabset details { border: 1px solid var(--demo-border); border-radius: 8px; margin-block-end: 0.5rem; }\n.tabset summary { padding: 0.6rem 0.9rem; cursor: pointer; font-weight: 600; }\n.tabset summary:focus-visible { outline: 2px solid var(--demo-accent); outline-offset: 2px; }\n.tabset .panel { padding: 0 0.9rem 0.9rem; }\n.tabset .panel p { margin: 0; }\n@container (width > 36rem) {\n  .tabset { display: grid; grid-template-columns: repeat(3, auto) 1fr; grid-template-rows: auto 1fr; }\n  .tabset details { display: contents; }\n  .tabset summary { grid-row: 1; border: 1px solid var(--demo-border); border-block-end: 0; border-radius: 8px 8px 0 0; list-style: none; }\n  .tabset summary::-webkit-details-marker { display: none; }\n  .tabset details[open] > summary { background: var(--demo-surface); color: var(--demo-accent); }\n  .tabset details::details-content { grid-row: 2; grid-column: 1 \u002F -1; }\n  .tabset .panel { padding: 1rem; border: 1px solid var(--demo-border); border-radius: 0 8px 8px 8px; }\n}",1789717749544]