A Small Modern CSS Foundation
suggest changeLarge historical reset sheets removed nearly every browser default and then required authors to rebuild useful behavior. A smaller foundation is often easier to maintain:
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
color-scheme: light dark;
font-family: system-ui, sans-serif;
line-height: 1.5;
text-size-adjust: 100%;
}
body {
margin: 0;
}
img,
picture,
svg,
video {
display: block;
max-inline-size: 100%;
}
button,
input,
select,
textarea {
font: inherit;
}
:target {
scroll-margin-block: 5rem;
}
Keep defaults that provide useful semantics and accessibility, such as list markers and visible focus indicators. Reset a browser default only when the design replaces it intentionally.
A maintained normalization package can still be appropriate when a project supports a broad or unusual browser matrix. Pin its version and treat it as a dependency rather than copying an old snapshot into the application.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents