Last active
September 4, 2024 16:42
-
-
Save swarad07/e8dfb8b608ca9593df3686b78e9202b3 to your computer and use it in GitHub Desktop.
Modern CSS Reset
This file contains hidden or 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
/* Makes sizing intuative */ | |
*, | |
*::before, | |
*::after { | |
box-sizing: border-box; | |
} | |
/* Remove default spacing */ | |
/* Force styling of type through styling, rather than elements */ | |
* { | |
margin: 0; | |
padding: 0; | |
font: inherit; | |
} | |
/* Color scheme support */ | |
html { | |
color-scheme: dark light; | |
} | |
/* Min body height */ | |
body { | |
min-height: 100vh; | |
} | |
/* Responsive images/videos */ | |
img, | |
picture, | |
svg, | |
video { | |
display: block; | |
max-width: 100%; | |
} | |
/* Balanced headings */ | |
h1, | |
h2, | |
h3, | |
h4, | |
h5, | |
h6 { | |
text-wrap: balance; | |
} | |
/* Prevent content from touching and prevent orphans with pretty */ | |
p, li, figcaption { | |
/* Only chromium for now */ | |
text-wrap: pretty; | |
max-width: 65ch; | |
} | |
/* Better container queries */ | |
header, footer, | |
main, | |
section, | |
article { | |
container-type: inline-size; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment