Skip to content

Instantly share code, notes, and snippets.

@MrGrigri
Created April 23, 2024 22:10
Show Gist options
  • Save MrGrigri/203ff2f7f60a1b1b899ff756c7d4db33 to your computer and use it in GitHub Desktop.
Save MrGrigri/203ff2f7f60a1b1b899ff756c7d4db33 to your computer and use it in GitHub Desktop.
Modern CSS Reset
@layer reset {
/*
Josh's Custom CSS Reset
https://www.joshwcomeau.com/css/custom-css-reset/
*/
/* Modified by Michael Richins */
:where(*, *::before, *::after) {
box-sizing: border-box;
}
:where(*) {
margin: 0;
font-size: unset;
}
:where(html, body) {
margin: 0;
min-block-size: 100vh;
min-block-size: 100dvh;
scroll-behavior: smooth;
}
:where(body) {
line-height: 1.5;
font-smooth: always;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}
:where(img, picture, video, canvas, svg) {
display: block;
max-inline-size: 100%;
}
:where(ul[role='list'], ol[role='list']) {
list-style: none;
}
:where(input, button, textarea, select) {
font: inherit;
}
:where(p, h1, h2, h3, h4, h5, h6) {
overflow-wrap: break-word;
}
:where(h1, h2, h3, h4, h5, h6) {
text-wrap: balance;
}
:where(a:not([class])) {
text-decoration-skip-ink: auto;
color: currentColor;
}
@media (prefers-reduced-motion: reduce) {
:where(*) {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment