Skip to content

Instantly share code, notes, and snippets.

@rpearce
Created April 27, 2012 07:42
Show Gist options
  • Save rpearce/2507078 to your computer and use it in GitHub Desktop.
Save rpearce/2507078 to your computer and use it in GitHub Desktop.
SASS iteration, interpolation, mixin, function
$sections: section1, section2;
$section1-bg: #72B075;
$section2-bg: #D4968E;
@mixin border-radius($amount) {
-webkit-border-radius: $amount;
-moz-border-radius : $amount;
-o-border-radius : $amount;
-ms-border-radius : $amount;
border-radius : $amount;
}
@function get_background($arg) {
@if $arg == section1 { @return $section1-bg }
@if $arg == section2 { @return $section2-bg }
}
@each $section in $sections {
.#{$section} {
@include border-radius(8px);
background: get_background($section);
padding: 20px 0px 20px 20px; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment