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