Skip to content

Instantly share code, notes, and snippets.

@guill3m
Last active December 5, 2015 19:16
Show Gist options
  • Select an option

  • Save guill3m/4273505 to your computer and use it in GitHub Desktop.

Select an option

Save guill3m/4273505 to your computer and use it in GitHub Desktop.
SCSS Reset & Normalize ###### This is the reset I use nowadays on the sites I develop. It’s kind of a mix of various CSS Resets and the Normalize CSS (http://necolas.github.com/normalize.css/). It also includes the micro clearfix hack (http://nicolasgallagher.com/micro-clearfix-hack/). It’s not perfect, I know, but it suits my needs fine for now…
/* Mixins */
@mixin box-sizing($val) {
-webkit-box-sizing: $val;
-moz-box-sizing: $val;
box-sizing: $val;
// Box-Sizing Pollyfill - https://github.com/Schepp/box-sizing-polyfill
*behavior: url(http://absolute/path/to/boxsizing.htc);
}
/* Reset & Normalize */
* {
@include box-sizing(border-box);
}
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, input, textarea, output, ruby, section, summary, time, mark, audio, video {
border: 0;
font: inherit {
size: 100%;
}
margin: 0;
padding: 0;
vertical-align: baseline;
}
a img {
border: 0;
}
a:focus {
outline: thin dotted;
}
a:active,
a:hover {
outline: 0;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary {
display: block;
}
abbr[title], dfn[title] {
border-bottom: 1px dotted;
cursor: help;
}
audio, canvas, video {
display: inline-block;
.ie7 & {
display: inline;
zoom: 1;
}
}
audio:not([controls]) {
display: none;
height: 0;
}
b,
strong {
font-weight: bold;
}
blockquote, q {
// This is the proper order for quotes if you're writting in spanish or catalan (most of my work is).
// For american english you want to lose the «…» and only have “…” & ‘…’.
// And if you’re british you want to change the order and put ‘…’ before “…”, if you want to do it the right way.
// For other languages I don’t really know, just check Wikipedia, there’s an article just for this:
// http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks
// Yes, I’m kind of an orthotypography geek.
quotes: "«" "»" "“" "”" "‘" "’";
&:before {
content: open-quote;
}
&:after {
content: close-quote;
}
}
body {
line-height: 1;
}
button,
input {
line-height: normal;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
.ie7 & {
overflow: visible;
}
}
button[disabled],
input[disabled] {
cursor: default;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
code, kbd, pre, samp {
font: {
family: monospace;
size: 1em;
}
}
dfn {
font-style: italic;
}
legend {
white-space: normal;
}
[hidden] {
display: none;
}
hr {
border: 0;
margin: 0;
padding: 0;
}
html {
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
// Responsive images
img {
max-width: 100%;
.ie7 & {
-ms-interpolation-mode: bicubic;
}
}
input, select {
vertical-align: middle;
}
input[type="checkbox"],
input[type="radio"] {
height: 13px !important;
width: 13px !important;
}
.ie7 legend {
margin-left: -7px;
}
mark {
background: #ff0;
color: #000;
}
nav ul {
list-style: none;
}
pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
svg:not(:root) {
overflow: hidden;
}
table {
border: {
collapse: collapse;
spacing: 0;
}
}
textarea {
overflow: auto;
vertical-align: top;
}
// Micro clearfix hack - http://nicolasgallagher.com/micro-clearfix-hack/
%clear-fix {
.ie7 & {
zoom: 1;
}
&:before,
&:after {
content: "";
display: table;
}
&:after {
clear:both;
}
}
@guill3m
Copy link
Copy Markdown
Author

guill3m commented Dec 13, 2012

SCSS Reset & Normalize

This is the reset I use nowadays on the sites I develop.
It’s kind of a mix of various CSS Resets and the Normalize CSS.
It also includes the micro clearfix hack.
It’s not perfect, I know, but it suits my needs fine for now.
In constant revision and open for suggestions to improve it.

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