Last active
January 15, 2020 16:54
-
-
Save SynCap/d341185dfbe888e4d5e86bfffb7148b0 to your computer and use it in GitHub Desktop.
Really smart CSS 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
/* Указываем box sizing */ | |
*, | |
*::before, | |
*::after { | |
box-sizing: border-box; | |
} | |
/* Убираем внутренние отступы */ | |
ul[class], | |
ol[class] { | |
padding: 0; | |
} | |
/* Убираем внешние отступы */ | |
body, | |
h1, | |
h2, | |
h3, | |
h4, | |
p, | |
ul[class], | |
ol[class], | |
li, | |
figure, | |
figcaption, | |
blockquote, | |
dl, | |
dd { | |
margin: 0; | |
} | |
/* Выставляем основные настройки по-умолчанию для body */ | |
body { | |
min-height: 100vh; | |
scroll-behavior: smooth; | |
text-rendering: optimizeSpeed; | |
line-height: 1.33; | |
} | |
/* Удаляем стандартную стилизацию для всех ul и il, у которых есть атрибут class*/ | |
ul[class], | |
ol[class] { | |
list-style: none; | |
} | |
/* Элементы a, у которых нет класса, сбрасываем до дефолтных стилей */ | |
a:not([class]) { | |
text-decoration-skip-ink: auto; | |
} | |
/* Упрощаем работу с изображениями */ | |
img { | |
max-width: 100%; | |
display: block; | |
} | |
/* Указываем понятную периодичность в потоке данных у article*/ | |
article > * + * { | |
margin-top: 1em; | |
} | |
/* Наследуем шрифты для инпутов и кнопок */ | |
input, | |
button, | |
textarea, | |
select { | |
font: inherit; | |
} | |
/* Удаляем все анимации и переходы для людей, которые предпочитай их не использовать */ | |
@media (prefers-reduced-motion: reduce) { | |
* { | |
animation-duration: 0.01ms !important; | |
animation-iteration-count: 1 !important; | |
transition-duration: 0.01ms !important; | |
scroll-behavior: auto !important; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment