Skip to content

Instantly share code, notes, and snippets.

View hjortureh's full-sized avatar

Hjörtur Elvar Hilmarsson hjortureh

View GitHub Profile
var $element = $(“<input id=’name’ name=’name’ type=’text’ class=’shiny-input“ />”);
@hjortureh
hjortureh / gist:3939318
Created October 23, 2012 15:11
Vendor prefixing with SASS
@mixin border-radius($argument) {
-webkit-border-radius: $argument;
-ms-border-radius: $argument;
-moz-border-radius: $argument;
-o-border-radius: $argument;
border-radius: $argument;
}
@hjortureh
hjortureh / gist:3939474
Created October 23, 2012 15:30
Vendor prefixing in SASS
@mixin vendor-prefix($name, $argument) {
-webkit-#{$name}: $argument;
-ms-#{$name}: $argument;
-moz-#{$name}: $argument;
-o-#{$name}: $argument;
#{$name}: $argument;
}
@mixin border-radius($argument) {
@include vendor-prefix(border-radius, $argument);
@hjortureh
hjortureh / gist:3939487
Created October 23, 2012 15:32
Extend & placeholders in SASS
%clearfix {
overflow: none;
*zoom: 1;
}
header {
@extend %clearfix;
}
footer {
@hjortureh
hjortureh / gist:3939504
Created October 23, 2012 15:34
Placeholder CSS output
header, footer {
overflow: none;
*zoom: 1;
}
@hjortureh
hjortureh / gist:3939509
Created October 23, 2012 15:35
Functions in SASS
@function pixels-to-ems($target, $context: 16) {
@return ($target / $context) * 1em;
}
.container {
width: pixels-to-ems(800);
}
@hjortureh
hjortureh / gist:3948503
Created October 24, 2012 20:06
Responsive viewport
<meta name="viewport" content="width=device-width, initial-scale=1"/ >
@hjortureh
hjortureh / gist:3948527
Created October 24, 2012 20:09
Responsive height
html,
body {
height: 100%;
}
@hjortureh
hjortureh / gist:3948535
Created October 24, 2012 20:11
Responsive max width
.wrapper {
width: 100%;
margin: 0 auto;
max-width: 1024px;
}
@hjortureh
hjortureh / gist:3948541
Created October 24, 2012 20:12
Responsive padding
.wrapper {
width: 100%;
padding-left: 1em;
padding-right: 1em;
}