Last active
March 3, 2024 11:27
-
-
Save fabioluzm/b524ed3e4119220e045233cae26d15ea to your computer and use it in GitHub Desktop.
CSS Basic Reset
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
/* SOME PLAIN CSS RESETS */ | |
/* | |
1. Fix mobile increase font-size on landscape mode | |
*/ | |
html { | |
-moz-text-size-adjust: none; | |
-webkit-text-size-adjust: 100%; | |
text-size-adjust: none; | |
} | |
/* | |
2. Use a more-intuitive box-sizing model. | |
3. Remove default margin, padding | |
*/ | |
*, | |
*::before, | |
*::after { | |
box-sizing: border-box; | |
margin: unset; | |
padding: unset; | |
} | |
/* | |
Typographic tweaks! | |
4. Add accessible line-height | |
5. Improve text rendering | |
*/ | |
body { | |
line-height: 1.5; | |
-webkit-font-smoothing: antialiased; | |
} | |
/* | |
6. Render the `main` element consistently in IE. | |
*/ | |
main { | |
display: block; | |
} | |
/* | |
7. Improve media defaults | |
*/ | |
img, | |
picture, | |
video, | |
canvas, | |
svg { | |
display: block; | |
max-width: 100%; | |
} | |
/* | |
8. Remove built-in form typography styles | |
*/ | |
input, | |
button, | |
textarea, | |
select { | |
font: inherit; | |
} | |
/* | |
9. Avoid text overflows | |
*/ | |
p, | |
h1, | |
h2, | |
h3, | |
h4, | |
h5, | |
h6 { | |
overflow-wrap: break-word; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment