Skip to content

Instantly share code, notes, and snippets.

@claudiojunior-me
Last active October 20, 2019 20:30
Show Gist options
  • Save claudiojunior-me/56aa972119f651442c79fa2885835520 to your computer and use it in GitHub Desktop.
Save claudiojunior-me/56aa972119f651442c79fa2885835520 to your computer and use it in GitHub Desktop.
Example of CSS Reset
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default padding */
ul[class],
ol[class] {
padding: 0;
}
/* Remove default margin */
body,
h1,
h2,
h3,
h4,
,
ul[pclass],
ol[class],
li,
figure,
figcaption,
blockquote,
dl,
dd {
margin: 0;
}
/* Set core body defaults */
body {
min-height: 100vh;
scroll-behavior: smooth;
text-rendering: optimizeSpeed;
line-height: 1.5;
}
/* Remove list styles on ul, ol elements with a class attribute */
ul[class],
ol[class] {
list-style: none;
}
/* A elements that don't have a class get default styles */
a:not([class]) {
text-decoration-skip-ink: auto;
}
/* Make images easier to work with */
img {
max-width: 100%;
display: block;
}
/* Natural flow and rhythm in articles by default */
article > * + * {
margin-top: 1em;
}
/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
font: inherit;
}
/* Remove _all_ animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
* {
animation-play-state: paused !important;
transition: none !important;
scroll-behavior: auto !important;
}
}
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: inherit;
font: inherit;
}
i, cite, em, var, dfn, address {
/* prevent faux italic */
font-style: normal;
}
b, h1, h2, h3, h4, h5, h6, strong, th {
/* prevent faux bold */
font-weight: normal;
}
/* HTML5 display-role reset for older browsers (UC Browser on Android) */
article, aside, figcaption, figure, footer, header, menu, section {
display: block;
}
blockquote, q {
/* browsers use English quotation marks which may not be appropriate for every language */
/* see https://en.wikipedia.org/wiki/Quotation_mark#Summary_table */
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: none;
}
table {
/* default to compact tables */
border-collapse: collapse;
border-spacing: 0;
}
img {
vertical-align: bottom; /* remove bottom spacing from images */
}
*, ::before, ::after {
box-sizing: border-box; /* intuitive sizing */
}
[hidden] {
display: none !important; /* enforce semantics */
}
/* https://github.com/mozdevs/cssremedy/issues/11#issuecomment-462867630 */
@media (prefers-reduced-motion: reduce) {
*:not(.safe-animation),
*:not(.safe-animation)::before,
*:not(.safe-animation)::after {
animation-duration: 0.01s !important;
animation-delay: 0s !important;
animation-iteration-count: 1 !important;
transition-duration: 0s !important;
transition-delay: 0s !important;
scroll-behavior: auto !important;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment