Skip to content

Instantly share code, notes, and snippets.

@swarad07
Last active September 4, 2024 16:42
Show Gist options
  • Save swarad07/e8dfb8b608ca9593df3686b78e9202b3 to your computer and use it in GitHub Desktop.
Save swarad07/e8dfb8b608ca9593df3686b78e9202b3 to your computer and use it in GitHub Desktop.
Modern CSS Reset
/* 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