Skip to content

Instantly share code, notes, and snippets.

@nathanaelnsmith
Forked from JoshuaJones/layout.scss
Created April 26, 2013 17:45
Show Gist options
  • Save nathanaelnsmith/5469016 to your computer and use it in GitHub Desktop.
Save nathanaelnsmith/5469016 to your computer and use it in GitHub Desktop.
// Normalize & Layout
article, aside, details, figcaption, figure, footer,
header, hgroup, nav, section, summary { display: block; }
audio, canvas, video {
display: inline-block;
*display: inline;
*zoom: 1;
}
audio:not([controls]) { display: none; }
[hidden] { display: none; }
/* Base */
html {
font-size: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@-ms-viewport { width: device-width; }
@-webkit-viewport { width: device-width; }
@-moz-viewport { width: device-width; }
@-o-viewport { width: device-width; }
@viewport { width: device-width; }
html, button, input, select, textarea {
font-family: sans-serif;
color: #222;
}
body {
margin: 0;
font-size: 1em;
line-height: 1.4;
}
::-moz-selection {
background: #b3d4fc;
text-shadow: none;
}
::selection {
background: #b3d4fc;
text-shadow: none;
}
/* Embedded Content */
img {
border: 0;
vertical-align: middle;
-ms-interpolation-mode: bicubic;
}
svg:not(:root) { overflow: hidden; }
figure { margin: 0; }
/* Form Elements */
form { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; }
label { cursor: pointer; }
legend {
border: 0;
padding: 0;
white-space: normal;
*margin-left: -7px;
}
button, input, select, textarea {
font-size: 100%;
margin: 0;
vertical-align: baseline;
*vertical-align: middle;
}
button, input { line-height: normal; }
button, input[type="button"], input[type="reset"], input[type="submit"] {
cursor: pointer;
-webkit-appearance: button;
*overflow: visible;
}
button[disabled], input[disabled] { cursor: default; }
input[type="checkbox"], input[type="radio"] {
box-sizing: border-box;
padding: 0;
*width: 13px;
*height: 13px;
}
button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; }
textarea {
overflow: auto;
resize: vertical;
vertical-align: top;
}
/* Tables */
table { border-collapse: collapse; border-spacing: 0; }
td { vertical-align: top; }
.chromeframe { background: #ccc; color: #000; margin: 0.2em 0; padding: 0.2em 0; }
// Structure
// Mixins
@mixin retinaBackground($file, $width, $height, $type: png) {
background-image: url($file + '.' + $type);
@media (-webkit-min-device-pixel-ratio: 1.5), (-moz-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
& {
background-image: url($file + '@2x.' + $type);
@include background-size($width $height);
}
}
}
@mixin size($width, $height) {
height: $height;
width: $width;
}
// Type
// Headings
// --------------------------
h1, h2, h3, h4, h5, h6 {
margin: ($baseLineHeight / 2) 0;
font-family: $headingsFontFamily;
font-weight: $headingsFontWeight;
line-height: 1;
color: $headingsColor;
text-rendering: optimizelegibility; // Fix the character spacing for headings
small {
font-weight: normal;
line-height: 1;
color: $grayLight;
}
}
h1 { font-size: 36px; line-height: 40px; }
h2 { font-size: 30px; line-height: 40px; }
h3 { font-size: 24px; line-height: 40px; }
h4 { font-size: 18px; line-height: 20px; }
h5 { font-size: 14px; line-height: 20px; }
h6 { font-size: 12px; line-height: 20px; }
h1 small { font-size: 24px; }
h2 small { font-size: 18px; }
h3 small { font-size: 14px; }
h4 small { font-size: 14px; }
// Links
// --------------------------
a {
color: #00e;
@include transition(color 0.25s ease);
}
a:visited {
color: #551a8b;
}
a:hover {
color: #06e;
}
a:focus { outline: thin dotted; }
a:hover, a:active { outline: 0; }
// Lists
// --------------------------
ul, ol {
margin: 1em 0;
padding: 0 0 0 40px;
}
dd { margin: 0 0 0 40px; }
nav ul, nav ol {
list-style: none;
list-style-image: none;
margin: 0;
padding: 0;
}
// Misc
// --------------------------
abbr[title] { border-bottom: 1px dotted; }
b, strong { font-weight: bold; }
blockquote { margin: 1em 40px; }
dfn { font-style: italic; }
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
}
ins {
background: #ff9;
color: #000;
text-decoration: none;
}
mark {
background: #ff0;
color: #000;
font-style: italic;
font-weight: bold;
}
pre, code, kbd, samp {
font-family: monospace, serif;
_font-family: 'courier new', monospace;
font-size: 1em;
}
pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}
q { quotes: none; }
q:before, q:after {
content: "";
content: none;
}
small { font-size: 85%; }
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup { top: -0.5em; }
sub { bottom: -0.25em; }
// Variables
// Grays
// --------------------------
$black: #000;
$grayDarker: #222;
$grayDark: #333;
$gray: #555;
$grayLight: #999;
$grayLighter: #eee;
$white: #fff;
// Paths
// --------------------------
$imgsPath: "/images";
// Typography
// --------------------------
$sansFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;
$serifFontFamily: Georgia, "Times New Roman", Times, serif;
$monoFontFamily: Monaco, Menlo, Consolas, "Courier New", monospace;
$baseFontSize: 14px;
$baseFontFamily: $sansFontFamily;
$baseLineHeight: 20px;
$altFontFamily: $serifFontFamily;
$headingsFontFamily: inherit; // empty to use BS default, $baseFontFamily
$headingsFontWeight: bold; // instead of browser default, bold
$headingsColor: inherit; // empty to use BS default, @textColor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment