Modern CSS reset?

Previously I have been using sanitize CSS reset. In practice it turned out to be quite extra and still needed tweaking.

For now my approach is: the simpler = the better. The CSS reset from Josh Comeau is quite simple and modern: as you may see, it us…


This content originally appeared on DEV Community and was authored by avcat

Previously I have been using sanitize CSS reset. In practice it turned out to be quite extra and still needed tweaking.

For now my approach is: the simpler = the better. The CSS reset from Josh Comeau is quite simple and modern: as you may see, it uses newer properties for text-wrap and interpolate-size. In the linked article you will find explanations for all the properties used.

/*
  Josh's Custom CSS Reset
  https://www.joshwcomeau.com/css/custom-css-reset/
*/

*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

p {
  text-wrap: pretty;
}

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

#root, #__next {
  isolation: isolate;
}


This content originally appeared on DEV Community and was authored by avcat


Print Share Comment Cite Upload Translate Updates
APA

avcat | Sciencx (2025-09-15T16:44:06+00:00) Modern CSS reset?. Retrieved from https://www.scien.cx/2025/09/15/modern-css-reset/

MLA
" » Modern CSS reset?." avcat | Sciencx - Monday September 15, 2025, https://www.scien.cx/2025/09/15/modern-css-reset/
HARVARD
avcat | Sciencx Monday September 15, 2025 » Modern CSS reset?., viewed ,<https://www.scien.cx/2025/09/15/modern-css-reset/>
VANCOUVER
avcat | Sciencx - » Modern CSS reset?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/09/15/modern-css-reset/
CHICAGO
" » Modern CSS reset?." avcat | Sciencx - Accessed . https://www.scien.cx/2025/09/15/modern-css-reset/
IEEE
" » Modern CSS reset?." avcat | Sciencx [Online]. Available: https://www.scien.cx/2025/09/15/modern-css-reset/. [Accessed: ]
rf:citation
» Modern CSS reset? | avcat | Sciencx | https://www.scien.cx/2025/09/15/modern-css-reset/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.