Skip to content

Instantly share code, notes, and snippets.

View rpearce's full-sized avatar
👶
infant and toddler duty

Robert Pearce rpearce

👶
infant and toddler duty
View GitHub Profile
@rpearce
rpearce / gist:2506411
Created April 27, 2012 06:16
SASS list example1
$my-list: design, statistics, english, yosup;
$color-list: #123456, #432156;
@rpearce
rpearce / gist:2506434
Created April 27, 2012 06:23
SASS for and while example1
(ripped from sass-lang.com docs)
@for $i from 1 through 3 {
.item-#{$i} { width: 2em * $i; }
}
(compiles to...)
.item-1 {
width: 2em; }
@rpearce
rpearce / gist:2506609
Created April 27, 2012 06:33
SASS each example1
@each $item in $my-list {
.#{item} {
background: #0099ff; }
}
(compiles to...)
.design {
background: #0099ff; }
@rpearce
rpearce / gist:2506692
Created April 27, 2012 06:47
SASS selector inheritance example1
.ease-in-out {
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
#logo-container {
@extend .ease-in-out;
@rpearce
rpearce / gist:2506767
Created April 27, 2012 07:07
SASS mixin example1
@mixin border-radius($amount) {
-webkit-border-radius: $amount;
-moz-border-radius : $amount;
-o-border-radius : $amount;
-ms-border-radius : $amount;
border-radius : $amount; }
.container {
@include border-radius(4px);
text-align: center;
@rpearce
rpearce / gist:2506803
Created April 27, 2012 07:13
css mixin example
.container {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-ms-border-radius: 4px;
border-radius: 4px;
text-align: center;
position: relative; }
.content {
@rpearce
rpearce / gist:2506833
Created April 27, 2012 07:18
SASS math
@mixin opacity($amount) {
-moz-opacity : $amount;
-khtml-opacity: $amount;
opacity : $amount;
filter : progid:DXImageTransform.Microsoft.Alpha(opacity=(#{$amount * 100}));
}
#link { @include opacity(0.5) }
@rpearce
rpearce / gist:2506841
Created April 27, 2012 07:19
SASS math output
#link {
-moz-opacity: 0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=(50)); }
@rpearce
rpearce / gist:2506941
Created April 27, 2012 07:30
SASS interpolation, list, mixin, and @each
// List
$box-shadow-properties: -webkit-box-shadow, -moz-box-shadow, box-shadow;
// Mixin waiting to be included
@mixin box-shadow-with-inset($box-shadow-params, $inset-params) {
// Iterates over each element in the list
@each $property in $box-shadow-properties {
// Uses interpolation to have the compiler then list out the properties listed above
#{$property}: $box-shadow-params, $inset-params; }
}
@rpearce
rpearce / gist:2506959
Created April 27, 2012 07:31
SASS interpolation, list, mixin, and @each -- compiled
.logobar-inner {
-webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25), inset 0px -1px 0px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25), inset 0px -1px 0px rgba(0, 0, 0, 0.1);
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25), inset 0px -1px 0px rgba(0, 0, 0, 0.1); }