Created
April 16, 2024 10:18
-
-
Save DarkAng3L/f2e4bf7f941bf06204eca96088194945 to your computer and use it in GitHub Desktop.
CSS: Reset by Kevin Powell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Kevin Powell | |
* https://youtu.be/2lyDv0wOQuQ | |
* https://youtu.be/cCAtD_BAHNw | |
*/ | |
*, *::before, *::after { | |
box-sizing: border-box; /* Switch to border-box for box-sizing. */ | |
} | |
* { | |
margin: 0; | |
padding: 0; | |
font: inherit; /* Get rid of all font sizes and heights */ | |
} | |
html { | |
color-scheme: dark light; /* Default dark */ | |
hanging-punctuation: first last; /* Not supported in Chrome */ | |
} | |
body { | |
margin: 0; /* Remove the tiny space around the edge of the page */ | |
min-height: 100vh; | |
} | |
/* Media responsive */ | |
img, picture, svg, video, canvas, audio, iframe, embed, object { | |
display: block; /* Switch display mode to block, since that's what we usually want for images. */ | |
vertical-align: middle; /* If you override, and make an image inline, it's likely you'll want middle vertical alignment. */ | |
max-width: 100%; | |
} | |
h1, h2, h3, h4, h5, h6 { | |
text-wrap: balance; | |
} | |
p { | |
max-width: 75ch; | |
text-wrap: pretty; /* Prevents orphans on lines */ | |
} | |
@media (prefers-reduced-motion: no-preference) { | |
:has(:target) { | |
scroll-behavior: smooth; | |
scroll-padding-top: 3rem; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment