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