Skip to content

Instantly share code, notes, and snippets.

@robinmetral
Forked from Andy-set-studio/reset.css
Created April 8, 2019 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robinmetral/4fc2dd1f3a16d36a60371d3b4bc0340d to your computer and use it in GitHub Desktop.
Save robinmetral/4fc2dd1f3a16d36a60371d3b4bc0340d to your computer and use it in GitHub Desktop.
Minimal CSS reset
/* Box sizing rules */
* {
box-sizing: border-box;
}
*:before,
*:after {
box-sizing: inherit;
}
/* Remove margin and padding from elements */
body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
li,
dd,
figure,
figcaption,
dl,
dd,
dt {
margin: 0px;
padding: 0px;
}
body {
/* Hide persistent scrollbar in IE (10/11) and Edge */
-ms-overflow-style: -ms-autohiding-scrollbar;
/* Anchor links will transition rather than skip */
scroll-behavior: smooth;
/* Reset font size to 1rem, in case it has a pixel value */
font-size: 1rem;
min-height: 100vh;
}
/* 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: underline;
text-decoration-skip-ink: auto;
cursor: pointer;
}
/* Turn off the recent search in WebKit. */
::-webkit-search-decoration {
display: none;
}
/* Normalise form field line-height in WebKit */
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
select::-webkit-input-placeholder {
line-height: normal;
}
/* Make a search box appear like a text box */
input[type='search'] {
-webkit-appearance: textfield;
}
/* Make images responsive */
img {
max-width: 100%;
}
/* Remove _all_ animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
* {
-webkit-animation: none !important;
animation: none !important;
transition: none !important;
scroll-behavior: auto !important;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment