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