Skip to content

Instantly share code, notes, and snippets.

@black1277
Created March 3, 2022 16:11
Show Gist options
  • Save black1277/eb46960df194dfcacfd50ec66fad2357 to your computer and use it in GitHub Desktop.
Save black1277/eb46960df194dfcacfd50ec66fad2357 to your computer and use it in GitHub Desktop.
Сброс стилей по новому
/*** The new CSS Reset - version 1.2.0 (last updated 23.7.2021) ***/
/* Remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property */
*:where(:not(iframe, canvas, img, svg, video):not(svg *)) {
all: unset;
display: revert;
}
/* Preferred box-sizing value */
*,
*::before,
*::after {
box-sizing: border-box;
}
/*
Remove list styles (bullets/numbers)
in case you use it with normalize.css
*/
ol, ul {
list-style: none;
}
/* For images to not be able to exceed their container */
img {
max-width: 100%;
}
/* Removes spacing between cells in tables */
table {
border-collapse: collapse;
}
/* Revert the 'white-space' property for textarea elements on Safari */
textarea {
white-space: revert;
}
@black1277
Copy link
Author

black1277 commented Mar 3, 2022

о «Новой перезагрузке CSS»
В CSS у нас есть две группы свойств:
Группа унаследованных свойств: это свойства, которые имеют наследование по умолчанию — в основном свойства типографики.
Группа ненаследуемых свойств: это все остальные свойства, которые не наследуются по умолчанию, например, свойства блочной модели, включающие padding, border и margin.

ol::marker, ul::marker { 
color: transparent;
font-size: 0;
}

 input,
 textarea,
 select {
    all: revert;
 }

pre { white-space: revert; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment