Created
April 27, 2012 07:42
-
-
Save rpearce/2507078 to your computer and use it in GitHub Desktop.
SASS iteration, interpolation, mixin, function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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