[{"data":1,"prerenderedAt":2124},["ShallowReactive",2],{"page-\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states":3,"content-all-pages":1559,"live-demo:button-press-states":2118},{"id":4,"title":5,"body":6,"description":1539,"extension":1540,"meta":1541,"navigation":388,"path":1555,"seo":1556,"stem":1557,"__hash__":1558},"content\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states\u002Findex.md","Button Press and  States",{"type":7,"value":8,"toc":1527},"minimark",[9,18,33,38,62,161,165,168,172,1161,1168,1172,1192,1241,1244,1250,1255,1302,1308,1312,1327,1346,1350,1404,1408,1422,1426,1449,1453,1468,1474,1486,1492,1496,1524],[10,11,13,14,17],"h1",{"id":12},"button-press-and-states","Button Press and ",[15,16],"active",{}," States",[19,20,21,22,27,28,32],"p",{},"Hover says \"this is interactive\"; the press says \"I heard you\". A button that does not visibly react to being pressed feels broken on touch screens, where there is no hover to prepare the user and the finger covers most of the target. The fix is small — a slight depression, a darker fill — but the details decide whether it feels crisp or mushy: how fast the press lands, how long the release takes, whether it works for taps and keyboard presses as well as mouse clicks, and how the disabled state differs from all of these. This page builds a complete button state set with CSS alone. It belongs to ",[23,24,26],"a",{"href":25},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002F","Hover & Focus State Design"," in the ",[23,29,31],{"href":30},"\u002Fcss-only-micro-interactions-animations\u002F","CSS-Only Micro-Interactions & Animations"," guide.",[34,35,37],"h2",{"id":36},"the-five-states-of-a-button","The five states of a button",[19,39,40,41,45,46,49,50,53,54,57,58,61],{},"A robust button has five visual states, and each has a different job. ",[42,43,44],"strong",{},"Rest"," establishes the button. ",[42,47,48],{},"Hover"," confirms that a pointer is over it. ",[42,51,52],{},"Focus-visible"," shows keyboard users where they are. ",[42,55,56],{},"Active"," acknowledges the press. ",[42,59,60],{},"Disabled"," says the action is unavailable. The active state is the shortest-lived, usually shown for well under a second, and it overlaps with the others: a mouse press is hovered and active at once, a Space-key press is focused and active.",[63,64,70,71,70,75,70,79,70,87,70,97,70,101,70,104,70,113,70,118,70,122,70,128,70,131,70,134,70,138,70,142,70,146,70,149,70,152,70,155,70,158],"svg",{"viewBox":65,"role":66,"ariaLabel":67,"xmlns":68,"style":69},"0 0 720 280","img","Five button states side by side: rest, hover, focus-visible, active and disabled, each with its visual treatment","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[72,73,74],"title",{},"Five states, five jobs",[76,77,78],"desc",{},"Five buttons in a row. Rest: solid blue with a small shadow. Hover: a lighter fill. Focus-visible: rest appearance plus a two-pixel outline offset from the edge. Active: darker, pushed down two pixels, shadow nearly gone. Disabled: muted grey with no shadow.",[80,81,86],"text",{"textAnchor":82,"x":83,"y":84,"style":85},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","One button, five states",[88,89],"rect",{"x":90,"y":91,"width":92,"height":93,"rx":94,"fill":95,"opacity":96},"40","92","112","44","8","#7aa2ff","0.85",[88,98],{"x":99,"y":91,"width":92,"height":93,"rx":94,"fill":95,"opacity":100},"176","1",[88,102],{"x":103,"y":91,"width":92,"height":93,"rx":94,"fill":95,"opacity":96},"312",[105,106],"path",{"d":107,"fill":108,"stroke":109,"strokeWidth":110,"strokeDashArray":111},"M308 86 H428 V142 H308 Z","none","currentColor","2",[112],"0",[88,114],{"x":115,"y":116,"width":92,"height":93,"rx":94,"fill":95,"opacity":117},"448","94","0.6",[88,119],{"x":120,"y":91,"width":92,"height":93,"rx":94,"fill":109,"opacity":121},"584","0.15",[80,123,127],{"textAnchor":82,"x":124,"y":125,"style":126},"96","119","text-anchor:middle;fill:currentColor;font:600 13px sans-serif","Save",[80,129,127],{"textAnchor":82,"x":130,"y":125,"style":126},"232",[80,132,127],{"textAnchor":82,"x":133,"y":125,"style":126},"368",[80,135,127],{"textAnchor":82,"x":136,"y":137,"style":126},"504","121",[80,139,127],{"textAnchor":82,"x":140,"y":125,"style":141},"640","text-anchor:middle;fill:currentColor;font:600 13px sans-serif;opacity:0.6",[80,143,145],{"textAnchor":82,"x":124,"y":99,"style":144},"text-anchor:middle;fill:currentColor;font:12px sans-serif","rest",[80,147,148],{"textAnchor":82,"x":130,"y":99,"style":144},"hover: lighter",[80,150,151],{"textAnchor":82,"x":133,"y":99,"style":144},"focus: outline",[80,153,154],{"textAnchor":82,"x":136,"y":99,"style":144},"active: press",[80,156,157],{"textAnchor":82,"x":140,"y":99,"style":144},"disabled: flat",[80,159,160],{"textAnchor":82,"x":83,"y":130,"style":144},"Active overlaps hover (mouse) and focus (Space key); it must read on top of either.",[34,162,164],{"id":163},"the-complete-implementation","The complete implementation",[19,166,167],{},"Press the buttons in the demo with a mouse, a finger or the Space key. The press lands almost instantly; the release eases back.",[169,170],"live-demo",{"name":171},"button-press-states",[173,174,179],"pre",{"className":175,"code":176,"language":177,"meta":178,"style":178},"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>Button press states\u003C\u002Ftitle>\n\u003Cstyle>\n  body { font: 16px\u002F1.5 system-ui, sans-serif; margin: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; }\n\n  .btn {\n    --btn-bg: #2563eb;\n    font: inherit;\n    font-weight: 600;\n    padding: 0.625rem 1.25rem;\n    min-block-size: 44px;\n    border: 0;\n    border-radius: 8px;\n    color: #fff;\n    background: var(--btn-bg);\n    box-shadow: 0 2px 0 #1e40af, 0 3px 6px rgb(0 0 0 \u002F 0.15);\n    cursor: pointer;\n    \u002F* Release: a relaxed return. *\u002F\n    transition:\n      translate 200ms cubic-bezier(0.2, 0, 0, 1),\n      box-shadow 200ms cubic-bezier(0.2, 0, 0, 1),\n      background-color 150ms ease-out;\n  }\n\n  @media (hover: hover) {\n    .btn:hover { --btn-bg: #3b82f6; }\n  }\n\n  .btn:focus-visible {\n    outline: 2px solid #1d4ed8;\n    outline-offset: 3px;\n  }\n\n  .btn:active {\n    --btn-bg: #1d4ed8;\n    translate: 0 2px;\n    box-shadow: 0 0 0 #1e40af, 0 1px 2px rgb(0 0 0 \u002F 0.2);\n    \u002F* Press: nearly instant. *\u002F\n    transition-duration: 60ms;\n  }\n\n  .btn:disabled {\n    --btn-bg: #94a3b8;\n    color: #f1f5f9;\n    box-shadow: none;\n    translate: none;\n    cursor: not-allowed;\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    .btn:active { translate: none; }   \u002F* keep the colour change, drop the movement *\u002F\n  }\n\u003C\u002Fstyle>\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Cbutton class=\"btn\" type=\"button\">Save\u003C\u002Fbutton>\n  \u003Cbutton class=\"btn\" type=\"button\">Publish\u003C\u002Fbutton>\n  \u003Cbutton class=\"btn\" type=\"button\" disabled>Delete\u003C\u002Fbutton>\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n","html","",[180,181,182,202,222,232,250,275,289,299,383,390,399,414,427,440,460,474,486,500,513,533,586,599,606,615,650,680,696,702,707,726,743,748,753,761,781,796,801,806,814,826,842,886,892,907,912,917,925,937,949,960,971,983,988,993,1001,1022,1027,1037,1046,1056,1088,1114,1143,1152],"code",{"__ignoreMap":178},[183,184,187,191,195,199],"span",{"class":185,"line":186},"line",1,[183,188,190],{"class":189},"suds8","\u003C!",[183,192,194],{"class":193},"sne4z","doctype",[183,196,198],{"class":197},"s-5SL"," html",[183,200,201],{"class":189},">\n",[183,203,205,208,210,213,216,220],{"class":185,"line":204},2,[183,206,207],{"class":189},"\u003C",[183,209,177],{"class":193},[183,211,212],{"class":197}," lang",[183,214,215],{"class":189},"=",[183,217,219],{"class":218},"sT6z2","\"en\"",[183,221,201],{"class":189},[183,223,225,227,230],{"class":185,"line":224},3,[183,226,207],{"class":189},[183,228,229],{"class":193},"head",[183,231,201],{"class":189},[183,233,235,237,240,243,245,248],{"class":185,"line":234},4,[183,236,207],{"class":189},[183,238,239],{"class":193},"meta",[183,241,242],{"class":197}," charset",[183,244,215],{"class":189},[183,246,247],{"class":218},"\"utf-8\"",[183,249,201],{"class":189},[183,251,253,255,257,260,262,265,268,270,273],{"class":185,"line":252},5,[183,254,207],{"class":189},[183,256,239],{"class":193},[183,258,259],{"class":197}," name",[183,261,215],{"class":189},[183,263,264],{"class":218},"\"viewport\"",[183,266,267],{"class":197}," content",[183,269,215],{"class":189},[183,271,272],{"class":218},"\"width=device-width, initial-scale=1\"",[183,274,201],{"class":189},[183,276,278,280,282,285,287],{"class":185,"line":277},6,[183,279,207],{"class":189},[183,281,72],{"class":193},[183,283,284],{"class":189},">Button press states\u003C\u002F",[183,286,72],{"class":193},[183,288,201],{"class":189},[183,290,292,294,297],{"class":185,"line":291},7,[183,293,207],{"class":189},[183,295,296],{"class":193},"style",[183,298,201],{"class":189},[183,300,302,305,308,311,314,317,321,324,327,330,333,336,339,342,344,346,349,351,354,356,359,361,364,366,368,370,372,375,377,380],{"class":185,"line":301},8,[183,303,304],{"class":193},"  body",[183,306,307],{"class":189}," { ",[183,309,310],{"class":197},"font",[183,312,313],{"class":189},": ",[183,315,316],{"class":197},"16",[183,318,320],{"class":319},"sHUrx","px",[183,322,323],{"class":189},"\u002F",[183,325,326],{"class":197},"1.5",[183,328,329],{"class":197}," system-ui",[183,331,332],{"class":189},", ",[183,334,335],{"class":197},"sans-serif",[183,337,338],{"class":189},"; ",[183,340,341],{"class":197},"margin",[183,343,313],{"class":189},[183,345,110],{"class":197},[183,347,348],{"class":319},"rem",[183,350,338],{"class":189},[183,352,353],{"class":197},"display",[183,355,313],{"class":189},[183,357,358],{"class":197},"flex",[183,360,338],{"class":189},[183,362,363],{"class":197},"gap",[183,365,313],{"class":189},[183,367,100],{"class":197},[183,369,348],{"class":319},[183,371,338],{"class":189},[183,373,374],{"class":197},"flex-wrap",[183,376,313],{"class":189},[183,378,379],{"class":197},"wrap",[183,381,382],{"class":189},"; }\n",[183,384,386],{"class":185,"line":385},9,[183,387,389],{"emptyLinePlaceholder":388},true,"\n",[183,391,393,396],{"class":185,"line":392},10,[183,394,395],{"class":197},"  .btn",[183,397,398],{"class":189}," {\n",[183,400,402,406,408,411],{"class":185,"line":401},11,[183,403,405],{"class":404},"soyes","    --btn-bg",[183,407,313],{"class":189},[183,409,410],{"class":197},"#2563eb",[183,412,413],{"class":189},";\n",[183,415,417,420,422,425],{"class":185,"line":416},12,[183,418,419],{"class":197},"    font",[183,421,313],{"class":189},[183,423,424],{"class":197},"inherit",[183,426,413],{"class":189},[183,428,430,433,435,438],{"class":185,"line":429},13,[183,431,432],{"class":197},"    font-weight",[183,434,313],{"class":189},[183,436,437],{"class":197},"600",[183,439,413],{"class":189},[183,441,443,446,448,451,453,456,458],{"class":185,"line":442},14,[183,444,445],{"class":197},"    padding",[183,447,313],{"class":189},[183,449,450],{"class":197},"0.625",[183,452,348],{"class":319},[183,454,455],{"class":197}," 1.25",[183,457,348],{"class":319},[183,459,413],{"class":189},[183,461,463,466,468,470,472],{"class":185,"line":462},15,[183,464,465],{"class":197},"    min-block-size",[183,467,313],{"class":189},[183,469,93],{"class":197},[183,471,320],{"class":319},[183,473,413],{"class":189},[183,475,477,480,482,484],{"class":185,"line":476},16,[183,478,479],{"class":197},"    border",[183,481,313],{"class":189},[183,483,112],{"class":197},[183,485,413],{"class":189},[183,487,489,492,494,496,498],{"class":185,"line":488},17,[183,490,491],{"class":197},"    border-radius",[183,493,313],{"class":189},[183,495,94],{"class":197},[183,497,320],{"class":319},[183,499,413],{"class":189},[183,501,503,506,508,511],{"class":185,"line":502},18,[183,504,505],{"class":197},"    color",[183,507,313],{"class":189},[183,509,510],{"class":197},"#fff",[183,512,413],{"class":189},[183,514,516,519,521,524,527,530],{"class":185,"line":515},19,[183,517,518],{"class":197},"    background",[183,520,313],{"class":189},[183,522,523],{"class":197},"var",[183,525,526],{"class":189},"(",[183,528,529],{"class":404},"--btn-bg",[183,531,532],{"class":189},");\n",[183,534,536,539,541,543,546,548,551,554,556,558,561,563,566,568,571,573,575,577,579,582,584],{"class":185,"line":535},20,[183,537,538],{"class":197},"    box-shadow",[183,540,313],{"class":189},[183,542,112],{"class":197},[183,544,545],{"class":197}," 2",[183,547,320],{"class":319},[183,549,550],{"class":197}," 0",[183,552,553],{"class":197}," #1e40af",[183,555,332],{"class":189},[183,557,112],{"class":197},[183,559,560],{"class":197}," 3",[183,562,320],{"class":319},[183,564,565],{"class":197}," 6",[183,567,320],{"class":319},[183,569,570],{"class":197}," rgb",[183,572,526],{"class":189},[183,574,112],{"class":197},[183,576,550],{"class":197},[183,578,550],{"class":197},[183,580,581],{"class":189}," \u002F ",[183,583,121],{"class":197},[183,585,532],{"class":189},[183,587,589,592,594,597],{"class":185,"line":588},21,[183,590,591],{"class":197},"    cursor",[183,593,313],{"class":189},[183,595,596],{"class":197},"pointer",[183,598,413],{"class":189},[183,600,602],{"class":185,"line":601},22,[183,603,605],{"class":604},"sLBg1","    \u002F* Release: a relaxed return. *\u002F\n",[183,607,609,612],{"class":185,"line":608},23,[183,610,611],{"class":197},"    transition",[183,613,614],{"class":189},":\n",[183,616,618,621,624,627,630,632,635,637,639,641,643,645,647],{"class":185,"line":617},24,[183,619,620],{"class":189},"      translate ",[183,622,623],{"class":197},"200",[183,625,626],{"class":319},"ms",[183,628,629],{"class":197}," cubic-bezier",[183,631,526],{"class":189},[183,633,634],{"class":197},"0.2",[183,636,332],{"class":189},[183,638,112],{"class":197},[183,640,332],{"class":189},[183,642,112],{"class":197},[183,644,332],{"class":189},[183,646,100],{"class":197},[183,648,649],{"class":189},"),\n",[183,651,653,656,658,660,662,664,666,668,670,672,674,676,678],{"class":185,"line":652},25,[183,654,655],{"class":189},"      box-shadow ",[183,657,623],{"class":197},[183,659,626],{"class":319},[183,661,629],{"class":197},[183,663,526],{"class":189},[183,665,634],{"class":197},[183,667,332],{"class":189},[183,669,112],{"class":197},[183,671,332],{"class":189},[183,673,112],{"class":197},[183,675,332],{"class":189},[183,677,100],{"class":197},[183,679,649],{"class":189},[183,681,683,686,689,691,694],{"class":185,"line":682},26,[183,684,685],{"class":189},"      background-color ",[183,687,688],{"class":197},"150",[183,690,626],{"class":319},[183,692,693],{"class":197}," ease-out",[183,695,413],{"class":189},[183,697,699],{"class":185,"line":698},27,[183,700,701],{"class":189},"  }\n",[183,703,705],{"class":185,"line":704},28,[183,706,389],{"emptyLinePlaceholder":388},[183,708,710,713,716,719,721,723],{"class":185,"line":709},29,[183,711,712],{"class":319},"  @media",[183,714,715],{"class":189}," (",[183,717,718],{"class":197},"hover",[183,720,313],{"class":189},[183,722,718],{"class":197},[183,724,725],{"class":189},") {\n",[183,727,729,732,734,736,738,741],{"class":185,"line":728},30,[183,730,731],{"class":197},"    .btn:hover",[183,733,307],{"class":189},[183,735,529],{"class":404},[183,737,313],{"class":189},[183,739,740],{"class":197},"#3b82f6",[183,742,382],{"class":189},[183,744,746],{"class":185,"line":745},31,[183,747,701],{"class":189},[183,749,751],{"class":185,"line":750},32,[183,752,389],{"emptyLinePlaceholder":388},[183,754,756,759],{"class":185,"line":755},33,[183,757,758],{"class":197},"  .btn:focus-visible",[183,760,398],{"class":189},[183,762,764,767,769,771,773,776,779],{"class":185,"line":763},34,[183,765,766],{"class":197},"    outline",[183,768,313],{"class":189},[183,770,110],{"class":197},[183,772,320],{"class":319},[183,774,775],{"class":197}," solid",[183,777,778],{"class":197}," #1d4ed8",[183,780,413],{"class":189},[183,782,784,787,789,792,794],{"class":185,"line":783},35,[183,785,786],{"class":197},"    outline-offset",[183,788,313],{"class":189},[183,790,791],{"class":197},"3",[183,793,320],{"class":319},[183,795,413],{"class":189},[183,797,799],{"class":185,"line":798},36,[183,800,701],{"class":189},[183,802,804],{"class":185,"line":803},37,[183,805,389],{"emptyLinePlaceholder":388},[183,807,809,812],{"class":185,"line":808},38,[183,810,811],{"class":197},"  .btn:active",[183,813,398],{"class":189},[183,815,817,819,821,824],{"class":185,"line":816},39,[183,818,405],{"class":404},[183,820,313],{"class":189},[183,822,823],{"class":197},"#1d4ed8",[183,825,413],{"class":189},[183,827,829,832,834,836,838,840],{"class":185,"line":828},40,[183,830,831],{"class":197},"    translate",[183,833,313],{"class":189},[183,835,112],{"class":197},[183,837,545],{"class":197},[183,839,320],{"class":319},[183,841,413],{"class":189},[183,843,845,847,849,851,853,855,857,859,861,864,866,868,870,872,874,876,878,880,882,884],{"class":185,"line":844},41,[183,846,538],{"class":197},[183,848,313],{"class":189},[183,850,112],{"class":197},[183,852,550],{"class":197},[183,854,550],{"class":197},[183,856,553],{"class":197},[183,858,332],{"class":189},[183,860,112],{"class":197},[183,862,863],{"class":197}," 1",[183,865,320],{"class":319},[183,867,545],{"class":197},[183,869,320],{"class":319},[183,871,570],{"class":197},[183,873,526],{"class":189},[183,875,112],{"class":197},[183,877,550],{"class":197},[183,879,550],{"class":197},[183,881,581],{"class":189},[183,883,634],{"class":197},[183,885,532],{"class":189},[183,887,889],{"class":185,"line":888},42,[183,890,891],{"class":604},"    \u002F* Press: nearly instant. *\u002F\n",[183,893,895,898,900,903,905],{"class":185,"line":894},43,[183,896,897],{"class":197},"    transition-duration",[183,899,313],{"class":189},[183,901,902],{"class":197},"60",[183,904,626],{"class":319},[183,906,413],{"class":189},[183,908,910],{"class":185,"line":909},44,[183,911,701],{"class":189},[183,913,915],{"class":185,"line":914},45,[183,916,389],{"emptyLinePlaceholder":388},[183,918,920,923],{"class":185,"line":919},46,[183,921,922],{"class":197},"  .btn:disabled",[183,924,398],{"class":189},[183,926,928,930,932,935],{"class":185,"line":927},47,[183,929,405],{"class":404},[183,931,313],{"class":189},[183,933,934],{"class":197},"#94a3b8",[183,936,413],{"class":189},[183,938,940,942,944,947],{"class":185,"line":939},48,[183,941,505],{"class":197},[183,943,313],{"class":189},[183,945,946],{"class":197},"#f1f5f9",[183,948,413],{"class":189},[183,950,952,954,956,958],{"class":185,"line":951},49,[183,953,538],{"class":197},[183,955,313],{"class":189},[183,957,108],{"class":197},[183,959,413],{"class":189},[183,961,963,965,967,969],{"class":185,"line":962},50,[183,964,831],{"class":197},[183,966,313],{"class":189},[183,968,108],{"class":197},[183,970,413],{"class":189},[183,972,974,976,978,981],{"class":185,"line":973},51,[183,975,591],{"class":197},[183,977,313],{"class":189},[183,979,980],{"class":197},"not-allowed",[183,982,413],{"class":189},[183,984,986],{"class":185,"line":985},52,[183,987,701],{"class":189},[183,989,991],{"class":185,"line":990},53,[183,992,389],{"emptyLinePlaceholder":388},[183,994,996,998],{"class":185,"line":995},54,[183,997,712],{"class":319},[183,999,1000],{"class":189}," (prefers-reduced-motion: reduce) {\n",[183,1002,1004,1007,1009,1012,1014,1016,1019],{"class":185,"line":1003},55,[183,1005,1006],{"class":197},"    .btn:active",[183,1008,307],{"class":189},[183,1010,1011],{"class":197},"translate",[183,1013,313],{"class":189},[183,1015,108],{"class":197},[183,1017,1018],{"class":189},"; }   ",[183,1020,1021],{"class":604},"\u002F* keep the colour change, drop the movement *\u002F\n",[183,1023,1025],{"class":185,"line":1024},56,[183,1026,701],{"class":189},[183,1028,1030,1033,1035],{"class":185,"line":1029},57,[183,1031,1032],{"class":189},"\u003C\u002F",[183,1034,296],{"class":193},[183,1036,201],{"class":189},[183,1038,1040,1042,1044],{"class":185,"line":1039},58,[183,1041,1032],{"class":189},[183,1043,229],{"class":193},[183,1045,201],{"class":189},[183,1047,1049,1051,1054],{"class":185,"line":1048},59,[183,1050,207],{"class":189},[183,1052,1053],{"class":193},"body",[183,1055,201],{"class":189},[183,1057,1059,1062,1065,1068,1070,1073,1076,1078,1081,1084,1086],{"class":185,"line":1058},60,[183,1060,1061],{"class":189},"  \u003C",[183,1063,1064],{"class":193},"button",[183,1066,1067],{"class":197}," class",[183,1069,215],{"class":189},[183,1071,1072],{"class":218},"\"btn\"",[183,1074,1075],{"class":197}," type",[183,1077,215],{"class":189},[183,1079,1080],{"class":218},"\"button\"",[183,1082,1083],{"class":189},">Save\u003C\u002F",[183,1085,1064],{"class":193},[183,1087,201],{"class":189},[183,1089,1091,1093,1095,1097,1099,1101,1103,1105,1107,1110,1112],{"class":185,"line":1090},61,[183,1092,1061],{"class":189},[183,1094,1064],{"class":193},[183,1096,1067],{"class":197},[183,1098,215],{"class":189},[183,1100,1072],{"class":218},[183,1102,1075],{"class":197},[183,1104,215],{"class":189},[183,1106,1080],{"class":218},[183,1108,1109],{"class":189},">Publish\u003C\u002F",[183,1111,1064],{"class":193},[183,1113,201],{"class":189},[183,1115,1117,1119,1121,1123,1125,1127,1129,1131,1133,1136,1139,1141],{"class":185,"line":1116},62,[183,1118,1061],{"class":189},[183,1120,1064],{"class":193},[183,1122,1067],{"class":197},[183,1124,215],{"class":189},[183,1126,1072],{"class":218},[183,1128,1075],{"class":197},[183,1130,215],{"class":189},[183,1132,1080],{"class":218},[183,1134,1135],{"class":197}," disabled",[183,1137,1138],{"class":189},">Delete\u003C\u002F",[183,1140,1064],{"class":193},[183,1142,201],{"class":189},[183,1144,1146,1148,1150],{"class":185,"line":1145},63,[183,1147,1032],{"class":189},[183,1149,1053],{"class":193},[183,1151,201],{"class":189},[183,1153,1155,1157,1159],{"class":185,"line":1154},64,[183,1156,1032],{"class":189},[183,1158,177],{"class":193},[183,1160,201],{"class":189},[19,1162,1163,1164,1167],{},"The button translates down by exactly the height of its hard bottom shadow (2px) while the shadow collapses to zero. That pairing is what makes it read as a physical key being pushed into the surface rather than a box sliding downwards. Hover is confined to ",[180,1165,1166],{},"@media (hover: hover)"," so touch devices, which emulate hover on tap, do not show a hover colour that then sticks after the finger lifts.",[34,1169,1171],{"id":1170},"the-key-technique-asymmetric-timing","The key technique: asymmetric timing",[19,1173,1174,1175,1178,1179,1182,1183,1187,1188,1191],{},"The transition declared on ",[180,1176,1177],{},".btn"," governs the return to rest; the one on ",[180,1180,1181],{},".btn:active"," governs the press. CSS always uses the transition values of the state being ",[1184,1185,1186],"em",{},"entered",", so the press (entering ",[180,1189,1190],{},":active",") runs in 60ms and the release (leaving it) in 200ms. That asymmetry matches physical expectations: a key goes down as fast as your finger pushes it and comes back up on its spring.",[63,1193,70,1196,70,1199,70,1202,70,1205,70,1208,70,1212,70,1218,70,1223,70,1227,70,1233,70,1237],{"viewBox":1194,"role":66,"ariaLabel":1195,"xmlns":68,"style":69},"0 0 720 260","Timing chart: press lasts 60 milliseconds with a steep curve, release lasts 200 milliseconds with a gentle curve",[72,1197,1198],{},"Fast in, slow out",[76,1200,1201],{},"A chart of the button's vertical offset over time. The press drops from zero to two pixels in 60 milliseconds, shown as a steep line. The button is held down while the pointer is held. On release it returns over 200 milliseconds along a decelerating curve.",[80,1203,1204],{"textAnchor":82,"x":83,"y":84,"style":85},"Transition values come from the state being entered",[185,1206],{"x1":902,"y1":623,"x2":1207,"y2":623,"stroke":109,"strokeWidth":326,"opacity":117},"680",[105,1209],{"d":1210,"fill":108,"stroke":95,"strokeWidth":1211},"M60 80 H140 L170 170 H420 C470 170 520 90 620 80 H680","4",[80,1213,1217],{"textAnchor":82,"x":1214,"y":1215,"style":1216},"155","64","text-anchor:middle;fill:currentColor;font:600 12px sans-serif","press 60ms",[80,1219,1222],{"textAnchor":82,"x":1220,"y":1221,"style":144},"295","160","held down (translate 2px)",[80,1224,1226],{"textAnchor":82,"x":1225,"y":1215,"style":1216},"520","release 200ms",[80,1228,1232],{"textAnchor":82,"x":1229,"y":1230,"style":1231},"140","222","text-anchor:middle;fill:currentColor;font:11px sans-serif","pointerdown",[80,1234,1236],{"textAnchor":82,"x":1235,"y":1230,"style":1231},"420","pointerup",[80,1238,1240],{"textAnchor":82,"x":83,"y":1239,"style":144},"248","The line dropping means the button moving down into the surface.",[19,1242,1243],{},"A very quick tap can release before the 60ms press completes. Because transitions reverse from their current value, the button simply returns from wherever it reached; the user still sees a small dip. This is also why the press should be short: a 200ms press would barely have started before a quick tap ended.",[34,1245,1247,1249],{"id":1246},"on-touch-and-keyboard",[15,1248],{}," on touch and keyboard",[19,1251,1252,1254],{},[180,1253,1190],{}," behaves differently across input types, and a good button accounts for each:",[1256,1257,1258,1271,1288],"ul",{},[1259,1260,1261,1264,1265,1267,1268,1270],"li",{},[42,1262,1263],{},"Mouse",": active from ",[180,1266,1232],{}," until ",[180,1269,1236],{},", while hovered. Reliable everywhere.",[1259,1272,1273,1276,1277,1279,1280,1283,1284,1287],{},[42,1274,1275],{},"Touch",": most browsers apply ",[180,1278,1190],{}," on touch, but some mobile browsers only do so when the page has a ",[180,1281,1282],{},"touchstart"," listener somewhere. Adding ",[180,1285,1286],{},"document.addEventListener('touchstart', () => {}, { passive: true })"," once is a well-known, harmless workaround. Even without it, the release transition often remains visible.",[1259,1289,1290,1293,1294,1296,1297,1301],{},[42,1291,1292],{},"Keyboard",": holding Space on a focused button typically applies ",[180,1295,1190],{}," until the key is released; Enter activates immediately on keydown with little or no visible active state. Keyboard users rely on focus-visible more than on the press, so the focus outline must be strong on its own. ",[23,1298,1300],{"href":1299},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fcreating-accessible-focus-indicators\u002F","Creating Accessible Focus Indicators"," covers outline contrast.",[19,1303,1304,1305,1307],{},"Finally, remember that activation happens on release for pointer input. The press state is feedback, not the action; users who press and then drag off the button cancel the click, and the button springs back without firing. That forgiving behaviour is worth preserving — do not trigger actions on ",[180,1306,1232],{}," just to feel faster.",[34,1309,1311],{"id":1310},"disabled-states-that-still-communicate","Disabled states that still communicate",[19,1313,1314,1315,1318,1319,1322,1323,1326],{},"A disabled button must look unavailable, but it still has to be readable, because a user who cannot find out ",[1184,1316,1317],{},"what"," is disabled cannot work out ",[1184,1320,1321],{},"why",". Muted colours, no shadow, no press movement and ",[180,1324,1325],{},"cursor: not-allowed"," together communicate the state. WCAG 1.4.3 exempts inactive components from contrast minimums, yet keeping the label reasonably legible is kinder. Consider whether the button should be disabled at all: a form whose submit button is enabled and shows validation errors on press is often clearer than one whose button is silently greyed out until every field is right.",[19,1328,1329,1330,1333,1334,1337,1338,1341,1342,1345],{},"The ",[180,1331,1332],{},"disabled"," attribute also removes the button from the tab order, which hides it from keyboard users entirely. When that is undesirable, ",[180,1335,1336],{},"aria-disabled=\"true\""," keeps the button focusable while script prevents the action, and CSS can style ",[180,1339,1340],{},"[aria-disabled=\"true\"]"," exactly like ",[180,1343,1344],{},":disabled",".",[34,1347,1349],{"id":1348},"common-mistakes","Common mistakes",[1256,1351,1352,1369,1382,1391],{},[1259,1353,1354,1365,1366,1368],{},[42,1355,1356,1357,1360,1361,1364],{},"Animating ",[180,1358,1359],{},"margin-top"," or ",[180,1362,1363],{},"top"," for the press."," Both trigger layout, so the button's neighbours can shift by a pixel and the press costs a layout pass on every frame. ",[180,1367,1011],{}," moves the button visually without affecting layout.",[1259,1370,1371,1377,1378,1381],{},[42,1372,1373,1374,1345],{},"Transitioning ",[180,1375,1376],{},"all"," A ",[180,1379,1380],{},"transition: all"," on a button animates every property that changes, including the focus outline, the cursor-driven colour change and any property a theme switch touches, often with the slow release timing. List the properties that should move. An explicit list also documents the intended motion for whoever edits the button next.",[1259,1383,1384,1377,1387,1390],{},[42,1385,1386],{},"Scaling text-heavy buttons.",[180,1388,1389],{},"scale"," below about 0.95 visibly blurs and shrinks the label during the press. Keep scale subtle or use translation for text buttons.",[1259,1392,1393,1396,1397,1399,1400,1403],{},[42,1394,1395],{},"Forgetting the release on reduced motion."," Removing ",[180,1398,1011],{}," under ",[180,1401,1402],{},"prefers-reduced-motion"," is right, but keep the colour change: feedback that the press registered is not decorative motion, and users who reduce motion still need it.",[34,1405,1407],{"id":1406},"variation-press-feedback-for-icon-buttons-and-cards","Variation: press feedback for icon buttons and cards",[19,1409,1410,1411,1414,1415,1417,1418,1421],{},"Flat icon buttons have no shadow to collapse, so a subtle scale works better than translation: ",[180,1412,1413],{},"scale: 0.94"," on ",[180,1416,1190],{},", with the same asymmetric timing. For whole clickable cards, press feedback should be even smaller — ",[180,1419,1420],{},"scale: 0.99"," or a slight background tint — because large surfaces moving noticeably feel unstable. In every case, pair the motion with a colour change so the feedback survives when motion is reduced.",[34,1423,1425],{"id":1424},"browser-support","Browser support",[19,1427,1329,1428,332,1430,1432,1433,1436,1437,1439,1440,1442,1443,1445,1446,1448],{},[180,1429,1190],{},[180,1431,1344],{}," and ",[180,1434,1435],{},":focus-visible"," pseudo-classes are supported in every current browser; ",[180,1438,1435],{}," is supported in Chrome and Edge 86+, Firefox 85+ and Safari 15.4+. The standalone ",[180,1441,1011],{}," property is supported in Chrome and Edge 104+, Firefox 72+ and Safari 14.1+. The ",[180,1444,718],{}," media feature is supported in Chrome 38+, Edge 12+, Firefox 64+ and Safari 9+, and ",[180,1447,1402],{}," in Chrome 74+, Edge 79+, Firefox 63+ and Safari 10.1+.",[34,1450,1452],{"id":1451},"faq","FAQ",[19,1454,1455,1461,1462,1464,1465,1467],{},[42,1456,1457,1458,1460],{},"Why does my ",[15,1459],{}," style not show on mobile?","\nSome mobile browsers only apply ",[180,1463,1190],{}," when the page registers a touch listener, and a quick tap can release before the style paints. A document-level ",[180,1466,1282],{}," listener with an empty handler, or relying on the release transition to show feedback, makes the press visible.",[19,1469,1470,1473],{},[42,1471,1472],{},"Should the press animation be fast or slow?","\nThe press itself should be nearly instant, around 50 to 80 milliseconds, so the button responds under the finger. The release can be slower, 150 to 250 milliseconds, which gives a satisfying spring back without delaying the action.",[19,1475,1476,1482,1483,1485],{},[42,1477,1478,1479,1481],{},"Does ",[15,1480],{}," apply when a button is activated with the keyboard?","\nPressing Space on a focused button applies ",[180,1484,1190],{}," in most browsers while the key is held; pressing Enter usually activates immediately without a visible active state. Design the focus and active states so the button is clearly identifiable either way.",[19,1487,1488,1491],{},[42,1489,1490],{},"How should a disabled button look?","\nReduce contrast and remove press and hover feedback, but keep the label readable. WCAG exempts disabled controls from contrast minimums, yet users still need to read them to understand why an action is unavailable.",[34,1493,1495],{"id":1494},"related","Related",[1256,1497,1498,1503,1510,1517],{},[1259,1499,1500,1502],{},[23,1501,26],{"href":25}," — the parent guide.",[1259,1504,1505,1509],{},[23,1506,1508],{"href":1507},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fsmooth-hover-effects-without-javascript\u002F","Smooth Hover Effects Without JavaScript"," — the hover half of the state set.",[1259,1511,1512,1516],{},[23,1513,1515],{"href":1514},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Ftarget-size-and-pointer-accessibility\u002F","Target Size and Pointer Accessibility"," — sizing buttons for touch.",[1259,1518,1519,1523],{},[23,1520,1522],{"href":1521},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions\u002F","Interrupted and Reversing Transitions"," — why a quick tap still shows a dip.",[296,1525,1526],{},"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 .soyes, html code.shiki .soyes{--shiki-default:#702C00;--shiki-dark:#FFB757}html pre.shiki code .sLBg1, html code.shiki .sLBg1{--shiki-default:#66707B;--shiki-dark:#BDC4CC}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":178,"searchDepth":204,"depth":204,"links":1528},[1529,1530,1531,1532,1533,1534,1535,1536,1537,1538],{"id":36,"depth":204,"text":37},{"id":163,"depth":204,"text":164},{"id":1170,"depth":204,"text":1171},{"id":1246,"depth":204,"text":1249},{"id":1310,"depth":204,"text":1311},{"id":1348,"depth":204,"text":1349},{"id":1406,"depth":204,"text":1407},{"id":1424,"depth":204,"text":1425},{"id":1451,"depth":204,"text":1452},{"id":1494,"depth":204,"text":1495},"Make buttons feel pressed with CSS alone: asymmetric timing for press and release, :active on touch and keyboard, and disabled states that still read clearly.","md",{"pageTitle":1542,"datePublished":1543,"dateModified":1543,"faq":1544},"Button Press and :active States","2026-09-18",[1545,1548,1550,1553],{"q":1546,"a":1547},"Why does my :active style not show on mobile?","Some mobile browsers only apply :active when the page registers a touch listener, and a quick tap can release before the style paints. A document-level touchstart listener with an empty handler, or relying on the release transition to show feedback, makes the press visible.",{"q":1472,"a":1549},"The press itself should be nearly instant, around 50 to 80 milliseconds, so the button responds under the finger. The release can be slower, 150 to 250 milliseconds, which gives a satisfying spring back without delaying the action.",{"q":1551,"a":1552},"Does :active apply when a button is activated with the keyboard?","Pressing Space on a focused button applies :active in most browsers while the key is held; pressing Enter usually activates immediately without a visible active state. Design the focus and active states so the button is clearly identifiable either way.",{"q":1490,"a":1554},"Reduce contrast and remove press and hover feedback, but keep the label readable. WCAG exempts disabled controls from contrast minimums, yet users still need to read them to understand why an action is unavailable.","\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states",{"title":5,"description":1539},"css-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states\u002Findex","FUJLaTkaNianJXIRB5_1Z2X7X0wiSAD1rh79J5xgh30",[1560,1563,1566,1569,1572,1575,1578,1581,1584,1587,1590,1593,1596,1599,1602,1605,1608,1611,1614,1617,1620,1623,1626,1629,1632,1635,1638,1641,1644,1647,1650,1653,1656,1659,1662,1665,1668,1671,1674,1677,1680,1683,1686,1689,1692,1695,1698,1701,1704,1707,1710,1713,1716,1719,1722,1725,1726,1729,1732,1735,1738,1741,1744,1747,1750,1753,1756,1759,1762,1765,1768,1771,1774,1777,1780,1783,1786,1789,1792,1795,1798,1801,1804,1807,1810,1813,1816,1819,1822,1825,1828,1831,1834,1837,1839,1842,1845,1848,1851,1854,1857,1860,1863,1866,1869,1872,1875,1878,1881,1884,1887,1890,1893,1896,1899,1902,1905,1908,1911,1914,1917,1920,1923,1926,1929,1932,1935,1938,1941,1944,1947,1950,1953,1956,1959,1962,1965,1968,1971,1974,1977,1980,1983,1986,1989,1992,1995,1998,2001,2004,2007,2010,2013,2016,2019,2022,2025,2028,2031,2034,2037,2040,2043,2046,2049,2052,2055,2058,2061,2064,2067,2070,2073,2076,2079,2082,2085,2088,2091,2094,2097,2100,2103,2106,2109,2112,2115],{"path":1561,"title":1562},"\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":1564,"title":1565},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":1567,"title":1568},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":1570,"title":1571},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":1573,"title":1574},"\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":1576,"title":1577},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":1579,"title":1580},"\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":1582,"title":1583},"\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":1585,"title":1586},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":1588,"title":1589},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":1591,"title":1592},"\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":1594,"title":1595},"\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":1597,"title":1598},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":1600,"title":1601},"\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":1603,"title":1604},"\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":1606,"title":1607},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":1609,"title":1610},"\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":1612,"title":1613},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":1615,"title":1616},"\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":1618,"title":1619},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":1621,"title":1622},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":1624,"title":1625},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":1627,"title":1628},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":1630,"title":1631},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":1633,"title":1634},"\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":1636,"title":1637},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":1639,"title":1640},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":1642,"title":1643},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":1645,"title":1646},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":1648,"title":1649},"\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":1651,"title":1652},"\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":1654,"title":1655},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":1657,"title":1658},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":1660,"title":1661},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":1663,"title":1664},"\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":1666,"title":1667},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":1669,"title":1670},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":1672,"title":1673},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":1675,"title":1676},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":1678,"title":1679},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":1681,"title":1682},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":1684,"title":1685},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":1687,"title":1688},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":1690,"title":1691},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":1693,"title":1694},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"path":1696,"title":1697},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":1699,"title":1700},"\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":1702,"title":1703},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":1705,"title":1706},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":1708,"title":1709},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":1711,"title":1712},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":1714,"title":1715},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":1717,"title":1718},"\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":1720,"title":1721},"\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":1723,"title":1724},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":1555,"title":5},{"path":1727,"title":1728},"\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":1730,"title":1731},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":1733,"title":1734},"\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":1736,"title":1737},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":1739,"title":1740},"\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":1742,"title":1743},"\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":1745,"title":1746},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":1748,"title":1749},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking","Stacking Animations With animation-composition",{"path":1751,"title":1752},"\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":1754,"title":1755},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":1757,"title":1758},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":1760,"title":1761},"\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":1763,"title":1764},"\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":1766,"title":1767},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":1769,"title":1770},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":1772,"title":1773},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":1775,"title":1776},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply","Animating box-shadow and Filters Cheaply",{"path":1778,"title":1779},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":1781,"title":1782},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite","Layout, Paint and Composite: What Triggers What",{"path":1784,"title":1785},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":1787,"title":1788},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":1790,"title":1791},"\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":1793,"title":1794},"\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":1796,"title":1797},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":1799,"title":1800},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":1802,"title":1803},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects","Scroll-Driven Parallax Effects in CSS",{"path":1805,"title":1806},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":1808,"title":1809},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":1811,"title":1812},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":1814,"title":1815},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range","View Timelines and animation-range",{"path":1817,"title":1818},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":1820,"title":1821},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":1823,"title":1824},"\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":1826,"title":1827},"\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":1829,"title":1830},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":1832,"title":1833},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":1835,"title":1836},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":323,"title":1838},"Modern CSS Layouts & Micro-Interactions",{"path":1840,"title":1841},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":1843,"title":1844},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":1846,"title":1847},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":1849,"title":1850},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":1852,"title":1853},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":1855,"title":1856},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":1858,"title":1859},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":1861,"title":1862},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":1864,"title":1865},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":1867,"title":1868},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":1870,"title":1871},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":1873,"title":1874},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":1876,"title":1877},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":1879,"title":1880},"\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":1882,"title":1883},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":1885,"title":1886},"\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":1888,"title":1889},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":1891,"title":1892},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":1894,"title":1895},"\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":1897,"title":1898},"\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":1900,"title":1901},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics","Container Query Syntax Basics",{"path":1903,"title":1904},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":1906,"title":1907},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":1909,"title":1910},"\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":1912,"title":1913},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":1915,"title":1916},"\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":1918,"title":1919},"\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":1921,"title":1922},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":1924,"title":1925},"\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":1927,"title":1928},"\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":1930,"title":1931},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":1933,"title":1934},"\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":1936,"title":1937},"\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":1939,"title":1940},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":1942,"title":1943},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":1945,"title":1946},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":1948,"title":1949},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":1951,"title":1952},"\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":1954,"title":1955},"\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":1957,"title":1958},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":1960,"title":1961},"\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":1963,"title":1964},"\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":1966,"title":1967},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":1969,"title":1970},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":1972,"title":1973},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":1975,"title":1976},"\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":1978,"title":1979},"\u002Fmastering-container-queries-responsive-layouts","Mastering Container Queries & Responsive Layouts",{"path":1981,"title":1982},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":1984,"title":1985},"\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":1987,"title":1988},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":1990,"title":1991},"\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":1993,"title":1994},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":1996,"title":1997},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":1999,"title":2000},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":2002,"title":2003},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":2005,"title":2006},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":2008,"title":2009},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":2011,"title":2012},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":2014,"title":2015},"\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":2017,"title":2018},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset","Writing a Minimal Modern CSS Reset: Every Line Justified",{"path":2020,"title":2021},"\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":2023,"title":2024},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has","Empty and Loading States With ()",{"path":2026,"title":2027},"\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":2029,"title":2030},"\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":2032,"title":2033},"\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":2035,"title":2036},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"path":2038,"title":2039},"\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":2041,"title":2042},"\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":2044,"title":2045},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":2047,"title":2048},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":2050,"title":2051},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":2053,"title":2054},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":2056,"title":2057},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":2059,"title":2060},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":2062,"title":2063},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":2065,"title":2066},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions","Tabs That Become an Accordion: One Component, Two Layouts",{"path":2068,"title":2069},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":2071,"title":2072},"\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":2074,"title":2075},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":2077,"title":2078},"\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":2080,"title":2081},"\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":2083,"title":2084},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":2086,"title":2087},"\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":2089,"title":2090},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":2092,"title":2093},"\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":2095,"title":2096},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":2098,"title":2099},"\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":2101,"title":2102},"\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":2104,"title":2105},"\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":2107,"title":2108},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":2110,"title":2111},"\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":2113,"title":2114},"\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":2116,"title":2117},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":2119,"caption":2120,"height":2121,"html":2122,"css":2123},"Press, release, focus and disabled states","Press and hold a button, then release. The press lands in 60ms and the release eases back over 200ms. Tab to a button and hold Space to see the keyboard press.",160,"\n\u003Cdiv class=\"row\">\n  \u003Cbutton class=\"btn\" type=\"button\">Save\u003C\u002Fbutton>\n  \u003Cbutton class=\"btn\" type=\"button\">Publish\u003C\u002Fbutton>\n  \u003Cbutton class=\"btn\" type=\"button\" disabled>Delete\u003C\u002Fbutton>\n\u003C\u002Fdiv>","\n.row { display: flex; gap: 1rem; flex-wrap: wrap; padding: 1rem; }\n.btn { --btn-bg: #2563eb; font: inherit; font-weight: 600; padding: 0.625rem 1.25rem; min-block-size: 44px; border: 0; border-radius: 8px; color: #fff; background: var(--btn-bg); box-shadow: 0 2px 0 #1e40af, 0 3px 6px rgb(0 0 0 \u002F 0.15); cursor: pointer; transition: translate 200ms cubic-bezier(0.2, 0, 0, 1), box-shadow 200ms cubic-bezier(0.2, 0, 0, 1), background-color 150ms ease-out; }\n@media (hover: hover) { .btn:hover { --btn-bg: #3b82f6; } }\n.btn:focus-visible { outline: 2px solid var(--demo-accent); outline-offset: 3px; }\n.btn:active { --btn-bg: #1d4ed8; translate: 0 2px; box-shadow: 0 0 0 #1e40af, 0 1px 2px rgb(0 0 0 \u002F 0.2); transition-duration: 60ms; }\n.btn:disabled { --btn-bg: #94a3b8; color: #f1f5f9; box-shadow: none; translate: none; cursor: not-allowed; }\n@media (prefers-reduced-motion: reduce) { .btn:active { translate: none; } }",1789717748206]