A Small Modern CSS Foundation

suggest change

Large 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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents