Skip to content

Instantly share code, notes, and snippets.

@kmafeni04
Created June 5, 2024 17:54
Show Gist options
  • Save kmafeni04/08cb42430fe70b14977ac628192353e3 to your computer and use it in GitHub Desktop.
Save kmafeni04/08cb42430fe70b14977ac628192353e3 to your computer and use it in GitHub Desktop.
css reset
:root {
--font-color-light: black;
--font-color-dark: white;
}
@media (prefers-color-scheme: light) {
:root {
--font-color: var(--font-color-light);
}
}
@media (prefers-color-scheme: dark) {
:root {
--font-color: var(--font-color-dark);
}
}
* {
font-family:
system-ui,
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
Oxygen,
Ubuntu,
Cantarell,
"Open Sans",
"Helvetica Neue",
sans-serif;
padding: 0;
margin: 0;
color: inherit;
box-sizing: inherit;
}
*,
*::after,
*::before {
box-sizing: inherit;
}
html {
color-scheme: dark light;
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
html {
scroll-padding-top: 4rem;
scroll-behavior: smooth;
}
}
body {
color: var(--font-color);
min-height: 100svh;
}
img,
video,
svg,
picture {
display: block;
width: 100%;
}
input,
textarea,
button,
select {
font: inherit;
}
button {
cursor: pointer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment