[{"data":1,"prerenderedAt":1874},["ShallowReactive",2],{"page-\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset":3,"content-all-pages":1309,"live-demo:reset-box-sizing":1868},{"id":4,"title":5,"body":6,"description":1290,"extension":1291,"meta":1292,"navigation":204,"path":1305,"seo":1306,"stem":1307,"__hash__":1308},"content\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset\u002Findex.md","Writing a Minimal Modern CSS Reset: Every Line Justified",{"type":7,"value":8,"toc":1280},"minimark",[9,13,40,45,52,60,166,170,912,927,931,961,965,992,1078,1086,1090,1093,1147,1151,1154,1157,1167,1177,1181,1199,1203,1209,1218,1232,1244,1248,1276],[10,11,5],"h1",{"id":12},"writing-a-minimal-modern-css-reset-every-line-justified",[14,15,16,17,21,22,24,25,28,29,34,35,39],"p",{},"CSS resets were born when browsers disagreed about basic defaults: margins on ",[18,19,20],"code",{},"body",", the size of ",[18,23,10],{}," inside ",[18,26,27],{},"article",", the display type of HTML5 elements. Those disagreements are largely gone. What is left is a smaller job — setting a few defaults that make modern layout predictable — and a reset that still carries a decade of normalisation rules is mostly dead weight that nobody on the team can explain. The narrow problem this page solves is writing a reset of around twenty rules where each line has a reason you could defend in code review, organised in a cascade layer so it never fights component styles. It belongs to ",[30,31,33],"a",{"href":32},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002F","Modern CSS Reset Strategies"," in the ",[30,36,38],{"href":37},"\u002Fmastering-container-queries-responsive-layouts\u002F","Mastering Container Queries & Responsive Layouts"," guide.",[41,42,44],"h2",{"id":43},"why-smaller-is-better","Why smaller is better",[14,46,47,48,51],{},"Every rule in a reset applies to every page, and every rule is a default that component authors must know about. A reset that sets ",[18,49,50],{},"line-height: 1"," on headings, strips list styles from all lists and removes button borders forces every component to re-add what it needs, and new team members discover these defaults by surprise. A minimal reset changes only the defaults that are genuinely unhelpful in modern layout, and leaves the rest of the browser's sensible behaviour alone.",[14,53,54,55,59],{},"The test for each rule is simple: ",[56,57,58],"em",{},"what goes wrong without it?"," If nobody can answer, the rule does not belong. The rules below each come with their answer.",[61,62,68,69,68,73,68,77,68,85,68,95,68,101,68,106,68,111,68,114,68,117,68,120,68,123,68,126,68,130,68,133,68,136,68,140,68,145,68,149,68,153,68,156,68,160,68,163],"svg",{"viewBox":63,"role":64,"ariaLabel":65,"xmlns":66,"style":67},"0 0 720 320","img","Five groups of reset rules — box model, spacing, media, forms, typography and motion — each with the problem it prevents","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;height:auto;max-width:720px;margin:2rem 0","\n  ",[70,71,72],"title",{},"What each part of the reset prevents",[74,75,76],"desc",{},"Box model rules prevent padding from enlarging widths. Spacing rules prevent unexpected margins. Media rules prevent images overflowing and inline gaps. Form rules prevent inputs using a different font. Typography and motion rules prevent overflowing words and unrequested smooth scrolling.",[78,79,84],"text",{"textAnchor":80,"x":81,"y":82,"style":83},"middle","360","26","text-anchor:middle;fill:currentColor;font:700 17px sans-serif","Five groups, five problems",[86,87],"rect",{"x":88,"y":89,"width":90,"height":91,"rx":92,"fill":93,"opacity":94},"30","50","200","120","10","#7aa2ff","0.2",[78,96,100],{"textAnchor":80,"x":97,"y":98,"style":99},"130","76","text-anchor:middle;fill:currentColor;font:700 13px sans-serif","Box model",[78,102,105],{"textAnchor":80,"x":97,"y":103,"style":104},"102","text-anchor:middle;fill:currentColor;font:11px ui-monospace,monospace","box-sizing",[78,107,110],{"textAnchor":80,"x":97,"y":108,"style":109},"140","text-anchor:middle;fill:currentColor;font:12px sans-serif","padding widens boxes",[86,112],{"x":113,"y":89,"width":90,"height":91,"rx":92,"fill":93,"opacity":94},"260",[78,115,116],{"textAnchor":80,"x":81,"y":98,"style":99},"Spacing",[78,118,119],{"textAnchor":80,"x":81,"y":103,"style":104},"margin: 0",[78,121,122],{"textAnchor":80,"x":81,"y":108,"style":109},"surprise margins",[86,124],{"x":125,"y":89,"width":90,"height":91,"rx":92,"fill":93,"opacity":94},"490",[78,127,129],{"textAnchor":80,"x":128,"y":98,"style":99},"590","Media",[78,131,132],{"textAnchor":80,"x":128,"y":103,"style":104},"display: block",[78,134,135],{"textAnchor":80,"x":128,"y":108,"style":109},"overflow, baseline gap",[86,137],{"x":138,"y":139,"width":90,"height":91,"rx":92,"fill":93,"opacity":94},"145","186",[78,141,144],{"textAnchor":80,"x":142,"y":143,"style":99},"245","212","Forms",[78,146,148],{"textAnchor":80,"x":142,"y":147,"style":104},"238","font: inherit",[78,150,152],{"textAnchor":80,"x":142,"y":151,"style":109},"276","system font in inputs",[86,154],{"x":155,"y":139,"width":90,"height":91,"rx":92,"fill":93,"opacity":94},"375",[78,157,159],{"textAnchor":80,"x":158,"y":143,"style":99},"475","Text and motion",[78,161,162],{"textAnchor":80,"x":158,"y":147,"style":104},"overflow-wrap",[78,164,165],{"textAnchor":80,"x":158,"y":151,"style":109},"long words, motion",[41,167,169],{"id":168},"the-complete-implementation","The complete implementation",[171,172,177],"pre",{"className":173,"code":174,"language":175,"meta":176,"style":176},"language-css shiki shiki-themes github-light-high-contrast github-dark-high-contrast","\u002F* The reset lives in the first layer, so every later layer beats it. *\u002F\n@layer reset, tokens, base, components, utilities;\n\n@layer reset {\n  \u002F* 1. Width means the border box. Without this, adding padding to a\n        width: 100% element makes it overflow its parent. *\u002F\n  *, *::before, *::after {\n    box-sizing: border-box;\n  }\n\n  \u002F* 2. Remove default margins. Spacing is then decided by layout\n        (gap, stacks) rather than by per-element defaults that differ\n        between h1, p, ul and figure. *\u002F\n  * {\n    margin: 0;\n  }\n\n  \u002F* 3. Let percentage heights resolve against the viewport-height root,\n        and give the body a sensible minimum so short pages fill it. *\u002F\n  html { block-size: 100%; }\n  body { min-block-size: 100%; }\n\n  \u002F* 4. Readable defaults for body text; inherited everywhere. *\u002F\n  body {\n    line-height: 1.5;\n    -webkit-text-size-adjust: 100%;   \u002F* stop mobile Safari inflating text in landscape *\u002F\n  }\n\n  \u002F* 5. Media are blocks that never overflow their container. Inline images\n        otherwise sit on the text baseline and leave a small gap below. *\u002F\n  img, picture, video, canvas, svg {\n    display: block;\n    max-inline-size: 100%;\n  }\n\n  \u002F* 6. Form controls use the page font rather than the system UI font,\n        and inherit colour so dark themes do not need per-control rules. *\u002F\n  input, button, textarea, select {\n    font: inherit;\n    color: inherit;\n  }\n\n  \u002F* 7. Long words and URLs wrap instead of forcing horizontal scroll. *\u002F\n  p, h1, h2, h3, h4, h5, h6, li, figcaption {\n    overflow-wrap: break-word;\n  }\n\n  \u002F* 8. Headings wrap into balanced lines; paragraphs avoid orphans. *\u002F\n  h1, h2, h3, h4, h5, h6 { text-wrap: balance; }\n  p { text-wrap: pretty; }\n\n  \u002F* 9. Smooth scrolling only for users who have not asked for less motion. *\u002F\n  @media (prefers-reduced-motion: no-preference) {\n    html:focus-within { scroll-behavior: smooth; }\n  }\n\n  \u002F* 10. A dedicated class hides content visually but keeps it available\n         to assistive technology — the correct alternative to display:none\n         for labels and skip links. *\u002F\n  .visually-hidden:not(:focus):not(:active) {\n    position: absolute;\n    inline-size: 1px;\n    block-size: 1px;\n    overflow: hidden;\n    clip-path: inset(50%);\n    white-space: nowrap;\n  }\n}\n","css","",[18,178,179,188,199,206,214,220,226,253,268,274,279,285,291,297,304,317,322,327,333,339,362,381,386,392,399,412,430,435,440,446,452,479,492,506,511,516,522,528,551,564,576,581,586,592,638,651,656,661,667,705,717,722,728,737,758,763,768,774,780,786,812,825,841,855,868,888,901,906],{"__ignoreMap":176},[180,181,184],"span",{"class":182,"line":183},"line",1,[180,185,187],{"class":186},"sLBg1","\u002F* The reset lives in the first layer, so every later layer beats it. *\u002F\n",[180,189,191,195],{"class":182,"line":190},2,[180,192,194],{"class":193},"sHUrx","@layer",[180,196,198],{"class":197},"suds8"," reset, tokens, base, components, utilities;\n",[180,200,202],{"class":182,"line":201},3,[180,203,205],{"emptyLinePlaceholder":204},true,"\n",[180,207,209,211],{"class":182,"line":208},4,[180,210,194],{"class":193},[180,212,213],{"class":197}," reset {\n",[180,215,217],{"class":182,"line":216},5,[180,218,219],{"class":186},"  \u002F* 1. Width means the border box. Without this, adding padding to a\n",[180,221,223],{"class":182,"line":222},6,[180,224,225],{"class":186},"        width: 100% element makes it overflow its parent. *\u002F\n",[180,227,229,233,236,239,243,245,247,250],{"class":182,"line":228},7,[180,230,232],{"class":231},"sne4z","  *",[180,234,235],{"class":197},", ",[180,237,238],{"class":231},"*",[180,240,242],{"class":241},"s-5SL","::before",[180,244,235],{"class":197},[180,246,238],{"class":231},[180,248,249],{"class":241},"::after",[180,251,252],{"class":197}," {\n",[180,254,256,259,262,265],{"class":182,"line":255},8,[180,257,258],{"class":241},"    box-sizing",[180,260,261],{"class":197},": ",[180,263,264],{"class":241},"border-box",[180,266,267],{"class":197},";\n",[180,269,271],{"class":182,"line":270},9,[180,272,273],{"class":197},"  }\n",[180,275,277],{"class":182,"line":276},10,[180,278,205],{"emptyLinePlaceholder":204},[180,280,282],{"class":182,"line":281},11,[180,283,284],{"class":186},"  \u002F* 2. Remove default margins. Spacing is then decided by layout\n",[180,286,288],{"class":182,"line":287},12,[180,289,290],{"class":186},"        (gap, stacks) rather than by per-element defaults that differ\n",[180,292,294],{"class":182,"line":293},13,[180,295,296],{"class":186},"        between h1, p, ul and figure. *\u002F\n",[180,298,300,302],{"class":182,"line":299},14,[180,301,232],{"class":231},[180,303,252],{"class":197},[180,305,307,310,312,315],{"class":182,"line":306},15,[180,308,309],{"class":241},"    margin",[180,311,261],{"class":197},[180,313,314],{"class":241},"0",[180,316,267],{"class":197},[180,318,320],{"class":182,"line":319},16,[180,321,273],{"class":197},[180,323,325],{"class":182,"line":324},17,[180,326,205],{"emptyLinePlaceholder":204},[180,328,330],{"class":182,"line":329},18,[180,331,332],{"class":186},"  \u002F* 3. Let percentage heights resolve against the viewport-height root,\n",[180,334,336],{"class":182,"line":335},19,[180,337,338],{"class":186},"        and give the body a sensible minimum so short pages fill it. *\u002F\n",[180,340,342,345,348,351,353,356,359],{"class":182,"line":341},20,[180,343,344],{"class":231},"  html",[180,346,347],{"class":197}," { ",[180,349,350],{"class":241},"block-size",[180,352,261],{"class":197},[180,354,355],{"class":241},"100",[180,357,358],{"class":193},"%",[180,360,361],{"class":197},"; }\n",[180,363,365,368,370,373,375,377,379],{"class":182,"line":364},21,[180,366,367],{"class":231},"  body",[180,369,347],{"class":197},[180,371,372],{"class":241},"min-block-size",[180,374,261],{"class":197},[180,376,355],{"class":241},[180,378,358],{"class":193},[180,380,361],{"class":197},[180,382,384],{"class":182,"line":383},22,[180,385,205],{"emptyLinePlaceholder":204},[180,387,389],{"class":182,"line":388},23,[180,390,391],{"class":186},"  \u002F* 4. Readable defaults for body text; inherited everywhere. *\u002F\n",[180,393,395,397],{"class":182,"line":394},24,[180,396,367],{"class":231},[180,398,252],{"class":197},[180,400,402,405,407,410],{"class":182,"line":401},25,[180,403,404],{"class":241},"    line-height",[180,406,261],{"class":197},[180,408,409],{"class":241},"1.5",[180,411,267],{"class":197},[180,413,415,418,420,422,424,427],{"class":182,"line":414},26,[180,416,417],{"class":241},"    -webkit-text-size-adjust",[180,419,261],{"class":197},[180,421,355],{"class":241},[180,423,358],{"class":193},[180,425,426],{"class":197},";   ",[180,428,429],{"class":186},"\u002F* stop mobile Safari inflating text in landscape *\u002F\n",[180,431,433],{"class":182,"line":432},27,[180,434,273],{"class":197},[180,436,438],{"class":182,"line":437},28,[180,439,205],{"emptyLinePlaceholder":204},[180,441,443],{"class":182,"line":442},29,[180,444,445],{"class":186},"  \u002F* 5. Media are blocks that never overflow their container. Inline images\n",[180,447,449],{"class":182,"line":448},30,[180,450,451],{"class":186},"        otherwise sit on the text baseline and leave a small gap below. *\u002F\n",[180,453,455,458,460,463,465,468,470,473,475,477],{"class":182,"line":454},31,[180,456,457],{"class":231},"  img",[180,459,235],{"class":197},[180,461,462],{"class":231},"picture",[180,464,235],{"class":197},[180,466,467],{"class":231},"video",[180,469,235],{"class":197},[180,471,472],{"class":231},"canvas",[180,474,235],{"class":197},[180,476,61],{"class":231},[180,478,252],{"class":197},[180,480,482,485,487,490],{"class":182,"line":481},32,[180,483,484],{"class":241},"    display",[180,486,261],{"class":197},[180,488,489],{"class":241},"block",[180,491,267],{"class":197},[180,493,495,498,500,502,504],{"class":182,"line":494},33,[180,496,497],{"class":241},"    max-inline-size",[180,499,261],{"class":197},[180,501,355],{"class":241},[180,503,358],{"class":193},[180,505,267],{"class":197},[180,507,509],{"class":182,"line":508},34,[180,510,273],{"class":197},[180,512,514],{"class":182,"line":513},35,[180,515,205],{"emptyLinePlaceholder":204},[180,517,519],{"class":182,"line":518},36,[180,520,521],{"class":186},"  \u002F* 6. Form controls use the page font rather than the system UI font,\n",[180,523,525],{"class":182,"line":524},37,[180,526,527],{"class":186},"        and inherit colour so dark themes do not need per-control rules. *\u002F\n",[180,529,531,534,536,539,541,544,546,549],{"class":182,"line":530},38,[180,532,533],{"class":231},"  input",[180,535,235],{"class":197},[180,537,538],{"class":231},"button",[180,540,235],{"class":197},[180,542,543],{"class":231},"textarea",[180,545,235],{"class":197},[180,547,548],{"class":231},"select",[180,550,252],{"class":197},[180,552,554,557,559,562],{"class":182,"line":553},39,[180,555,556],{"class":241},"    font",[180,558,261],{"class":197},[180,560,561],{"class":241},"inherit",[180,563,267],{"class":197},[180,565,567,570,572,574],{"class":182,"line":566},40,[180,568,569],{"class":241},"    color",[180,571,261],{"class":197},[180,573,561],{"class":241},[180,575,267],{"class":197},[180,577,579],{"class":182,"line":578},41,[180,580,273],{"class":197},[180,582,584],{"class":182,"line":583},42,[180,585,205],{"emptyLinePlaceholder":204},[180,587,589],{"class":182,"line":588},43,[180,590,591],{"class":186},"  \u002F* 7. Long words and URLs wrap instead of forcing horizontal scroll. *\u002F\n",[180,593,595,598,600,602,604,606,608,611,613,616,618,621,623,626,628,631,633,636],{"class":182,"line":594},44,[180,596,597],{"class":231},"  p",[180,599,235],{"class":197},[180,601,10],{"class":231},[180,603,235],{"class":197},[180,605,41],{"class":231},[180,607,235],{"class":197},[180,609,610],{"class":231},"h3",[180,612,235],{"class":197},[180,614,615],{"class":231},"h4",[180,617,235],{"class":197},[180,619,620],{"class":231},"h5",[180,622,235],{"class":197},[180,624,625],{"class":231},"h6",[180,627,235],{"class":197},[180,629,630],{"class":231},"li",[180,632,235],{"class":197},[180,634,635],{"class":231},"figcaption",[180,637,252],{"class":197},[180,639,641,644,646,649],{"class":182,"line":640},45,[180,642,643],{"class":241},"    overflow-wrap",[180,645,261],{"class":197},[180,647,648],{"class":241},"break-word",[180,650,267],{"class":197},[180,652,654],{"class":182,"line":653},46,[180,655,273],{"class":197},[180,657,659],{"class":182,"line":658},47,[180,660,205],{"emptyLinePlaceholder":204},[180,662,664],{"class":182,"line":663},48,[180,665,666],{"class":186},"  \u002F* 8. Headings wrap into balanced lines; paragraphs avoid orphans. *\u002F\n",[180,668,670,673,675,677,679,681,683,685,687,689,691,693,695,698,700,703],{"class":182,"line":669},49,[180,671,672],{"class":231},"  h1",[180,674,235],{"class":197},[180,676,41],{"class":231},[180,678,235],{"class":197},[180,680,610],{"class":231},[180,682,235],{"class":197},[180,684,615],{"class":231},[180,686,235],{"class":197},[180,688,620],{"class":231},[180,690,235],{"class":197},[180,692,625],{"class":231},[180,694,347],{"class":197},[180,696,697],{"class":241},"text-wrap",[180,699,261],{"class":197},[180,701,702],{"class":241},"balance",[180,704,361],{"class":197},[180,706,708,710,712,714],{"class":182,"line":707},50,[180,709,597],{"class":231},[180,711,347],{"class":197},[180,713,697],{"class":241},[180,715,716],{"class":197},": pretty; }\n",[180,718,720],{"class":182,"line":719},51,[180,721,205],{"emptyLinePlaceholder":204},[180,723,725],{"class":182,"line":724},52,[180,726,727],{"class":186},"  \u002F* 9. Smooth scrolling only for users who have not asked for less motion. *\u002F\n",[180,729,731,734],{"class":182,"line":730},53,[180,732,733],{"class":193},"  @media",[180,735,736],{"class":197}," (prefers-reduced-motion: no-preference) {\n",[180,738,740,743,746,748,751,753,756],{"class":182,"line":739},54,[180,741,742],{"class":231},"    html",[180,744,745],{"class":241},":focus-within",[180,747,347],{"class":197},[180,749,750],{"class":241},"scroll-behavior",[180,752,261],{"class":197},[180,754,755],{"class":241},"smooth",[180,757,361],{"class":197},[180,759,761],{"class":182,"line":760},55,[180,762,273],{"class":197},[180,764,766],{"class":182,"line":765},56,[180,767,205],{"emptyLinePlaceholder":204},[180,769,771],{"class":182,"line":770},57,[180,772,773],{"class":186},"  \u002F* 10. A dedicated class hides content visually but keeps it available\n",[180,775,777],{"class":182,"line":776},58,[180,778,779],{"class":186},"         to assistive technology — the correct alternative to display:none\n",[180,781,783],{"class":182,"line":782},59,[180,784,785],{"class":186},"         for labels and skip links. *\u002F\n",[180,787,789,792,795,798,801,804,806,809],{"class":182,"line":788},60,[180,790,791],{"class":241},"  .visually-hidden:not",[180,793,794],{"class":197},"(",[180,796,797],{"class":241},":focus",[180,799,800],{"class":197},")",[180,802,803],{"class":241},":not",[180,805,794],{"class":197},[180,807,808],{"class":241},":active",[180,810,811],{"class":197},") {\n",[180,813,815,818,820,823],{"class":182,"line":814},61,[180,816,817],{"class":241},"    position",[180,819,261],{"class":197},[180,821,822],{"class":241},"absolute",[180,824,267],{"class":197},[180,826,828,831,833,836,839],{"class":182,"line":827},62,[180,829,830],{"class":241},"    inline-size",[180,832,261],{"class":197},[180,834,835],{"class":241},"1",[180,837,838],{"class":193},"px",[180,840,267],{"class":197},[180,842,844,847,849,851,853],{"class":182,"line":843},63,[180,845,846],{"class":241},"    block-size",[180,848,261],{"class":197},[180,850,835],{"class":241},[180,852,838],{"class":193},[180,854,267],{"class":197},[180,856,858,861,863,866],{"class":182,"line":857},64,[180,859,860],{"class":241},"    overflow",[180,862,261],{"class":197},[180,864,865],{"class":241},"hidden",[180,867,267],{"class":197},[180,869,871,874,876,879,881,883,885],{"class":182,"line":870},65,[180,872,873],{"class":241},"    clip-path",[180,875,261],{"class":197},[180,877,878],{"class":241},"inset",[180,880,794],{"class":197},[180,882,89],{"class":241},[180,884,358],{"class":193},[180,886,887],{"class":197},");\n",[180,889,891,894,896,899],{"class":182,"line":890},66,[180,892,893],{"class":241},"    white-space",[180,895,261],{"class":197},[180,897,898],{"class":241},"nowrap",[180,900,267],{"class":197},[180,902,904],{"class":182,"line":903},67,[180,905,273],{"class":197},[180,907,909],{"class":182,"line":908},68,[180,910,911],{"class":197},"}\n",[14,913,914,915,918,919,922,923,926],{},"Rule 1 is the one every reset agrees on, and the demo shows why. Both boxes are declared ",[18,916,917],{},"width: 100%"," with the same padding; under the default ",[18,920,921],{},"content-box"," model the padding is added ",[56,924,925],{},"outside"," the declared width, so the box is wider than its container at every size.",[928,929],"live-demo",{"name":930},"reset-box-sizing",[14,932,933,934,936,937,939,940,942,943,947,948,950,951,954,955,939,957,960],{},"A few other rules are worth expanding. Rule 3 uses ",[18,935,372],{}," rather than ",[18,938,350],{}," on ",[18,941,20],{},", so long pages grow normally; the pattern is taken further in ",[30,944,946],{"href":945},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fsticky-footer-with-flexbox-and-grid\u002F","Sticky Footer With Flexbox or Grid",". Rule 5 makes SVG ",[18,949,132],{},", which is right for illustrations but not for inline icons in text; icon components should set ",[18,952,953],{},"display: inline-block"," themselves, and that is fine because components sit in a later layer. Rule 9 applies smooth scrolling through ",[18,956,745],{},[18,958,959],{},"html",", which keeps it for in-page navigation while avoiding the odd effect of smooth scrolling on find-in-page.",[41,962,964],{"id":963},"the-key-technique-the-reset-loses-every-fight","The key technique: the reset loses every fight",[14,966,967,968,971,972,235,974,235,976,979,980,983,984,987,988,991],{},"The reason to wrap the reset in ",[18,969,970],{},"@layer reset"," is precedence. Reset selectors are broad — ",[18,973,238],{},[18,975,64],{},[18,977,978],{},"input"," — and some of them, such as ",[18,981,982],{},".visually-hidden:not(:focus):not(:active)",", have more specificity than a component author would expect. Outside layers, a component rule like ",[18,985,986],{},".btn { margin-block-end: 1rem }"," would still win against ",[18,989,990],{},"* { margin: 0 }",", but a component rule written with an element selector might not beat a more specific reset rule. Inside the first layer, every reset rule loses to every rule in every later layer, regardless of specificity.",[61,993,68,996,68,999,68,1002,68,1005,68,1013,68,1018,68,1021,68,1025,68,1028,68,1032,68,1036,68,1040,68,1043,68,1047,68,1055,68,1059,68,1066,68,1071,68,1075],{"viewBox":994,"role":64,"ariaLabel":995,"xmlns":66,"style":67},"0 0 720 270","Layer order diagram: reset first, then tokens, base, components and utilities, with later layers always winning regardless of specificity",[70,997,998],{},"Layer order decides before specificity does",[74,1000,1001],{},"Five stacked layers from reset at the bottom to utilities at the top. An arrow shows increasing precedence upward. A note explains that a low-specificity rule in the components layer beats a high-specificity rule in the reset layer.",[78,1003,1004],{"textAnchor":80,"x":81,"y":82,"style":83},"@layer reset, tokens, base, components, utilities",[86,1006],{"x":1007,"y":1008,"width":1009,"height":1010,"rx":1011,"fill":93,"opacity":1012},"160","210","400","34","6","0.14",[78,1014,1017],{"textAnchor":80,"x":81,"y":1015,"style":1016},"232","text-anchor:middle;fill:currentColor;font:13px ui-monospace,monospace","reset",[86,1019],{"x":1007,"y":1020,"width":1009,"height":1010,"rx":1011,"fill":93,"opacity":94},"170",[78,1022,1024],{"textAnchor":80,"x":81,"y":1023,"style":1016},"192","tokens",[86,1026],{"x":1007,"y":97,"width":1009,"height":1010,"rx":1011,"fill":93,"opacity":1027},"0.26",[78,1029,1031],{"textAnchor":80,"x":81,"y":1030,"style":1016},"152","base",[86,1033],{"x":1007,"y":1034,"width":1009,"height":1010,"rx":1011,"fill":93,"opacity":1035},"90","0.34",[78,1037,1039],{"textAnchor":80,"x":81,"y":1038,"style":1016},"112","components",[86,1041],{"x":1007,"y":89,"width":1009,"height":1010,"rx":1011,"fill":93,"opacity":1042},"0.45",[78,1044,1046],{"textAnchor":80,"x":81,"y":1045,"style":1016},"72","utilities",[182,1048],{"x1":1049,"y1":1050,"x2":1049,"y2":1051,"stroke":1052,"strokeWidth":1053,"opacity":1054},"600","240","56","currentColor","2","0.7",[1056,1057],"path",{"d":1058,"fill":1052,"opacity":1054},"M592 68 L600 52 L608 68 Z",[78,1060,1065],{"textAnchor":1061,"x":1062,"y":1063,"style":1064},"start","620","150","text-anchor:start;fill:currentColor;font:12px sans-serif","wins",[78,1067,1070],{"textAnchor":1068,"x":108,"y":1063,"style":1069},"end","text-anchor:end;fill:currentColor;font:12px sans-serif","specificity only",[78,1072,1074],{"textAnchor":1068,"x":108,"y":1073,"style":1069},"168","matters inside",[78,1076,1077],{"textAnchor":1068,"x":108,"y":139,"style":1069},"one layer",[14,1079,1080,1081,1085],{},"Declaring the full layer order in one statement at the top of the stylesheet — before any layer has content — fixes the order permanently, even if files are later loaded in a different sequence. The mechanics of layer precedence, and why it removes the need for specificity hacks, are covered in ",[30,1082,1084],{"href":1083},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks\u002F","Cascade Layers vs Specificity Hacks",".",[41,1087,1089],{"id":1088},"what-the-reset-deliberately-leaves-alone","What the reset deliberately leaves alone",[14,1091,1092],{},"A minimal reset is defined as much by what it omits:",[1094,1095,1096,1111,1121,1127,1133],"ul",{},[630,1097,1098,1102,1103,1106,1107,1110],{},[1099,1100,1101],"strong",{},"List styles."," Lists keep their bullets and numbers. Navigation lists that should not show bullets set ",[18,1104,1105],{},"list-style: none"," in their component — and add ",[18,1108,1109],{},"role=\"list\""," if the list semantics must survive in Safari, which drops list semantics from unstyled lists.",[630,1112,1113,1116,1117,1120],{},[1099,1114,1115],{},"Focus outlines."," The browser's focus ring stays until a component replaces it with a designed ",[18,1118,1119],{},":focus-visible"," style. Removing outlines in a reset is the single most harmful line found in old resets.",[630,1122,1123,1126],{},[1099,1124,1125],{},"Button appearance."," Buttons keep their native look; design-system buttons restyle themselves. A reset that strips all button styling makes every unstyled button on the page invisible as a button.",[630,1128,1129,1132],{},[1099,1130,1131],{},"Heading sizes."," Browser defaults for heading sizes are reasonable and are overridden by the design system anyway.",[630,1134,1135,1142,1143,1146],{},[1099,1136,1137,939,1140,1085],{},[18,1138,1139],{},"font-size",[18,1141,959],{}," Setting ",[18,1144,1145],{},"html { font-size: 62.5% }"," to make rem arithmetic easier overrides users' font-size preferences in a way that is easy to get wrong; leave the root at the user's default and design in rem.",[41,1148,1150],{"id":1149},"replacing-an-old-reset-in-an-existing-project","Replacing an old reset in an existing project",[14,1152,1153],{},"Swapping a large legacy reset for a minimal one changes defaults under every component at once, so do it in a way that makes the differences visible.",[14,1155,1156],{},"First, diff the effective defaults. For a representative set of elements — headings, paragraphs, lists, buttons, inputs, images, tables — record the computed styles under the old reset and the new one. Most differences are harmless, but a few will matter: lists regaining bullets, buttons regaining borders, tables regaining default spacing. Each of those tells you a component that was silently relying on the old reset, and each should get the style it needs in its own rule.",[14,1158,1159,1160,1162,1163,1166],{},"Second, move the old reset into a layer before replacing it. Wrapping the legacy file in ",[18,1161,970],{}," without changing a single rule is a safe first step; if anything changes visually, some component depended on the reset ",[56,1164,1165],{},"winning"," against it, which is worth knowing. Then replace the layer's contents with the minimal version.",[14,1168,1169,1170,1172,1173,1176],{},"Finally, run visual regression tests across the key templates and review the differences. Expect a batch of small spacing changes where ",[18,1171,990],{}," differs from the old approach, and settle them by giving content areas an explicit flow rule, such as a stack with ",[18,1174,1175],{},"gap",", rather than by adding margins back element by element.",[41,1178,1180],{"id":1179},"browser-support","Browser support",[14,1182,1183,1184,1186,1187,1190,1191,1194,1195,1198],{},"Everything in this reset is supported in current Chrome, Edge, Firefox and Safari. Cascade layers are supported in Chrome and Edge 99+, Firefox 97+ and Safari 15.4+; in older engines, ",[18,1185,194],{}," blocks are ignored entirely, so wrap the reset in a layer only if your support policy starts at or above those versions, or keep an unlayered copy for older targets. ",[18,1188,1189],{},"text-wrap: balance"," is supported in Chrome and Edge 114+, Firefox 121+ and Safari 17.5+, and ",[18,1192,1193],{},"text-wrap: pretty"," in current Chromium and Safari; unsupported values are ignored harmlessly. ",[18,1196,1197],{},"prefers-reduced-motion"," is supported in Chrome 74+, Edge 79+, Firefox 63+ and Safari 10.1+.",[41,1200,1202],{"id":1201},"faq","FAQ",[14,1204,1205,1208],{},[1099,1206,1207],{},"Do modern browsers still need a CSS reset?","\nThey need much less than they used to. Browser defaults are now consistent across engines, so old normalisation rules are mostly redundant. What remains useful is a handful of opinionated defaults that make layout predictable, such as border-box sizing, zeroed margins and block-level media.",[14,1210,1211,1214,1215,1217],{},[1099,1212,1213],{},"Should a reset remove focus outlines?","\nNo. Removing outlines globally makes keyboard navigation invisible and fails WCAG 2.4.7 Focus Visible. If the default ring clashes with the design, replace it with a custom ",[18,1216,1119],{}," style rather than removing it.",[14,1219,1220,1223,1224,235,1226,1228,1229,1231],{},[1099,1221,1222],{},"Why put the reset in a cascade layer?","\nA reset should lose to every other style. Placing it in the first cascade layer guarantees that any component or utility rule overrides it regardless of specificity, so reset selectors such as ",[18,1225,238],{},[18,1227,242],{}," and ",[18,1230,249],{}," never fight component styles.",[14,1233,1234,1240,1241,1243],{},[1099,1235,1236,1237,1239],{},"Is ",[18,1238,990],{}," too aggressive?","\nIt removes margins from every element, including paragraphs and headings, which then need spacing from a layout rule such as a stack with ",[18,1242,1175],{}," or a flow utility. Many teams prefer that explicitness; others reset only the elements whose default margins cause trouble. Both are defensible if applied consistently.",[41,1245,1247],{"id":1246},"related","Related",[1094,1249,1250,1255,1262,1269],{},[630,1251,1252,1254],{},[30,1253,33],{"href":32}," — the parent guide.",[630,1256,1257,1261],{},[30,1258,1260],{"href":1259},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens\u002F","Cascade Layers for Reset and Tokens"," — the layer structure this reset sits in.",[630,1263,1264,1268],{},[30,1265,1267],{"href":1266},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fcreating-accessible-focus-indicators\u002F","Creating Accessible Focus Indicators"," — what to do instead of removing outlines.",[630,1270,1271,1275],{},[30,1272,1274],{"href":1273},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing\u002F","Flexbox gap and Spacing"," — spacing content once margins are reset.",[1277,1278,1279],"style",{},"html pre.shiki code .sLBg1, html code.shiki .sLBg1{--shiki-default:#66707B;--shiki-dark:#BDC4CC}html pre.shiki code .sHUrx, html code.shiki .sHUrx{--shiki-default:#A0111F;--shiki-dark:#FF9492}html pre.shiki code .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 .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":176,"searchDepth":190,"depth":190,"links":1281},[1282,1283,1284,1285,1286,1287,1288,1289],{"id":43,"depth":190,"text":44},{"id":168,"depth":190,"text":169},{"id":963,"depth":190,"text":964},{"id":1088,"depth":190,"text":1089},{"id":1149,"depth":190,"text":1150},{"id":1179,"depth":190,"text":1180},{"id":1201,"depth":190,"text":1202},{"id":1246,"depth":190,"text":1247},"A short, justified reset for modern browsers: box-sizing, margins, media defaults, form fonts, text wrapping and motion, each explained, in a cascade layer.","md",{"pageTitle":1293,"datePublished":1294,"dateModified":1294,"faq":1295},"Writing a Minimal Modern CSS Reset","2026-09-18",[1296,1298,1300,1302],{"q":1207,"a":1297},"They need much less than they used to. Browser defaults are now consistent across engines, so old normalisation rules are mostly redundant. What remains useful is a handful of opinionated defaults that make layout predictable, such as border-box sizing, zeroed margins and block-level media.",{"q":1213,"a":1299},"No. Removing outlines globally makes keyboard navigation invisible and fails WCAG 2.4.7 Focus Visible. If the default ring clashes with the design, replace it with a custom :focus-visible style rather than removing it.",{"q":1222,"a":1301},"A reset should lose to every other style. Placing it in the first cascade layer guarantees that any component or utility rule overrides it regardless of specificity, so reset selectors such as *, ::before and ::after never fight component styles.",{"q":1303,"a":1304},"Is * { margin: 0 } too aggressive?","It removes margins from every element, including paragraphs and headings, which then need spacing from a layout rule such as a stack with gap or a flow utility. Many teams prefer that explicitness; others reset only the elements whose default margins cause trouble. Both are defensible if applied consistently.","\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset",{"title":5,"description":1290},"mastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fwriting-a-minimal-modern-reset\u002Findex","ElSG-gLPACtyMVfcLwVaWn_68_3sV-GfewXqYnrsfTw",[1310,1313,1316,1319,1322,1325,1328,1331,1334,1337,1340,1343,1346,1349,1352,1355,1358,1361,1364,1367,1370,1373,1376,1379,1382,1385,1388,1391,1394,1397,1400,1403,1406,1409,1412,1415,1418,1421,1424,1427,1430,1433,1436,1439,1442,1445,1448,1451,1454,1457,1460,1463,1466,1469,1472,1475,1478,1481,1484,1487,1490,1493,1496,1499,1502,1505,1508,1511,1514,1517,1520,1523,1526,1529,1532,1535,1538,1541,1544,1547,1550,1553,1556,1559,1562,1565,1568,1571,1574,1577,1580,1583,1586,1589,1592,1595,1598,1601,1604,1607,1610,1613,1616,1619,1622,1625,1628,1631,1634,1637,1640,1643,1646,1649,1652,1655,1658,1661,1664,1667,1670,1673,1676,1679,1682,1685,1688,1691,1694,1697,1700,1703,1706,1709,1712,1715,1718,1721,1724,1727,1730,1732,1735,1738,1741,1744,1747,1750,1753,1756,1759,1762,1765,1768,1769,1772,1775,1778,1781,1784,1787,1790,1793,1796,1799,1802,1805,1808,1811,1814,1817,1820,1823,1826,1829,1832,1835,1838,1841,1844,1847,1850,1853,1856,1859,1862,1865],{"path":1311,"title":1312},"\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":1314,"title":1315},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fflashing-content-and-seizure-thresholds","Flashing Content and Seizure Thresholds",{"path":1317,"title":1318},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fforced-colors-mode-and-animations","Forced Colors Mode and Animations",{"path":1320,"title":1321},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations","Accessibility in CSS Animations: Patterns, Specs & Best Practices",{"path":1323,"title":1324},"\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":1326,"title":1327},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fprefers-reduced-motion-recipes","prefers-reduced-motion Recipes: A Reduction for Every Common Effect",{"path":1329,"title":1330},"\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":1332,"title":1333},"\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":1335,"title":1336},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fvestibular-safe-animation-patterns","Vestibular-Safe Animation Patterns: Why Some Motion Makes People Sick",{"path":1338,"title":1339},"\u002Fcss-only-micro-interactions-animations\u002Faccessibility-in-css-animations\u002Fwcag-motion-success-criteria","WCAG Motion Success Criteria: What Each One Actually Requires",{"path":1341,"title":1342},"\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":1344,"title":1345},"\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":1347,"title":1348},"\u002Fcss-only-micro-interactions-animations\u002Fclip-path-and-mask-animations","Clip-Path & Mask Animations: Animating Visibility Instead of Position",{"path":1350,"title":1351},"\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":1353,"title":1354},"\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":1356,"title":1357},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fanimating-gradients","Animating CSS Gradients: Smooth Colour Motion Without Jumps",{"path":1359,"title":1360},"\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":1362,"title":1363},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions","Color & Theme Transitions: Colour as Part of the Motion System",{"path":1365,"title":1366},"\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":1368,"title":1369},"\u002Fcss-only-micro-interactions-animations\u002Fcolor-and-theme-transitions\u002Fsmooth-theme-switching-transitions","Smooth Theme Switching: Crossfades, Circular Reveals and No Flash",{"path":1371,"title":1372},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fcontainer-query-hover-affordances","Container Query Hover Affordances: When Narrow Means Persistent, Not Hidden",{"path":1374,"title":1375},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion","Container-Aware Motion: Animation Sized by the Space a Component Actually Has",{"path":1377,"title":1378},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Flayout-change-animations-at-container-breakpoints","Animating Changes at Container Breakpoints",{"path":1380,"title":1381},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fmotion-driven-by-container-style-queries","Motion Driven by Container Style Queries",{"path":1383,"title":1384},"\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":1386,"title":1387},"\u002Fcss-only-micro-interactions-animations\u002Fcontainer-aware-motion\u002Fsuppressing-motion-in-small-containers","Suppressing Motion in Small Containers: Deliberately Animating Nothing",{"path":1389,"title":1390},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fcontrolling-css-animations-from-javascript","Controlling CSS Animations From JavaScript",{"path":1392,"title":1393},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api","CSS Animation vs the Web Animations API: A Decision Guide",{"path":1395,"title":1396},"\u002Fcss-only-micro-interactions-animations\u002Fcss-animation-vs-web-animations-api\u002Fwaapi-vs-css-for-interruptible-ui","Interruptible UI: CSS Transitions vs WAAPI",{"path":1398,"title":1399},"\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":1401,"title":1402},"\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":1404,"title":1405},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fcustom-property-fallbacks-and-invalid-values","Custom Property Fallbacks and Invalid Values",{"path":1407,"title":1408},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Ffluid-spacing-tokens-driving-transition-durations","Fluid Spacing Tokens That Drive Transition Durations",{"path":1410,"title":1411},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture","CSS Custom Properties Architecture: Scalable Design Systems & Dynamic UI",{"path":1413,"title":1414},"\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":1416,"title":1417},"\u002Fcss-only-micro-interactions-animations\u002Fcss-custom-properties-architecture\u002Fscoping-custom-properties-to-components","Scoping Custom Properties to Components",{"path":1419,"title":1420},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fcss-transition-timing-functions","CSS Transition Timing Functions: ease, cubic-bezier(), steps() and linear()",{"path":1422,"title":1423},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals","CSS Transition Fundamentals: Architecture, Performance & Patterns",{"path":1425,"title":1426},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Finterrupted-and-reversing-transitions","Interrupted and Reversing Transitions: What Happens Mid-Flight",{"path":1428,"title":1429},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Fstarting-style-entry-animations","@starting-style: Animating an Element's Very First Style Change",{"path":1431,"title":1432},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-delay-choreography","Choreographing Motion With transition-delay",{"path":1434,"title":1435},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransition-shorthand-and-multiple-properties","The transition Shorthand and Multiple Properties",{"path":1437,"title":1438},"\u002Fcss-only-micro-interactions-animations\u002Fcss-transition-fundamentals\u002Ftransitioning-display-with-allow-discrete","Transitioning display with transition-behavior: allow-discrete and @starting-style",{"path":1440,"title":1441},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fanimating-dialog-open-and-close","Animating \u003Cdialog> Open and Close: Both Directions, No Library",{"path":1443,"title":1444},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fbackdrop-animations","Animating ::backdrop: Fades and Blurs Behind Dialogs and Popovers",{"path":1446,"title":1447},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations","Dialog & Popover Animations: Motion for the Top Layer",{"path":1449,"title":1450},"\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":1452,"title":1453},"\u002Fcss-only-micro-interactions-animations\u002Fdialog-and-popover-animations\u002Fpopover-entry-and-exit-transitions","Popover Menus That Animate From Their Anchor",{"path":1455,"title":1456},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fchoosing-animation-durations","Choosing Animation Durations: How Long Motion Should Last",{"path":1458,"title":1459},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fcubic-bezier-overshoot-and-anticipation","Overshoot and Anticipation With cubic-bezier(): Motion With Character",{"path":1461,"title":1462},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design\u002Fentry-vs-exit-easing","Entry vs Exit Easing: Different Curves for Arriving and Leaving",{"path":1464,"title":1465},"\u002Fcss-only-micro-interactions-animations\u002Feasing-and-motion-design","Easing & Motion Design: Making CSS Motion Feel Intentional",{"path":1467,"title":1468},"\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":1470,"title":1471},"\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":1473,"title":1474},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Faccessible-css-only-tooltips","Accessible CSS-Only Tooltips and Hover Cards With  and ",{"path":1476,"title":1477},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Fbutton-press-and-active-states","Button Press and  States",{"path":1479,"title":1480},"\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":1482,"title":1483},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design\u002Ffocus-within-form-patterns"," Form Patterns: Styling a Group From the Field Inside It",{"path":1485,"title":1486},"\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":1488,"title":1489},"\u002Fcss-only-micro-interactions-animations\u002Fhover-focus-state-design","Hover & Focus State Design: Spec-Compliant Patterns for Modern UIs",{"path":1491,"title":1492},"\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":1494,"title":1495},"\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":1497,"title":1498},"\u002Fcss-only-micro-interactions-animations","CSS-Only Micro-Interactions & Animations: Architecture, Performance & Implementation",{"path":1500,"title":1501},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fanimation-composition-and-stacking","Stacking Animations With animation-composition",{"path":1503,"title":1504},"\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":1506,"title":1507},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcontainer-query-triggered-keyframe-animations","Container-Query-Triggered Keyframe Animations: Animate Differently per Available Space",{"path":1509,"title":1510},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fcss-only-accordions-and-disclosure","CSS-Only Accordions and Disclosure Widgets with details and summary",{"path":1512,"title":1513},"\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":1515,"title":1516},"\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":1518,"title":1519},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns","Keyframe Animation Patterns: Spec-Compliant Architectures for Modern UIs",{"path":1521,"title":1522},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fmulti-step-keyframes-and-per-keyframe-easing","Multi-Step Keyframes and Per-Keyframe Easing",{"path":1524,"title":1525},"\u002Fcss-only-micro-interactions-animations\u002Fkeyframe-animation-patterns\u002Fstaggered-list-animations-with-custom-properties","Staggered List Animations Using --i Index Custom Properties",{"path":1527,"title":1528},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fanimating-box-shadow-and-filters-cheaply","Animating box-shadow and Filters Cheaply",{"path":1530,"title":1531},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcontain-property-for-animation-performance","The contain Property for Animation Performance",{"path":1533,"title":1534},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Fcss-triggers-layout-paint-composite","Layout, Paint and Composite: What Triggers What",{"path":1536,"title":1537},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration","Performance & GPU Acceleration in CSS: A Developer’s Blueprint",{"path":1539,"title":1540},"\u002Fcss-only-micro-interactions-animations\u002Fperformance-gpu-acceleration\u002Foptimizing-css-animations-for-60fps","Optimizing CSS Animations for 60fps: Budgeting the Frame",{"path":1542,"title":1543},"\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":1545,"title":1546},"\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":1548,"title":1549},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations","Scroll-Driven Animations: Binding Motion to Scroll Position in Pure CSS",{"path":1551,"title":1552},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-animation-fallbacks","Shipping Scroll-Driven Animations Without Breaking Anything",{"path":1554,"title":1555},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-driven-parallax-effects","Scroll-Driven Parallax Effects in CSS",{"path":1557,"title":1558},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-progress-bar-without-javascript","A Reading Progress Bar Driven by scroll(root)",{"path":1560,"title":1561},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fscroll-triggered-reveal-animations","Reveal-on-Scroll with view() and animation-range",{"path":1563,"title":1564},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Ftimeline-scope-for-cross-element-animations","timeline-scope for Cross-Element Animations",{"path":1566,"title":1567},"\u002Fcss-only-micro-interactions-animations\u002Fscroll-driven-animations\u002Fview-timeline-and-animation-range","View Timelines and animation-range",{"path":1569,"title":1570},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fcross-document-view-transitions","Cross-Document View Transitions",{"path":1572,"title":1573},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers","View Transitions for CSS Developers: the Pseudo-Element Tree, Snapshots, and Named Elements",{"path":1575,"title":1576},"\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":1578,"title":1579},"\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":1581,"title":1582},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transition-types-and-classes","View Transition Types and Classes",{"path":1584,"title":1585},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-for-list-reordering","View Transitions for List Reordering",{"path":1587,"title":1588},"\u002Fcss-only-micro-interactions-animations\u002Fview-transitions-for-css-developers\u002Fview-transitions-with-reduced-motion","Honouring prefers-reduced-motion in View Transitions",{"path":1590,"title":1591},"\u002F","Modern CSS Layouts & Micro-Interactions",{"path":1593,"title":1594},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioned-tooltips","Anchor-Positioned Tooltips: Tethering, Flipping, and Getting the Semantics Right",{"path":1596,"title":1597},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-positioning-fallbacks","Anchor Positioning Fallbacks: A Graceful Floor for Older Browser Versions",{"path":1599,"title":1600},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fanchor-size-for-matching-widths","anchor-size(): Overlays That Match Their Trigger's Size",{"path":1602,"title":1603},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays","CSS Anchor Positioning and Overlays: Tethering Elements Without JavaScript",{"path":1605,"title":1606},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-attribute-and-css-styling","The popover Attribute: Top-Layer Overlays With No JavaScript",{"path":1608,"title":1609},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fpopover-light-dismiss-and-stacking","Popover Light Dismiss, Nesting and Stacking",{"path":1611,"title":1612},"\u002Fmastering-container-queries-responsive-layouts\u002Fanchor-positioning-and-overlays\u002Fposition-area-grid-explained","position-area: The Anchor Placement Grid",{"path":1614,"title":1615},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fcontainer-query-polyfill-tradeoffs","Container Query Polyfills: What They Cost and When to Skip Them",{"path":1617,"title":1618},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ffeature-detection-with-supports","Feature Detection with @supports: Syntax, Semantics, and the Traps",{"path":1620,"title":1621},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fhandling-container-query-fallbacks-for-older-browsers","Handling Container Query Fallbacks for Older Browsers",{"path":1623,"title":1624},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks","Container Query Fallbacks: Spec-Compliant CSS Strategies for Legacy Browsers",{"path":1626,"title":1627},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Fintrinsic-layout-fallbacks-without-queries","Intrinsic Layout Fallbacks: Baselines That Adapt Without Any Query",{"path":1629,"title":1630},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-fallbacks\u002Ftesting-fallbacks-without-old-browsers","Testing CSS Fallbacks Without an Old Browser",{"path":1632,"title":1633},"\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":1635,"title":1636},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-query-range-and-logic-operators","Container Query Range Syntax and Logic Operators",{"path":1638,"title":1639},"\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":1641,"title":1642},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-type-size-vs-inline-size","Choosing container-type: inline-size, size, or normal",{"path":1644,"title":1645},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fcontainer-vs-media-queries-comparison","Container vs Media Queries: Choosing the Right Reference Box",{"path":1647,"title":1648},"\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":1650,"title":1651},"\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":1653,"title":1654},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics","Container Query Syntax Basics",{"path":1656,"title":1657},"\u002Fmastering-container-queries-responsive-layouts\u002Fcontainer-query-syntax-basics\u002Fnesting-and-naming-container-queries","Nesting and Naming Container Queries: Targeting the Right Ancestor",{"path":1659,"title":1660},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fauto-fit-minmax-responsive-grids","Responsive Grids with repeat(auto-fit, minmax())",{"path":1662,"title":1663},"\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":1665,"title":1666},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fgrid-auto-flow-dense-packing","grid-auto-flow: dense for Packed Layouts",{"path":1668,"title":1669},"\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":1671,"title":1672},"\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":1674,"title":1675},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts","CSS Grid and Subgrid Layouts for Responsive Interfaces",{"path":1677,"title":1678},"\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":1680,"title":1681},"\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":1683,"title":1684},"\u002Fmastering-container-queries-responsive-layouts\u002Fcss-grid-and-subgrid-layouts\u002Fsubgrid-vs-nested-grid","Subgrid vs an Independently Nested Grid",{"path":1686,"title":1687},"\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":1689,"title":1690},"\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":1692,"title":1693},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-grow-and-flex-shrink-explained","flex-grow and flex-shrink Explained",{"path":1695,"title":1696},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflex-wrap-intrinsic-responsive-rows","Breakpoint-Free Responsive Rows With flex-wrap and flex-basis",{"path":1698,"title":1699},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns\u002Fflexbox-gap-and-spacing","Flexbox gap vs Margins: Spacing Items Without Edge Hacks",{"path":1701,"title":1702},"\u002Fmastering-container-queries-responsive-layouts\u002Fflexbox-layout-patterns","Flexbox Layout Patterns: One-Dimensional Layout for Real Components",{"path":1704,"title":1705},"\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":1707,"title":1708},"\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":1710,"title":1711},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Fdebugging-clamp-values","Debugging clamp(): Values That Are Ignored, Stuck or Never Fluid",{"path":1713,"title":1714},"\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":1716,"title":1717},"\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":1719,"title":1720},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-type-accessibility-and-zoom","Fluid Type, Accessibility and Zoom: The vw-Only Trap",{"path":1722,"title":1723},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp\u002Ffluid-typography-without-javascript","Fluid Typography Without JavaScript: A Precision CSS Reference",{"path":1725,"title":1726},"\u002Fmastering-container-queries-responsive-layouts\u002Ffluid-typography-with-clamp","Fluid Typography with clamp(): A Practical Guide for Modern CSS",{"path":1728,"title":1729},"\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":1731,"title":38},"\u002Fmastering-container-queries-responsive-layouts",{"path":1733,"title":1734},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Faspect-ratio-for-responsive-media","Using aspect-ratio for Responsive Media and Preventing Layout Shift",{"path":1736,"title":1737},"\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":1739,"title":1740},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques","Intrinsic Sizing Techniques: Modern CSS Layouts for Responsive UI",{"path":1742,"title":1743},"\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":1745,"title":1746},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fmin-max-fit-content-explained","min-content, max-content, and fit-content() Explained",{"path":1748,"title":1749},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fobject-fit-and-object-position","object-fit and object-position: Images That Fit Any Box",{"path":1751,"title":1752},"\u002Fmastering-container-queries-responsive-layouts\u002Fintrinsic-sizing-techniques\u002Fpreventing-flex-and-grid-overflow","The min-width: auto Trap in Flex and Grid Layouts",{"path":1754,"title":1755},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-for-reset-and-tokens","Cascade Layers for Reset and Design Tokens",{"path":1757,"title":1758},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcascade-layers-vs-specificity-hacks","Cascade Layers vs Specificity Hacks: Ordering Instead of Escalating",{"path":1760,"title":1761},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies\u002Fcss-scope-for-component-styles","@scope for Component Styles: Short Selectors That Cannot Leak",{"path":1763,"title":1764},"\u002Fmastering-container-queries-responsive-layouts\u002Fmodern-css-reset-strategies","Modern CSS Reset Strategies: A Spec-Compliant Foundation",{"path":1766,"title":1767},"\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":1305,"title":5},{"path":1770,"title":1771},"\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":1773,"title":1774},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has\u002Fempty-and-loading-states-with-has","Empty and Loading States With ()",{"path":1776,"title":1777},"\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":1779,"title":1780},"\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":1782,"title":1783},"\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":1785,"title":1786},"\u002Fmastering-container-queries-responsive-layouts\u002Fparent-aware-layouts-with-has","Parent-Aware Layouts With :has(): Letting Containers React to Their Contents",{"path":1788,"title":1789},"\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":1791,"title":1792},"\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":1794,"title":1795},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-data-tables","Container Query Data Tables: Reflowing Tables to Cards",{"path":1797,"title":1798},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fcontainer-query-sidebar-layouts","Container Query Sidebar Layouts That Travel Between Contexts",{"path":1800,"title":1801},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns","Responsive Component Patterns: Architecture & Implementation",{"path":1803,"title":1804},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-forms-with-container-queries","Responsive Forms with Container Queries: Reflow Without Losing the Wiring",{"path":1806,"title":1807},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-hero-sections-with-container-queries","Responsive Hero Sections With Container Queries",{"path":1809,"title":1810},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-navigation-without-media-queries","Responsive Navigation Without Media Queries Using Container Queries",{"path":1812,"title":1813},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Fresponsive-pricing-tables","Responsive Pricing Tables: Aligned Features, a Clear Recommendation, Any Width",{"path":1815,"title":1816},"\u002Fmastering-container-queries-responsive-layouts\u002Fresponsive-component-patterns\u002Ftabs-that-become-accordions","Tabs That Become an Accordion: One Component, Two Layouts",{"path":1818,"title":1819},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts\u002Fcss-only-carousel-with-scroll-snap","A CSS-Only Carousel With Scroll Snap",{"path":1821,"title":1822},"\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":1824,"title":1825},"\u002Fmastering-container-queries-responsive-layouts\u002Fscroll-snap-and-overflow-layouts","Scroll Snap & Overflow Layouts: Designing Components That Scroll on Purpose",{"path":1827,"title":1828},"\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":1830,"title":1831},"\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":1833,"title":1834},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fcombining-size-and-style-queries","Combining Size and Style Container Queries",{"path":1836,"title":1837},"\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":1839,"title":1840},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state","Style Queries and Container State: Token-Driven Component Variants",{"path":1842,"title":1843},"\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":1845,"title":1846},"\u002Fmastering-container-queries-responsive-layouts\u002Fstyle-queries-and-container-state\u002Fstyle-query-component-variants","Component Variants With Style Queries: One Token, Many Looks",{"path":1848,"title":1849},"\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":1851,"title":1852},"\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":1854,"title":1855},"\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":1857,"title":1858},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout","Viewport Units & Mobile Layout: Designing for the Screen You Actually Get",{"path":1860,"title":1861},"\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":1863,"title":1864},"\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":1866,"title":1867},"\u002Fmastering-container-queries-responsive-layouts\u002Fviewport-units-and-mobile-layout\u002Fvirtual-keyboard-and-interactive-widget","Layouts That Survive the Virtual Keyboard",{"title":1869,"caption":1870,"height":1871,"resizable":204,"html":1872,"css":1873},"Why the reset starts with box-sizing","Both boxes are width: 100% with 1.5rem of padding. The content-box one overflows its dashed container; the border-box one fits at every width.",220,"\n\u003Cdiv class=\"frame\">\n  \u003Cdiv class=\"box content\">content-box: 100% + padding\u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\u003Cdiv class=\"frame\">\n  \u003Cdiv class=\"box border\">border-box: 100% including padding\u003C\u002Fdiv>\n\u003C\u002Fdiv>","\nbody { display: grid; gap: 1rem; align-content: center; justify-items: stretch; }\n.frame { border: 1px dashed var(--demo-border); padding: 0; overflow: visible; }\n.box { width: 100%; padding: 1.5rem; border: 2px solid var(--demo-accent); border-radius: 6px; background: var(--demo-surface); font: 13px ui-monospace, monospace; }\n.content { box-sizing: content-box; }\n.border { box-sizing: border-box; }",1789717749756]